page.java
来自「derby database source code.good for you.」· Java 代码 · 共 1,220 行 · 第 1/4 页
JAVA
1,220 行
**/ RecordHandle insertAtSlot( int slot, Object[] row, FormatableBitSet validColumns, LogicalUndo undo, byte insertFlag, int overflowThreshold) throws StandardException; /** Values for insertFlag: */ /** * Values for insertFlag. * <p> * * INSERT_INITIAL - flag initializer * * INSERT_DEFAULT - default insert behavior, if the record does * not fit on the page where the insert * operation is called, an error will be * returned, instead of overflowing the record. * * INSERT_UNDO_WITH_PURGE - if this is set, then the undo of this insert * will purge the row rather than mark it as * deleted, which is the default behaviro for * insertAtSlot and insert. * * INSERT_CONDITIONAL - if this flag is set, then, the overflow is * conditional. The record will be overflowed * only if it exceeds the threshold specified * by the properties, or the parameter. * * INSERT_OVERFLOW - if this flag is set, then the insert * operation will overflow the record if it does * not fit on the page. * * INSERT_FOR_SPLIT - a record is being updated that causes new * portions to be inserted *and* the last new * portion needs to point to an existing portion. * * Rules for the insert flags: * 1. If INSERT_DEFAULT is set, INSERT_CONDITIONAL and INSERT_OVERFLOW * will be ignored * 2. INSERT_UNDO_WITH_PURGE can be set with any of the other 3 flags. * 3. If INSERT_OVERFLOW is not set, INSERT_CONDITIONAL will be ignored. * But, it is not necessary to set INSERT_CONDITIONAL when setting * INSERT_OVERFLOW. * 4. If INSERT_DEFAULT, INSERT_OVERFLOW both are not set, then, default * insert action will be taken, i.e. no overflow will be allowed. **/ static final byte INSERT_INITIAL = (byte) 0x00; // init the flag static final byte INSERT_DEFAULT = (byte) 0x01; // default flag static final byte INSERT_UNDO_WITH_PURGE = (byte) 0x02; // purge row on undo static final byte INSERT_CONDITIONAL = (byte) 0x04; // conditional // insert static final byte INSERT_OVERFLOW = (byte) 0x08; // insert with // possible overflow static final byte INSERT_FOR_SPLIT = (byte) 0x10; // rawstore only /** * Fetch a record located in the passed in slot. * <p> * Fetch a record located in the passed in slot and fill-in the passed in * StorebleRow and the Object columns contained within. If row * is null then the record is locked but is not fetched. * <BR> * This interface allows the caller to either return a deleted row or not. * If "ignoreDelete" is set to true, fetch the record regardless of whether * it is deleted or not (same as above fetchFromSlot). However, if * "ignoreDelete" is set to false and the and the slot correspond to a * deleted row, null is returned. * <BR> * If a non-null Qualifier list is provided then the qualifier array will * be applied to the row and the row will only be returned if the row * qualifies, otherwise null will be returned. Values in the columns of * row may or may not be altered while trying to apply the qualifiers, if * null is returned the state of the columns is undefined. If a null * Qualifier list is provided then no qualification is applied. * <BR> * If a non-null record handle is passed in, it is assumed that the record * handle corresponds to the record in the slot. If record handle is null, * a record handle will be manufactured and returned if the record is not * deleted or if "ignoreDelete" is true. This parameter is here for the * case where the caller have already manufactured the record handle for * locking or other purposes so it would make sense for the page to avoid * creating a new record handle object if possible. * * * @param rh the record handle of the row. If non-null it must * refer to the same record as the slot. * @param slot the slot number * @param row Row to be filled in with information from record. * @param fetchDesc A structure to efficiently carry a set of parameters * needed to describe the fetch, these include: * * validColumns - A bit map of which columns in the * row to be fetched. ValidColumns will not be * changed by RawStore. * * qualifier_list - * A list of Qualifiers to apply to the row to see if * the row should be returned. * * An array of qualifiers which restrict whether or not * the row should be returned by the fetch. Rows for * which any one of the qualifiers returns false are * not returned by the fetch. If null, no qualification * is done and the requested columns of the rows are * returned. Qualifiers can only reference columns * which are included in the scanColumnList. The * column id that a qualifier returns is the column id * the table, not the column id in the partial row * being returned. * qualifier_scratch_space - * An array of int's that matches the size of the * row[] array. Used to process qualifiers, if no * qualifiers are input then array need not be * input. Passed in rather than allocated so that * space can be allocated a single time in a scan. * If not passed in then raw store will allocate and * deallocate per call. * * @param ignoreDelete if true, return row regardless of whether it is * deleted or not. If false, only return non-deleted * row. * * @return A handle to the record. * * @exception StandardException Standard Cloudscape error policy * * @see LockingPolicy **/ public RecordHandle fetchFromSlot( RecordHandle rh, int slot, Object[] row, FetchDescriptor fetchDesc, boolean ignoreDelete) throws StandardException; /** Fetch a single field from a deleted or non-deleted record. Fills in the passed in Object column with the field identified by fieldid if column is not null, otherwise the record is locked but not fetched. <BR> The fieldId of the first field is 0. If the fieldId is >= the number of fields on the record, column is restored to null <P> <B>Locking Policy</B> <BR> No locks are obtained. It is up to the caller to obtain the correct locks. <BR> It is guaranteed that the page latch is not released by this method @param slot is the slot number @param fieldId is the column id @param column is to be filled in with information from the record. @return the Handle to the record that is locked @exception StandardException Standard Cloudscape error policy, a statement level exception is thrown if the slot is not on the page. @see Page#fetchFromSlot @see LockingPolicy */ public RecordHandle fetchFieldFromSlot( int slot, int fieldId, Object column) throws StandardException; /** * Test if a record is deleted. * <p> * * <P> * <B>Locking Policy</B> * <BR> * No locks are obtained. * * <BR> * It is guaranteed that the page latch is not released by this method * * @param slot slot of record to be tested. * * @exception StandardException Standard Cloudscape error policy, a * statement level exception is thrown if the * slot is not on the page. **/ public boolean isDeletedAtSlot(int slot) throws StandardException; /** Update a field within the record, replacing its current value with the stored representation of newValue. Record is identified by slot. If the field does not exist then it is added to the record, but only if (fieldId - 1) exists. <BR><B>RESOLVE</B> right now it throws an exception if fieldId is not already on the record, not add the next one as advertised. <P> <B>Locking Policy</B> <P> Calls the lockRecordForWrite() method of the LockingPolicy object passed to the openContainer() call before the record is updated. <BR> It is guaranteed that the page latch is not released by this method @param slot is the slot number @param fieldId is the column id @param newValue has the new colum value to be stored in the record @param undo if logical undo may be necessary, a function pointer to the access code where the logical undo logic resides. Null if logical undo is not necessary. @return a Handle to the updated record. @exception StandardException Standard Cloudscape error policy, a statement level exception is thrown if the slot is not on the page, or if the record is deleted, or if the fieldId is not on the record and (fieldId - 1) does not exist. @exception StandardException The container was not opened in update mode. @see LockingPolicy @see LogicalUndo @see LogicalUndoable */ public RecordHandle updateFieldAtSlot( int slot, int fieldId, Object newValue, LogicalUndo undo) throws StandardException; /** * Fetch the number of fields in a record. * <p> * * <P> * <B>Locking Policy</B> * <P> * No locks are obtained. * * <BR> * It is guaranteed that the page latch is not released by this method * * @param slot is the slot number * * @return the number of fields in the record * * @exception StandardException Standard Cloudscape error policy **/ public int fetchNumFieldsAtSlot(int slot) throws StandardException; /** Mark the record identified by slot as deleted or undeleted according to the delete flag. */ /** * Mark the record at slot as deleted or undeleted according to delete flag. * <p> * * <P> * <B>Locking Policy</B> * <P> * Calls the lockRecordForWrite() method of the LockingPolicy object passed * to the openContainer() call before the record is deleted. If record * already deleted, and an attempt is made to delete it, an exception is * thrown. If record not deleted, and an attempt is made to undelete it, * an exception is thrown. * * <BR> * MT - latched * * @return a Handle to the deleted/undeleted record. * * @param slot is the slot number * @param delete true if this record is to be deleted false if this * deleted record is to be marked undeleted * @param undo if logical undo may be necessary, a function pointer to * the access code where the logical undo logic resides. * Null if logical undo is not necessary.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?