This appendix contains a listing of the APIs relevant to JE. A brief description of each class and method is provided. If the API is described in this manual, a cross reference to that material is also provided.
The com.sleepycat.je classes are:
The com.sleepycat.bind classes are:
The following classes, interfaces, and methods are available in the com.sleepycat.je package:
Specifies the attributes of an application invoked checkpoint operation.
Method | Description |
---|---|
getForce |
Return the configuration of the checkpoint force option. |
getKBytes |
Return the checkpoint log data threshold, in kilobytes. |
getMinutes |
Return the checkpoint time threshold, in minutes. |
setForce |
Configure the checkpoint force option. |
setKBytes |
Configure the checkpoint log data threshold, in kilobytes. |
setMinutes |
Configure the checkpoint time threshold, in minutes. |
A database cursor. Used for iterating over database records.
For more information, see Searching for Records.
Method | Description |
---|---|
close |
Discard the cursor. For more information, see Opening and Closing Cursors. |
count |
Return a count of the number of data items for the key to which the cursor refers. For more information, see Working with Duplicate Records. |
delete |
Delete the key/data pair to which the cursor refers. For more information, see Deleting Records Using Cursors. |
dup |
Return a new cursor for the same transaction as the original cursor. |
getConfig |
Return this object's configuration. |
getCurrent |
Returns the key/data pair to which the cursor refers. For more information, see Deleting Records Using Cursors. |
getDatabase |
Return the Database handle associated with this Cursor. |
getFirst |
Moves the cursor to the first key/data pair of the database, and returns that pair. |
getLast |
Moves the cursor to the last key/data pair of the database, and returns that pair. |
getNext |
Moves the cursor to the next key/data pair and returns that pair. For more information, see Getting Records Using the Cursor and Working with Duplicate Records. |
getNextDup |
If the next key/data pair of the database is a duplicate data record for the current key/data pair, moves the cursor to the next key/data pair of the database and returns that pair. For more information, see Working with Duplicate Records. |
getNextNoDup |
Moves the cursor to the next non-duplicate key/data pair and returns that pair. For more information, see Working with Duplicate Records. |
getPrev |
Moves the cursor to the previous key/data pair and returns that pair. For more information, see Getting Records Using the Cursor and Working with Duplicate Records. |
getPrevDup |
If the previous key/data pair of the database is a duplicate data record for the current key/data pair, moves the cursor to the previous key/data pair of the database and returns that pair. For more information, see Working with Duplicate Records. |
getPrevNoDup |
Moves the cursor to the previous non-duplicate key/data pair and returns that pair. For more information, see Working with Duplicate Records. |
getSearchBoth |
Moves the cursor to the specified key/data pair. For more information, see Searching for Records. |
getSearchBothRange |
Moves the cursor to the specified key and closest matching record data item. For more information, see Searching for Records and Working with Duplicate Records. |
getSearchKey |
Moves the cursor to the given key of the database, and returns the datum associated with the given key. For more information, see Searching for Records. |
getSearchKeyRange |
Moves the cursor to the closest matching key of the database, and returns the datum associated with the matching key. For more information, see Searching for Records. |
putCurrent |
Store a key/data pair into the database. For more information, see Replacing Records Using Cursors. |
putKeyFirst |
Store a key/data pair into the database. For more information, see Putting Records Using Cursors. |
putKeyLast |
Store a key/data pair into the database. For more information, see Putting Records Using Cursors. |
putNoDupData |
Store a key/data pair into the database. For more information, see Putting Records Using Cursors. |
Specifies a cursor's configuration parameters.
For more information, see Opening and Closing Cursors.
Method | Description |
---|---|
getDirtyRead |
Returns the setting for the dirtyRead attribute. |
setDirtyRead |
If set to true, all read operations performed by the cursor may return modified but not yet committed data. For more information, see Configuring Dirty Reads. |
A database handle. Used to get and put database records.
For more information, see Databases, Opening Databases and Getting Records from the Database.
Method | Description |
---|---|
close |
Flush any cached database information to disk and discard the database handle. For more information, see Opening Databases. |
delete |
Remove key/data pairs from the database. For more information, see Deleting Records. |
get |
Retrieves the key/data pair with the given key. For more information, see Getting Records from the Database. |
getConfig |
Return this object's configuration. For more information, see Database Properties. |
getDatabaseName |
Return the database name. For more information, see Administrative Methods. |
getEnvironment |
Return the Environment object used to create this Database. For more information, see Administrative Methods. |
getSearchBoth |
Retrieves the key/data pair with the given key and data value. For more information, see Getting Records from the Database. |
getSecondaryDatabases |
Returns a list of all the secondary databases associated with the database. |
getStats |
Return database statistics. |
isTransactional |
Return true if the database was opened transactionally. |
join |
Creates a specialized join cursor for use in performing equality or natural joins on secondary indices. For more information, see Using Join Cursors. |
openCursor |
Return a cursor into the database. For more information, see Opening and Closing Cursors. |
preload |
Preload the cache. For more information, see Administrative Methods. |
put |
Store key/data pairs into the database. For more information, see Writing Records to the Database. |
putNoDupData |
Store key/data pairs into the database. For more information, see Writing Records to the Database. |
putNoOverwrite |
Store key/data pairs into the database. For more information, see Writing Records to the Database. |
truncate |
Empty the database, discarding all records it contains. For more information, see Administrative Methods and Deleting Records. |
verify |
Verify the integrity of the database. |
Specifies a database's configuration parameters.
For more information, see Database Properties and Database Management with MyDbEnv.
Method | Description |
---|---|
getAllowCreate |
Return true if the allowCreate mode is set. |
getSortedDuplicates |
Return true if the database supports sorted duplicate data items. |
getBtreeComparator |
Returns the Comparator used for key comparison on this database. |
getDuplicateComparator |
Returns the Comparator used for duplicate data item comparison on this database. |
getExclusiveCreate |
Return true if the exclusiveCreate mode is set. |
getOverrideBtreeComparator |
Returns the override setting for the btree comparator. |
getOverrideDuplicateComparator |
Returns the override setting for the duplicate comparator. |
getReadOnly |
Return true if the database is in read-only mode. |
getTransactional |
Return if the database supports transactions. |
setAllowCreate |
Cause the open method to create the database if it does not already exist. For more information, see Database Properties. |
setSortedDuplicates |
Configure the database to support sorted duplicate data items. For more information, see Database Properties. |
setBtreeComparator |
Configure the Comparator used for key comparison on this database. For more information, see Database Properties and Setting Comparators. |
setDuplicateComparator |
Configure the Comparator used for duplicate data item comparison on this database. For more information, see Database Properties and Setting Comparators. |
setExclusiveCreate |
Cause the open method to return an error if the database already exists and create the database if it does not already exist. For more information, see Database Properties. |
setOverrideBtreeComparator |
Set to true if the database exists and the btree comparator specified in this configuration object should override the current comparator. For more information, see Setting Comparators. |
setOverrideDuplicateComparator |
Set to true if the database exists and the duplicate comparator specified in this configuration object should override the current comparator. For more information, see Setting Comparators. |
setReadOnly |
Configure the database in read-only mode. For more information, see Database Properties. |
setTransactional |
Configure the database to support transactions. For more information, see Database Properties and Enabling and Starting Transactions. |
Encapsulates the byte array for a record's key or data.
For more information, see Database Records and Using Database Records.
Method | Description |
---|---|
equals |
Returns whether the given object is a DatabaseEntry and has the same value as this entry. |
getData |
Return the byte array. |
getOffset |
Return the byte offset into the data array. |
getPartial |
Return if this DatabaseEntry is configured to read or write partial records. |
getPartialLength |
Return the byte length of the partial record being read or written by the application, in bytes. |
getPartialOffset |
Return the offset of the partial record being read or written by the application, in bytes. |
getSize |
Return the byte size of the data array. |
setData |
Set the data array. |
setOffset |
Set the byte offset into the data array. |
setPartial |
Configure this DatabaseEntry to read or write partial records. |
setPartialLength |
Set the byte length of the partial record being read or written by the application, in bytes. |
setPartialOffset |
Set the offset of the partial record being read or written by the application, in bytes. |
setSize |
Set the byte size of the data array. |
toString |
Return all the attributes of the database entry in text form. |
The root of all database exceptions.
For more information, see JE Exceptions.
Thrown when an operation requires a database and that database does not exist.
For more information, see JE Exceptions.
Statistics for a single database.
Method | Description |
---|---|
getBinCount |
Return the number of leaf nodes in the database tree. |
getDeletedLNCount |
Return the number of key/data pairs in the database tree marked for deletion. |
getDupCountLNCount |
Return the number of duplicate key/data pairs in the database tree. |
getInCount |
Return the number of internal nodes in the database tree. |
getLnCount |
Return the number of key/data pairs in the database tree. |
getMaxDepth |
Return the maximum depth of the database tree. |
Thrown when a transaction is selected to resolve a deadlock.
For more information, see JE Exceptions, Aborting Transactions and Transactions and Deadlocks.
An environment handle. Used to encapsulate one or more databases.
For more information, see Opening Database Environments and Administrative Methods.
Method | Description |
---|---|
beginTransaction |
Create a new transaction in the database environment. For more information, see Enabling and Starting Transactions. |
checkpoint |
Synchronously checkpoint the database environment. |
cleanLog |
Synchronously invoke database environment log cleaning. |
close |
The Environment.close method closes the Berkeley DB environment. For more information, see Opening Database Environments. |
compress |
Synchronously invoke the compressor mechanism which compacts in memory data structures after delete operations. |
evictMemory |
Synchronously invoke the mechanism for keeping memory usage within the cache size boundaries. |
getConfig |
Return this object's configuration. For more information, see The EnvironmentConfig Class. |
getDatabaseNames |
Return a List of database names for the database environment. For more information, see Administrative Methods. |
getHome |
Return the database environment's home directory. |
getLockStats |
Return database environment locking statistics. |
getMutableConfig |
Return environment properties that can be modified after the Environment object has been constructed. For more information, see EnvironmentMutableConfig. |
getStats |
Return general database environment statistics. For more information, see Environment Statistics. |
getTransactionStats |
Return database environment transactional statistics. |
openDatabase |
Open, and optionally create, a Database. For more information, see Opening Databases. |
removeDatabase |
Remove a database. For more information, see Administrative Methods. |
renameDatabase |
Rename a database. For more information, see Administrative Methods. |
setMutableConfig |
Sets environment properties that can be modified after the Environment object has been constructed. |
sync |
Synchronously flush database environment databases to stable storage. For more information, see Data Persistence, Syncs and Performing a Complete Backup. |
verify |
Verify that the database environment is consistent and correct. |
Specifies configuration parameters that are global to an entire environment.
For more information, see The EnvironmentConfig Class.
Method | Description |
---|---|
getAllowCreate |
Return true if we may create this environment. |
getCacheSize |
Return the memory available to the database system, in bytes. |
getConfigParam |
Return the value for this configuration parameter. |
getLockTimeout |
Return the lock timeout setting, in microseconds. |
getReadOnly |
Return if the database environment is configured to be read only. |
getTransactional |
Return if the database environment supports transactions. |
getTxnTimeout |
Return the transaction timeout, in microseconds. |
setAllowCreate |
If true, the database environment is created if it doesn't already exist. For more information, see The EnvironmentConfig Class. |
setCacheSize |
Configure the memory available to the database system, in bytes. For more information, see The EnvironmentConfig Class. |
setConfigParam |
Validate the value prescribed for the configuration parameter; if it is valid, the value is set in the configuration. |
setLockTimeout |
Configure the lock timeout, in microseconds. |
setReadOnly |
Configure the database environment to be read only, and any attempt to modify a database will fail. For more information, see The EnvironmentConfig Class. |
setTransactional |
Configure the database environment to support transactions. For more information, see The EnvironmentConfig Class and Enabling and Starting Transactions. |
setTxnTimeout |
Configure the transaction timeout, in microseconds. |
Specifies an environment handle's configuration parameters.
For more information, see EnvironmentMutableConfig.
Method | Description |
---|---|
getTxnNoSync |
Return if the database environment is configured for asynchronous transactions. |
setTxnNoSync |
Configure the database environment for asynchronous transactions. For more information, see Committing and Aborting Transactions. |
Statistics for the environment.
For more information, see Environment Statistics.
Method | Description |
---|---|
getCursorsBins |
The number of bins encountered by the INCompressor that had cursors referring to them when the compressor ran. |
getDbClosedBins |
The number of bins encountered by the INCompressor that had their database closed between the time they were put on the compressor queue and when the compressor ran. |
getInCompQueueSize |
The number of entries in the INCompressor queue when the getStats() call was made. |
getLastCheckpointId |
The Id of the last checkpoint. |
getNCacheMiss |
The total number of requests for database objects which were not in memory. For more information, see Environment Statistics and Sizing the Cache. |
getNCheckpoints |
The total number of checkpoints run so far. |
getNCleanerRuns |
The number of cleaner runs this session. |
getNDeltaINFlush |
The accumulated number of Delta INs flushed to the log. |
getNDeltasCleaned |
The accumulated number of delta BINs that were cleaned. |
getNEvictPasses |
The number of passes made to the evictor. |
getNFullINFlush |
The accumulated number of full INs flushed to the log. |
getNINsCleaned |
The accumulated number of INs cleaned. |
getNINsMigrated |
The accumulated number of INs migrated. |
getNLNsCleaned |
The accumulated number of LNs cleaned. |
getNLNsDead |
The accumulated number of LNs that were not found in the tree anymore (deleted). |
getNLNsLocked |
The accumulated number of LNs encountered that were locked. |
getNLNsMigrated |
The accumulated number of LNs encountered that were migrated forward in the log. |
getNNodesExplicitlyEvicted |
The accumulated number of nodes evicted. |
getNNodesScanned |
The accumulated number of nodes scanned in order to select the eviction set. |
getNNodesSelected |
The accumulated number of nodes selected to evict. |
getNNotResident |
The number of requests for database objects not contained within the in memory data structures. |
getNonEmptyBins |
The number of bins encountered by the INCompressor that were not actually empty when the compressor ran. |
getProcessedBins |
The number of bins that were successfully processed by the IN Compressor. |
getSplitBins |
The number of bins encountered by the INCompressor that were split between the time they were put on the compressor queue and when the compressor ran. |
toString |
Returns a String representation of the stats in the form of <stat>=<value>. |
Specifies the action taken when a referenced record in the foreign key database is deleted.
The interface implemented for setting foreign key references to null.
Method | Description |
---|---|
nullifyForeignKey |
Sets the foreign key reference to null in the datum of the primary database. |
Returns the Berkeley DB, Java Edition version number.
Method | Description |
---|---|
getMajor |
Major number of the release version. |
getMinor |
Minor number of the release version. |
getPatch |
Patch number of the release version. |
getVersionString |
Release version, suitable for display. |
Specifies a join cursor's configuration parameters.
For more information, see JoinCursor Properties.
Method | Description |
---|---|
getNoSort |
Returns whether automatic sorting of the input cursors is disabled. |
setNoSort |
Specifies whether automatic sorting of the input cursors is disabled. |
A specialized cursor used to perform equality or natural joins on secondary indices.
Method | Description |
---|---|
close |
Closes the cursors that have been opened by this join cursor. |
getConfig |
Returns this object's configuration. |
getDatabase |
Returns the primary database handle associated with this cursor. |
getNext |
Returns the next primary record resulting from the join operation. For more information, see Using Join Cursors. |
Identifies the lock mode used for database read operations.
Method | Description |
---|---|
toString |
Provide a string representation of the enumeration. |
Locking statistics for the environment.
Method | Description |
---|---|
getNOwners |
Total lock owners in lock table. |
getNReadLocks |
Total read locks currently held. |
getNTotalLocks |
Total locks currently in lock table. |
getNWaiters |
Total transactions waiting for locks. |
getNWriteLocks |
Total write locks currently held. |
Thrown when the database environment needs to be recovered.
For more information, see JE Exceptions.
Specifies a database's secondary configuration parameters.
For more information, see Opening and Closing Secondary Databases and Secondary Database Properties.
Method | Description |
---|---|
getAllowPopulate |
Returns whether automatic population of the secondary is allowed. |
getForeignKeyDatabase |
Returns the database used to check the foreign key integrity constraint, or null if no foreign key constraint will be checked. |
getForeignKeyDeleteAction |
Returns the action taken when a referenced record in the foreign key database is deleted. |
getForeignKeyNullifier |
Returns the user-supplied object used for setting foreign keys to null. |
getKeyCreator |
Returns the user-supplied object used for creating secondary keys. |
setAllowPopulate |
Specifies whether automatic population of the secondary is allowed. For more information, see Secondary Database Properties. |
setForeignKeyDatabase |
Defines a foreign key integrity constraint for a given foreign key database. |
setForeignKeyDeleteAction |
Specifies the action taken when a referenced record in the foreign key database is deleted. |
setForeignKeyNullifier |
Specifies the user-supplied object used for setting foreign keys to null. |
setKeyCreator |
Specifies the user-supplied object used for creating secondary keys. For more information, see Implementing Key Creators and Secondary Database Properties. |
A specialized cursor used to iterate over secondary database records.
For more information, see Reading Secondary Databases and Deleting Secondary Database Entries.
Method | Description |
---|---|
delete |
Delete the key/data pair to which the cursor refers from the primary database and all secondary indices. |
dup |
Returns a new SecondaryCursor for the same transaction as the original cursor. |
dupSecondary |
Returns a new copy of the cursor as a SecondaryCursor. |
getCurrent |
Returns the key/data pair to which the cursor refers. |
getFirst |
Moves the cursor to the first key/data pair of the database, and returns that pair. |
getLast |
Moves the cursor to the last key/data pair of the database, and returns that pair. |
getNext |
Moves the cursor to the next key/data pair and returns that pair. |
getNextDup |
If the next key/data pair of the database is a duplicate data record for the current key/data pair, moves the cursor to the next key/data pair of the database and returns that pair. |
getNextNoDup |
Moves the cursor to the next non-duplicate key/data pair and returns that pair. |
getPrev |
Moves the cursor to the previous key/data pair and returns that pair. |
getPrevDup |
If the previous key/data pair of the database is a duplicate data record for the current key/data pair, moves the cursor to the previous key/data pair of the database and returns that pair. |
getPrevNoDup |
Moves the cursor to the previous non-duplicate key/data pair and returns that pair. |
getPrimaryDatabase |
Returns the primary Database associated with this cursor. |
getSearchBoth |
Moves the cursor to the specified secondary key. For more information, see Using Secondary Cursors . |
getSearchBothRange |
Moves the cursor to the specified secondary key and closest matching primary database key. |
getSearchKey |
Moves the cursor to the given key of the database, and returns the datum associated with the given key. |
getSearchKeyRange |
Moves the cursor to the closest matching key of the database, and returns the datum associated with the matching key. |
A secondary database handle.
For more information, see Secondary Databases and Deleting Secondary Database Entries.
Method | Description |
---|---|
close |
Closes a secondary database and disassociates it from its primary database. |
delete |
Deletes the key/data pair from the associated primary database and all secondary indices. For more information, see Deleting Secondary Database Entries. |
get |
Retrieves the key/data pair with the given key. For more information, see Reading Secondary Databases. |
getPrimaryDatabase |
Returns the primary database associated with this secondary database. |
getSearchBoth |
Retrieves the key/data pair with the specified secondary and primary key. |
getSecondaryConfig |
Returns a copy of the secondary configuration of this database. |
openSecondaryCursor |
Obtain a cursor on a database, returning a SecondaryCursor. |
The interface implemented for creating secondary database keys.
For more information, see Implementing Key Creators.
Method | Description |
---|---|
createSecondaryKey |
Creates a secondary key entry, given a primary key and data entry. For more information, see Secondary Databases and Implementing Key Creators. |
Specifies the configuration parameters for a statistics retrieval operation.
Method | Description |
---|---|
getClear |
Return if the statistics operation are configured to reset all statistics after they are returned. |
getFast |
Return if the statistics operation is configured to return only the values which do not require traversal of the database or in-memory tree. |
setClear |
Configure the statistics operation to reset all statistics after they are returned. |
setFast |
Configure the statistics operation to return the most recently returned DatabaseStats object. |
An environment transaction.
Method | Description |
---|---|
abort |
Cause an abnormal termination of the transaction. For more information, see Aborting Transactions. |
commit |
End the transaction, synchronously committing if the database environment is configured for synchronous commit. For more information, see Enabling and Starting Transactions and Committing and Aborting Transactions. |
commitNoSync |
End the transaction, not committing synchronously. For more information, see Committing and Aborting Transactions. |
commitSync |
End the transaction, committing synchronously. For more information, see Committing and Aborting Transactions. |
getName |
Get the user visible name for the transaction. |
setLockTimeout |
Configure the lock request timeout value for the transaction. |
setName |
Set the user visible name for the transaction. |
setTxnTimeout |
Configure the timeout value for the transaction. |
Specifies the configuration parameters for an individual transaction.
Method | Description |
---|---|
getDirtyRead |
Return if the transaction is configured to perform dirty reads. |
getNoSync |
Indicates whether the transaction is configured to not synchronously flush the log it when commits. |
getNoWait |
Return if the transaction is configured to not wait if a lock request cannot be immediately granted. |
getSync |
Indicates whether the transaction is configured to synchronously flush the log it when commits. |
setDirtyRead |
Configure the transaction to perform dirty reads. For more information, see Configuring Dirty Reads. |
setNoSync |
Configure the transaction to not synchronously flush the log it when commits. |
setNoWait |
Configure the transaction to not wait if a lock request cannot be immediately granted. |
setSync |
Configure the transaction to synchronously flush the log it when commits. |
Transaction statistics for a single environment.
Method | Description |
---|---|
getActiveTxns |
The array of active transactions. |
getLastCheckpointTime |
The time the last completed checkpoint finished (as the number of seconds since the Epoch, returned by the IEEE/ANSI Std 1003.1 (POSIX) time interface). |
getLastTxnId |
The last transaction ID allocated. |
getNAborts |
The number of transactions that have aborted. |
getNActive |
The number of transactions that are currently active. |
getNBegins |
The number of transactions that have begun. |
getNCommits |
The number of transactions that have committed. |
Specifies the attributes of a verification operation.
Method | Description |
---|---|
getAggressive |
Return if Environment.verify() and Database.verify() are configured to perform fine granularity consistency checking that includes verifying in memory constructs. |
getPrintInfo |
Return if the Environment.verify() and Database.verify() methods are configured to print basic verification information to System.out. |
getPropagateExceptions |
Return if Environment.verify() and Database.verify() are configured to propagate exceptions found during verification. |
setAggressive |
Configure Environment.verify() and Database.verify() to perform fine granularity consistency checking that includes verifying in memory constructs. |
setPrintInfo |
Configure the Environment.verify() and Database.verify() methods to print basic verification information to System.out. |
setPropagateExceptions |
Configure Environment.verify() and Database.verify() to propagate exceptions found during verification. |