Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.store.access
Interface ConglomerateController  view ConglomerateController download ConglomerateController.java

All Superinterfaces:
ConglomPropertyQueryable

public interface ConglomerateController
extends ConglomPropertyQueryable

A conglomerate is an abstract storage structure (they correspond to access methods). The ConglomerateController interface is the interface that access manager clients can use to manipulate the contents of the underlying conglomerate.

Each conglomerate holds a set of rows. Each row has a row location. The conglomerate provides methods for:

Conglomerates do not provide any mechanism for associative access to rows within the conglomerate; this type of access is provided by scans via the ScanController interface.

Although all conglomerates have the same interface, they have different implementations. The implementation of a conglomerate determines some of its user-visible semantics; for example whether the rows are ordered or what the types of the rows' columns must be. The implementation is specified by an implementation id. Currently there are two implementations, "heap", and "btree". The details of their behavior are specified in their implementation documentation. (Currently, only "heap" is implemented).

All conglomerate operations are subject to the transactional isolation of the transaction they were opened from. Transaction rollback will close all conglomerates. Transaction commit will close all non-held conglomerates.

Scans are opened from a TransactionController.

A ConglomerateController can handle partial rows. Partial rows are described in RowUtil.


Field Summary
static int LOCK_INS
           
static int LOCK_INS_PREVKEY
           
static int LOCK_READ
           
static int LOCK_UPD
           
static int LOCK_UPDATE_LOCKS
           
static int ROWISDUPLICATE
           
 
Method Summary
 void checkConsistency()
          Check consistency of a conglomerate.
 void close()
          Close the conglomerate controller.
 boolean closeForEndTransaction(boolean closeHeldScan)
          Close conglomerate controller as part of terminating a transaction.
 void debugConglomerate()
          Dump debugging output to error log.
 boolean delete(org.apache.derby.iapi.types.RowLocation loc)
          Delete a row from the conglomerate.
 boolean fetch(org.apache.derby.iapi.types.RowLocation loc, org.apache.derby.iapi.types.DataValueDescriptor[] destRow, org.apache.derby.iapi.services.io.FormatableBitSet validColumns)
          Fetch the (partial) row at the given location.
 boolean fetch(org.apache.derby.iapi.types.RowLocation loc, org.apache.derby.iapi.types.DataValueDescriptor[] destRow, org.apache.derby.iapi.services.io.FormatableBitSet validColumns, boolean waitForLock)
          Fetch the (partial) row at the given location.
 SpaceInfo getSpaceInfo()
          Get information about space used by the conglomerate.
 int insert(org.apache.derby.iapi.types.DataValueDescriptor[] row)
          Insert a row into the conglomerate.
 void insertAndFetchLocation(org.apache.derby.iapi.types.DataValueDescriptor[] row, org.apache.derby.iapi.types.RowLocation destRowLocation)
          insert row and fetch it's row location in one operation.
 boolean isKeyed()
          Return whether this is a keyed conglomerate.
 boolean lockRow(long page_num, int record_id, int lock_oper, boolean wait, int lock_duration)
          Lock the given record id/page num pair.
 boolean lockRow(org.apache.derby.iapi.types.RowLocation loc, int lock_oper, boolean wait, int lock_duration)
          Lock the given row location.
 org.apache.derby.iapi.types.RowLocation newRowLocationTemplate()
          Return a row location object of the correct type to be used in calls to insertAndFetchLocation.
 boolean replace(org.apache.derby.iapi.types.RowLocation loc, org.apache.derby.iapi.types.DataValueDescriptor[] row, org.apache.derby.iapi.services.io.FormatableBitSet validColumns)
          Replace the (partial) row at the given location.
 void unlockRowAfterRead(org.apache.derby.iapi.types.RowLocation loc, boolean forUpdate, boolean row_qualified)
          UnLock the given row location.
 
Methods inherited from interface org.apache.derby.iapi.store.access.ConglomPropertyQueryable
getInternalTablePropertySet, getTableProperties
 

Field Detail

ROWISDUPLICATE

public static final int ROWISDUPLICATE
See Also:
Constant Field Values

LOCK_READ

public static final int LOCK_READ
See Also:
Constant Field Values

LOCK_UPD

public static final int LOCK_UPD
See Also:
Constant Field Values

LOCK_INS

public static final int LOCK_INS
See Also:
Constant Field Values

LOCK_INS_PREVKEY

public static final int LOCK_INS_PREVKEY
See Also:
Constant Field Values

LOCK_UPDATE_LOCKS

public static final int LOCK_UPDATE_LOCKS
See Also:
Constant Field Values
Method Detail

close

public void close()
           throws org.apache.derby.iapi.error.StandardException
Close 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;
 


closeForEndTransaction

public boolean closeForEndTransaction(boolean closeHeldScan)
                               throws org.apache.derby.iapi.error.StandardException
Close 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.


checkConsistency

public void checkConsistency()
                      throws org.apache.derby.iapi.error.StandardException
Check consistency of a conglomerate. Checks the consistency of the data within a given conglomerate, does not check consistency external to the conglomerate (ie. does not check that base table row pointed at by a secondary index actually exists). Raises a StandardException on first consistency problem.


delete

public boolean delete(org.apache.derby.iapi.types.RowLocation loc)
               throws org.apache.derby.iapi.error.StandardException
Delete a row from the conglomerate.


fetch

public boolean fetch(org.apache.derby.iapi.types.RowLocation loc,
                     org.apache.derby.iapi.types.DataValueDescriptor[] destRow,
                     org.apache.derby.iapi.services.io.FormatableBitSet validColumns)
              throws org.apache.derby.iapi.error.StandardException
Fetch the (partial) row at the given location.


fetch

public boolean fetch(org.apache.derby.iapi.types.RowLocation loc,
                     org.apache.derby.iapi.types.DataValueDescriptor[] destRow,
                     org.apache.derby.iapi.services.io.FormatableBitSet validColumns,
                     boolean waitForLock)
              throws org.apache.derby.iapi.error.StandardException
Fetch the (partial) row at the given location.


insert

public int insert(org.apache.derby.iapi.types.DataValueDescriptor[] row)
           throws org.apache.derby.iapi.error.StandardException
Insert a row into the conglomerate.


insertAndFetchLocation

public void insertAndFetchLocation(org.apache.derby.iapi.types.DataValueDescriptor[] row,
                                   org.apache.derby.iapi.types.RowLocation destRowLocation)
                            throws org.apache.derby.iapi.error.StandardException
insert 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()).


isKeyed

public boolean isKeyed()
Return whether this is a keyed conglomerate.


lockRow

public boolean lockRow(org.apache.derby.iapi.types.RowLocation loc,
                       int lock_oper,
                       boolean wait,
                       int lock_duration)
                throws org.apache.derby.iapi.error.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.


lockRow

public boolean lockRow(long page_num,
                       int record_id,
                       int lock_oper,
                       boolean wait,
                       int lock_duration)
                throws org.apache.derby.iapi.error.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.


unlockRowAfterRead

public void unlockRowAfterRead(org.apache.derby.iapi.types.RowLocation loc,
                               boolean forUpdate,
                               boolean row_qualified)
                        throws org.apache.derby.iapi.error.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.


newRowLocationTemplate

public org.apache.derby.iapi.types.RowLocation newRowLocationTemplate()
                                                               throws org.apache.derby.iapi.error.StandardException
Return a row location object of the correct type to be used in calls to insertAndFetchLocation.


replace

public boolean replace(org.apache.derby.iapi.types.RowLocation loc,
                       org.apache.derby.iapi.types.DataValueDescriptor[] row,
                       org.apache.derby.iapi.services.io.FormatableBitSet validColumns)
                throws org.apache.derby.iapi.error.StandardException
Replace the (partial) row at the given location.


getSpaceInfo

public SpaceInfo getSpaceInfo()
                       throws org.apache.derby.iapi.error.StandardException
Get information about space used by the conglomerate.


debugConglomerate

public void debugConglomerate()
                       throws org.apache.derby.iapi.error.StandardException
Dump debugging output to error log.

Dump information about the conglomerate to error log. This is only for debugging purposes, does nothing in a delivered system, currently.