Class GenericConglomerateController
- java.lang.Object
-
- org.apache.derby.impl.store.access.conglomerate.GenericConglomerateController
-
- All Implemented Interfaces:
- ConglomerateController, ConglomPropertyQueryable
- Direct Known Subclasses:
- HeapController
public abstract class GenericConglomerateController extends java.lang.Object implements ConglomerateController
-
-
Field Summary
-
Fields inherited from interface org.apache.derby.iapi.store.access.ConglomerateController
LOCK_INS, LOCK_INS_PREVKEY, LOCK_READ, LOCK_UPD, LOCK_UPDATE_LOCKS, ROWISDUPLICATE
-
-
Constructor Summary
Constructors Constructor and Description GenericConglomerateController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcheckConsistency()Public Methods implementing ConglomerateController which just delegate to OpenConglomerate:voidclose()Close the conglomerate controller.booleancloseForEndTransaction(boolean closeHeldScan)Close conglomerate controller as part of terminating a transaction.voiddebugConglomerate()booleandelete(RowLocation loc)Delete a row from the conglomerate.booleanfetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns)Fetch the (partial) row at the given location.booleanfetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns, boolean waitForLock)Fetch the (partial) row at the given location.longgetEstimatedRowCount()Get the total estimated number of rows in the container.java.util.PropertiesgetInternalTablePropertySet(java.util.Properties prop)OpenConglomerategetOpenConglom()SpaceInfogetSpaceInfo()voidgetTableProperties(java.util.Properties prop)voidinit(OpenConglomerate open_conglom)Public Methods of This class:booleanisKeyed()booleanisTableLocked()is the open btree table locked?RowLocationnewRowLocationTemplate()booleanreplace(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns)Replace the (partial) row at the given location.voidsetEstimatedRowCount(long count)Set the total estimated number of rows in the container.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.derby.iapi.store.access.ConglomerateController
checkConsistency, debugConglomerate, getSpaceInfo, insert, insertAndFetchLocation, isKeyed, lockRow, lockRow, newRowLocationTemplate, unlockRowAfterRead
-
Methods inherited from interface org.apache.derby.iapi.store.access.ConglomPropertyQueryable
getInternalTablePropertySet, getTableProperties
-
-
-
-
Method Detail
-
close
public void close() throws StandardExceptionDescription copied from interface:ConglomerateControllerClose the conglomerate controller.Close the conglomerate controller. Callers must not use the conglomerate controller after calling close. It is strongly recommended that callers clear out the reference after closing, e.g.,
ConglomerateController cc; cc.close; cc = null;
- Specified by:
closein interfaceConglomerateController- Throws:
StandardException- Standard exception policy.- See Also:
ConglomerateController.close()
-
closeForEndTransaction
public boolean closeForEndTransaction(boolean closeHeldScan) throws StandardExceptionClose conglomerate controller as part of terminating a transaction.Use this call to close the conglomerate controller resources as part of committing or aborting a transaction. The normal close() routine may do some cleanup that is either unnecessary, or not correct due to the unknown condition of the controller following a transaction ending error. Use this call when closing all controllers as part of an abort of a transaction.
RESOLVE (mikem) - move this call to ConglomerateManager so it is obvious that non-access clients should not call this.
- Specified by:
closeForEndTransactionin interfaceConglomerateController- Parameters:
closeHeldScan- If true, means to close controller even if it has been opened to be kept opened across commit. This is used to close these controllers on abort.- Returns:
- boolean indicating that the close has resulted in a real close of the controller. A held scan will return false if called by closeForEndTransaction(false), otherwise it will return true. A non-held scan will always return true.
- Throws:
StandardException- Standard exception policy.
-
delete
public boolean delete(RowLocation loc) throws StandardException
Description copied from interface:ConglomerateControllerDelete a row from the conglomerate.- Specified by:
deletein interfaceConglomerateController- Returns:
- Returns true if delete was successful, false if the record pointed at no longer represents a valid record.
- Throws:
StandardException- Standard exception policy.- See Also:
ConglomerateController.delete(org.apache.derby.iapi.types.RowLocation)
-
fetch
public boolean fetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns) throws StandardException
Description copied from interface:ConglomerateControllerFetch the (partial) row at the given location.- Specified by:
fetchin interfaceConglomerateController- Parameters:
loc- The "RowLocation" which describes the exact row to fetch from the table.row- The row to read the data into.validColumns- A description of which columns to return from row on the page into "destRow." destRow and validColumns work together to describe the row to be returned by the fetch - see RowUtil for description of how these three parameters work together to describe a fetched "row".- Returns:
- Returns true if fetch was successful, false if the record pointed at no longer represents a valid record.
- Throws:
StandardException- Standard exception policy.- See Also:
ConglomerateController.fetch(org.apache.derby.iapi.types.RowLocation, org.apache.derby.iapi.types.DataValueDescriptor[], org.apache.derby.iapi.services.io.FormatableBitSet)
-
fetch
public boolean fetch(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns, boolean waitForLock) throws StandardException
Description copied from interface:ConglomerateControllerFetch the (partial) row at the given location.- Specified by:
fetchin interfaceConglomerateController- Parameters:
loc- The "RowLocation" which describes the exact row to fetch from the table.row- The row to read the data into.validColumns- A description of which columns to return from row on the page into "destRow." destRow and validColumns work together to describe the row to be returned by the fetch - see RowUtil for description of how these three parameters work together to describe a fetched "row".waitForLock- If false, then the call will throw a lock timeout exception immediately, if the lock can not be granted without waiting. If true call will act exactly as fetch() interface with no waitForLock parameter.- Returns:
- Returns true if fetch was successful, false if the record pointed at no longer represents a valid record.
- Throws:
StandardException- Standard exception policy.- See Also:
ConglomerateController.fetch(org.apache.derby.iapi.types.RowLocation, org.apache.derby.iapi.types.DataValueDescriptor[], org.apache.derby.iapi.services.io.FormatableBitSet)
-
replace
public boolean replace(RowLocation loc, DataValueDescriptor[] row, FormatableBitSet validColumns) throws StandardException
Description copied from interface:ConglomerateControllerReplace the (partial) row at the given location.- Specified by:
replacein interfaceConglomerateController- Returns:
- true if update was successful, returns false if the update fails because the record pointed at no longer represents a valid record.
- Throws:
StandardException- Standard exception policy.- See Also:
ConglomerateController.replace(org.apache.derby.iapi.types.RowLocation, org.apache.derby.iapi.types.DataValueDescriptor[], org.apache.derby.iapi.services.io.FormatableBitSet)
-
init
public void init(OpenConglomerate open_conglom) throws StandardException
Public Methods of This class:- Throws:
StandardException
-
getOpenConglom
public OpenConglomerate getOpenConglom()
-
checkConsistency
public void checkConsistency() throws StandardExceptionPublic Methods implementing ConglomerateController which just delegate to OpenConglomerate:- Throws:
StandardException
-
debugConglomerate
public void debugConglomerate() throws StandardException- Throws:
StandardException
-
getTableProperties
public void getTableProperties(java.util.Properties prop) throws StandardException- Throws:
StandardException
-
getInternalTablePropertySet
public java.util.Properties getInternalTablePropertySet(java.util.Properties prop) throws StandardException- Throws:
StandardException
-
getSpaceInfo
public SpaceInfo getSpaceInfo() throws StandardException
- Throws:
StandardException
-
isKeyed
public boolean isKeyed()
-
newRowLocationTemplate
public RowLocation newRowLocationTemplate() throws StandardException
- Throws:
StandardException
-
isTableLocked
public boolean isTableLocked()
is the open btree table locked?
-
getEstimatedRowCount
public long getEstimatedRowCount() throws StandardExceptionGet the total estimated number of rows in the container.The number is a rough estimate and may be grossly off. In general the server will cache the row count and then occasionally write the count unlogged to a backing store. If the system happens to shutdown before the store gets a chance to update the row count it may wander from reality.
This call is currently only supported on Heap conglomerates, it will throw an exception if called on btree conglomerates.
- Returns:
- The total estimated number of rows in the conglomerate.
- Throws:
StandardException- Standard exception policy.
-
setEstimatedRowCount
public void setEstimatedRowCount(long count) throws StandardExceptionSet the total estimated number of rows in the container.Often, after a scan, the client of RawStore has a much better estimate of the number of rows in the container than what store has. For instance if we implement some sort of update statistics command, or just after a create index a complete scan will have been done of the table. In this case this interface allows the client to set the estimated row count for the container, and store will use that number for all future references.
This call is currently only supported on Heap conglomerates, it will throw an exception if called on btree conglomerates.
- Parameters:
count- the estimated number of rows in the container.- Throws:
StandardException- Standard exception policy.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG