|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.collections.DataView
final class DataView
Represents a Berkeley DB database and adds support for indices, bindings and key ranges.
This class defines a view and takes care of reading and updating indices, calling bindings, constraining access to a key range, etc.
Field Summary | |
---|---|
(package private) boolean |
btreeRecNumAccess
|
(package private) boolean |
btreeRecNumDb
|
(package private) CurrentTransaction |
currentTxn
|
(package private) CursorConfig |
cursorConfig
|
(package private) Database |
db
|
(package private) boolean |
dupsAllowed
|
(package private) boolean |
dupsOrdered
|
(package private) EntityBinding |
entityBinding
|
(package private) PrimaryKeyAssigner |
keyAssigner
|
(package private) EntryBinding |
keyBinding
|
(package private) boolean |
keysRenumbered
|
(package private) boolean |
ordered
|
(package private) KeyRange |
range
|
(package private) boolean |
readUncommittedAllowed
|
(package private) boolean |
recNumAccess
|
(package private) boolean |
recNumAllowed
|
(package private) boolean |
recNumRenumber
|
(package private) SecondaryDatabase |
secDb
|
(package private) SecondaryKeyCreator |
secKeyCreator
|
(package private) boolean |
transactional
|
(package private) EntryBinding |
valueBinding
|
(package private) boolean |
writeAllowed
|
Constructor Summary | |
---|---|
DataView(Database database,
EntryBinding keyBinding,
EntryBinding valueBinding,
EntityBinding entityBinding,
boolean writeAllowed,
PrimaryKeyAssigner keyAssigner)
Creates a view for a given database and bindings. |
Method Summary | |
---|---|
(package private) OperationStatus |
append(Object value,
Object[] retPrimaryKey,
Object[] retValue)
Appends a value and returns the new key. |
(package private) boolean |
canDeriveKeyFromValue()
Returns whether data keys can be derived from the value/entity binding of this view, which determines whether a value/entity object alone is sufficient for operations that require keys. |
(package private) void |
clear()
Deletes all records in the current range. |
(package private) DataView |
configuredView(CursorConfig config)
Returns a new view with a specified cursor configuration. |
(package private) CurrentTransaction |
getCurrentTxn()
Returns the current transaction for the view or null if the environment is non-transactional. |
(package private) Environment |
getEnv()
Returns the environment for the database. |
(package private) DatabaseEntry |
getSingleKeyThang()
Returns the key thang for a single key range, or null if a single key range is not used. |
(package private) boolean |
isEmpty()
Returns whether no records are present in the view. |
(package private) boolean |
isSecondary()
Returns whether this is a view on a secondary database rather than directly on a primary database. |
(package private) DataCursor |
join(DataCursor[] indexCursors,
JoinConfig joinConfig)
Returns a cursor for this view that reads only records having the index key values at the specified cursors. |
(package private) DataCursor |
join(DataView[] indexViews,
Object[] indexKeys,
JoinConfig joinConfig)
Returns a cursor for this view that reads only records having the specified index key values. |
(package private) DataView |
keySetView()
Return a new key-set view derived from this view by setting the entity and value binding to null. |
(package private) Object |
makeKey(DatabaseEntry keyThang)
Converts a key entry to a key object. |
(package private) Object |
makeValue(DatabaseEntry primaryKeyThang,
DatabaseEntry valueThang)
Converts a key-value entry pair to a value object. |
(package private) KeyRange |
subRange(Object singleKey)
Intersects the given key and the current range. |
(package private) KeyRange |
subRange(Object beginKey,
boolean beginInclusive,
Object endKey,
boolean endInclusive)
Intersects the given range and the current range. |
(package private) DataView |
subView(Object beginKey,
boolean beginInclusive,
Object endKey,
boolean endInclusive,
EntryBinding keyBinding)
Return a new value-set view for key range, optionally changing the key binding. |
(package private) boolean |
useKey(Object key,
Object value,
DatabaseEntry keyThang,
KeyRange checkRange)
Populates the key entry and returns whether the key is within range. |
(package private) Transaction |
useTransaction()
Returns the current transaction if the database is transaction, or null if the database is not transactional or there is no current transaction. |
(package private) void |
useValue(Object value,
DatabaseEntry valueThang,
DatabaseEntry checkKeyThang)
Populates the value entry and throws an exception if the primary key would be changed via an entity binding. |
(package private) DataView |
valueSetView()
Return a new value-set view derived from this view by setting the key binding to null. |
(package private) DataView |
valueSetView(Object singleKey)
Return a new value-set view for single key range. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
Database db
SecondaryDatabase secDb
CurrentTransaction currentTxn
KeyRange range
EntryBinding keyBinding
EntryBinding valueBinding
EntityBinding entityBinding
PrimaryKeyAssigner keyAssigner
SecondaryKeyCreator secKeyCreator
CursorConfig cursorConfig
boolean writeAllowed
boolean ordered
boolean recNumAllowed
boolean recNumAccess
boolean btreeRecNumDb
boolean btreeRecNumAccess
boolean recNumRenumber
boolean keysRenumbered
boolean dupsAllowed
boolean dupsOrdered
boolean transactional
boolean readUncommittedAllowed
Constructor Detail |
---|
DataView(Database database, EntryBinding keyBinding, EntryBinding valueBinding, EntityBinding entityBinding, boolean writeAllowed, PrimaryKeyAssigner keyAssigner) throws IllegalArgumentException
IllegalArgumentException
Method Detail |
---|
DataView keySetView()
DataView valueSetView()
DataView valueSetView(Object singleKey) throws DatabaseException, KeyRangeException
singleKey
- the single key value.
DatabaseException
- if a database problem occurs.
KeyRangeException
- if the specified range is not within the
current range.DataView subView(Object beginKey, boolean beginInclusive, Object endKey, boolean endInclusive, EntryBinding keyBinding) throws DatabaseException, KeyRangeException
DatabaseException
KeyRangeException
DataView configuredView(CursorConfig config)
CurrentTransaction getCurrentTxn()
DatabaseEntry getSingleKeyThang()
final Environment getEnv()
final boolean isSecondary()
boolean isEmpty() throws DatabaseException
DatabaseException
OperationStatus append(Object value, Object[] retPrimaryKey, Object[] retValue) throws DatabaseException
DatabaseException
Transaction useTransaction()
void clear() throws DatabaseException
DatabaseException
DataCursor join(DataView[] indexViews, Object[] indexKeys, JoinConfig joinConfig) throws DatabaseException
DatabaseException
DataCursor join(DataCursor[] indexCursors, JoinConfig joinConfig) throws DatabaseException
DatabaseException
boolean useKey(Object key, Object value, DatabaseEntry keyThang, KeyRange checkRange) throws DatabaseException
DatabaseException
final boolean canDeriveKeyFromValue()
void useValue(Object value, DatabaseEntry valueThang, DatabaseEntry checkKeyThang) throws DatabaseException
DatabaseException
Object makeKey(DatabaseEntry keyThang) throws DatabaseException
DatabaseException
Object makeValue(DatabaseEntry primaryKeyThang, DatabaseEntry valueThang) throws DatabaseException
DatabaseException
KeyRange subRange(Object singleKey) throws DatabaseException, KeyRangeException
DatabaseException
KeyRangeException
KeyRange subRange(Object beginKey, boolean beginInclusive, Object endKey, boolean endInclusive) throws DatabaseException, KeyRangeException
DatabaseException
KeyRangeException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |