|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.service.data.store.db.bdb.BdbDatabase
public class BdbDatabase
Provides a database implementation using Berkeley DB.
| Constructor Summary | |
|---|---|
BdbDatabase(com.sleepycat.db.Environment env,
com.sleepycat.db.Transaction txn,
String fileName,
boolean create)
Creates an instance of this class. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this database, releasing any associated resources. |
(package private) static byte[] |
convertData(byte[] bytes)
Converts a Berkeley DB DatabaseEntry data value, replacing the null that BDB uses if the data is empty with an empty array. |
boolean |
delete(DbTransaction txn,
byte[] key)
Removes the value associated with a key in this database. |
byte[] |
get(DbTransaction txn,
byte[] key,
boolean forUpdate)
Gets the value associated with a key in this database. |
void |
markForUpdate(DbTransaction txn,
byte[] key)
Locks the key and associated value for update. |
DbCursor |
openCursor(DbTransaction txn)
Returns a cursor for iterating over the contents of this database. |
void |
put(DbTransaction txn,
byte[] key,
byte[] value)
Sets the value associated with a key in this database, regardless of whether the key already has an associated value. |
boolean |
putNoOverwrite(DbTransaction txn,
byte[] key,
byte[] value)
Sets the value associated with a key in this database, but only if the key does not already have an associated value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
BdbDatabase(com.sleepycat.db.Environment env,
com.sleepycat.db.Transaction txn,
String fileName,
boolean create)
throws FileNotFoundException
env - the Berkeley DB environmenttxn - the Berkeley DB transactionfileName - the name of the file containing the databasecreate - whether to create the database if it does not exist
FileNotFoundException - if the database file is not found
DbDatabaseException - if an unexpected database problem occurs| Method Detail |
|---|
static byte[] convertData(byte[] bytes)
public byte[] get(DbTransaction txn,
byte[] key,
boolean forUpdate)
null if the key is not found.
get in interface DbDatabasetxn - the transaction for this operationkey - the keyforUpdate - whether the object should be locked for update
null if the key was not found
public void markForUpdate(DbTransaction txn,
byte[] key)
markForUpdate in interface DbDatabasetxn - the transaction for this operationkey - the key
public void put(DbTransaction txn,
byte[] key,
byte[] value)
put in interface DbDatabasetxn - the transaction for this operationkey - the keyvalue - the value
public boolean putNoOverwrite(DbTransaction txn,
byte[] key,
byte[] value)
putNoOverwrite in interface DbDatabasetxn - the transaction for this operationkey - the keyvalue - the value
true if a value was stored for the key, and false if the key already had a value
public boolean delete(DbTransaction txn,
byte[] key)
delete in interface DbDatabasetxn - the transaction for this operationkey - the key
true if the value was removed, and false if the
key had no associated valuepublic DbCursor openCursor(DbTransaction txn)
openCursor in interface DbDatabasetxn - the transaction for this operation
public void close()
close in interface DbDatabase
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||