Class HeapController
- All Implemented Interfaces:
ConglomerateController, ConglomPropertyQueryable
-
Field Summary
Fields inherited from class GenericController
open_conglomFields inherited from interface ConglomerateController
LOCK_INS, LOCK_INS_PREVKEY, LOCK_READ, LOCK_UPD, LOCK_UPDATE_LOCKS, ROWISDUPLICATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate RecordHandledoInsert(DataValueDescriptor[] row) Insert a new row into the heap.Public Methods of XXXX class:protected final voidgetRowPositionFromRowLocation(RowLocation row_loc, RowPosition pos) Protected concrete impl of abstract methods of GenericConglomerateController class:protected PagegetUserPageNoWait(long pageno) protected PagegetUserPageWait(long pageno) intinsert(DataValueDescriptor[] row) Public Methods of This class:voidinsertAndFetchLocation(DataValueDescriptor[] row, RowLocation templateRowLocation) insert row and fetch it's row location in one operation.protected longload(TransactionManager xact_manager, Heap heap, boolean createConglom, RowLocationRetRowSource rowSource) booleanlockRow(long page_num, int record_id, int lock_operation, boolean wait, int lock_duration) Lock the given record id/page num pair.protected booleanlockRow(RecordHandle rh, int lock_oper, boolean wait, int lock_duration) booleanlockRow(RowLocation loc, int lock_operation, boolean wait, int lock_duration) Lock the given row location.protected booleanReturn a row location object of the correct type to be used in calls to insertAndFetchLocation.protected final booleanpurgeCommittedDeletes(Page page) Check and purge committed deleted rows on a page.protected voidprotected voidremovePage(Page page) voidunlockRowAfterRead(RowLocation loc, boolean forUpdate, boolean row_qualified) UnLock the given row location.Methods inherited from class GenericConglomerateController
close, closeForEndTransaction, delete, fetch, fetch, replaceMethods inherited from class GenericController
checkConsistency, debugConglomerate, getEstimatedRowCount, getInternalTablePropertySet, getOpenConglom, getSpaceInfo, getTableProperties, init, isKeyed, isTableLocked, setEstimatedRowCountMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ConglomerateController
checkConsistency, close, closeForEndTransaction, debugConglomerate, delete, fetch, fetch, getSpaceInfo, isKeyed, replaceMethods inherited from interface ConglomPropertyQueryable
getInternalTablePropertySet, getTableProperties
-
Constructor Details
-
HeapController
public HeapController()
-
-
Method Details
-
getRowPositionFromRowLocation
protected final void getRowPositionFromRowLocation(RowLocation row_loc, RowPosition pos) throws StandardException Protected concrete impl of abstract methods of GenericConglomerateController class:- Overrides:
getRowPositionFromRowLocationin classGenericController- Throws:
StandardException
-
queueDeletePostCommitWork
- Overrides:
queueDeletePostCommitWorkin classGenericController- Throws:
StandardException
-
purgeCommittedDeletes
Check and purge committed deleted rows on a page.- Parameters:
page- A non-null, latched page must be passed in. If all rows on page are purged, then page will be removed and latch released.- Returns:
- true, if no purging has been done on page, and thus latch can be released before end transaction. Otherwise the latch on the page can not be released before commit.
- Throws:
StandardException- Standard exception policy.
-
doInsert
Insert a new row into the heap.Overflow policy: The current heap access method implements an algorithm that optimizes for fetch efficiency vs. space efficiency. A row will not be over flowed unless it is bigger than a page. If it is bigger than a page then it's initial part will be placed on a page and then subsequent parts will be overflowed to other pages.
- Parameters:
row- The row to insert.- Returns:
- The record handle of the inserted row.
- Throws:
StandardException- Standard exception policy.
-
load
protected long load(TransactionManager xact_manager, Heap heap, boolean createConglom, RowLocationRetRowSource rowSource) throws StandardException - Throws:
StandardException
-
lockRow
protected boolean lockRow(RecordHandle rh, int lock_oper, boolean wait, int lock_duration) throws StandardException - Throws:
StandardException
-
getUserPageNoWait
- Throws:
StandardException
-
getUserPageWait
- Throws:
StandardException
-
lockRowAtSlotNoWaitExclusive
- Throws:
StandardException
-
removePage
- Throws:
StandardException
-
insert
Public Methods of This class:- Specified by:
insertin interfaceConglomerateController- Parameters:
row- The row to insert into the conglomerate. The stored representations of the row's columns are copied into a new row somewhere in the conglomerate.- Returns:
- Returns 0 if insert succeeded. Returns ConglomerateController.ROWISDUPLICATE if conglomerate supports uniqueness checks and has been created to disallow duplicates, and the row inserted had key columns which were duplicate of a row already in the table. Other insert failures will raise StandardException's.
- Throws:
StandardException- Standard exception policy.- See Also:
-
insertAndFetchLocation
public void insertAndFetchLocation(DataValueDescriptor[] row, RowLocation templateRowLocation) throws StandardException Description copied from interface:ConglomerateControllerinsert row and fetch it's row location in one operation.Insert a row into the conglomerate, and store its location in the provided destination row location. The row location must be of the correct type for this conglomerate (a new row location of the correct type can be obtained from newRowLocationTemplate()).
- Specified by:
insertAndFetchLocationin interfaceConglomerateController- Parameters:
row- The row to insert into the conglomerate. The stored representations of the row's columns are copied into a new row somewhere in the conglomerate.templateRowLocation- The rowlocation to read the inserted row location into.- Throws:
StandardException- Standard exception policy.- See Also:
-
lockRow
public boolean lockRow(RowLocation loc, int lock_operation, boolean wait, int lock_duration) throws StandardException Lock the given row location.Should only be called by access.
This call can be made on a ConglomerateController that was opened for locking only.
RESOLVE (mikem) - move this call to ConglomerateManager so it is obvious that non-access clients should not call this.
- Specified by:
lockRowin interfaceConglomerateController- Parameters:
loc- The "RowLocation" which describes the exact row to lock.lock_operation- For what operation are we requesting the lock, this should be one of the following 4 options: LOCK_READ [read lock], (LOCK_INS | LOCK_UPD) [ lock for insert], (LOCK_INSERT_PREVKEY | LOCK_UPD) [lock for previous key to insert], (LOCK_UPD) [lock for delete or replace] (LOCK_UPD | LOCK_UPDATE_LOCKS) [lock scan for update, will upgrade lock later if actual update is take place]wait- Should the lock call wait to be granted?lock_duration- If set to TransactionManager.LOCK_INSTANT_DURATION, then lock will be released immediately after being granted.- Returns:
- true if lock was granted, only can be false if wait was false.
- Throws:
StandardException- Standard exception policy.
-
unlockRowAfterRead
public void unlockRowAfterRead(RowLocation loc, boolean forUpdate, boolean row_qualified) throws StandardException UnLock the given row location.Should only be called by access.
This call can be made on a ConglomerateController that was opened for locking only.
RESOLVE (mikem) - move this call to ConglomerateManager so it is obvious that non-access clients should not call this.
- Specified by:
unlockRowAfterReadin interfaceConglomerateController- Parameters:
loc- The "RowLocation" which describes the row to unlock.forUpdate- Row was previously Locked the record for read or update.row_qualified- Row was qualified and returned to the user.- Throws:
StandardException- Standard exception policy.
-
lockRow
public boolean lockRow(long page_num, int record_id, int lock_operation, boolean wait, int lock_duration) throws StandardException Lock the given record id/page num pair.Should only be called by access, to lock "special" locks formed from the Recordhandle.* reserved constants for page specific locks.
This call can be made on a ConglomerateController that was opened for locking only.
RESOLVE (mikem) - move this call to ConglomerateManager so it is obvious that non-access clients should not call this.
- Specified by:
lockRowin interfaceConglomerateController- Parameters:
page_num- Page number of row to lock.record_id- Record id of row on page_num to lock.lock_operation- Desc of what to lock for, ie. update, insert ...wait- Should the lock call wait to be granted?lock_duration- If set to TransactionManager.LOCK_INSTANT_DURATION, then lock will be released immediately after being granted.- Returns:
- true if lock was granted, only can be false if wait was false.
- Throws:
StandardException- Standard exception policy.
-
newRowLocationTemplate
Description copied from interface:ConglomerateControllerReturn a row location object of the correct type to be used in calls to insertAndFetchLocation.- Specified by:
newRowLocationTemplatein interfaceConglomerateController- Overrides:
newRowLocationTemplatein classGenericController- Throws:
StandardException- Standard exception policy.
-
getOpenConglomerate
Public Methods of XXXX class:
-