public class BerkeleyDBBinaryStore extends AbstractBinaryStore
| Modifier and Type | Class and Description |
|---|---|
protected class |
BerkeleyDBBinaryStore.DatabaseHolder
The DatabaseHolder class is used as a wrapper around a Berkeley DB Database object.
|
Base.LoggingWriter, Base.StackFrameBinaryStore.KeySetAware, BinaryStore.SizeAware| Modifier and Type | Field and Description |
|---|---|
protected BerkeleyDBBinaryStore.DatabaseHolder |
m_db
The Database handle.
|
protected DatabaseFactory |
m_factory
Factory used to create this Database.
|
| Constructor and Description |
|---|
BerkeleyDBBinaryStore(String sDbName, DatabaseFactory dbFactory)
Create a new Berkeley DB BinaryStore using the supplied DatabaseFactory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the BinaryStore.
|
void |
erase(Binary binKey)
Remove the specified key from the underlying store if present.
|
void |
eraseAll()
Remove all data from the underlying store.
|
BerkeleyDBBinaryStore.DatabaseHolder |
getDbHolder()
Get the DatabaseHolder.
|
DatabaseFactory |
getFactory()
Get the DatabaseFactory used to create the underlying Database.
|
protected void |
init(String sDbName, DatabaseFactory dbFactory)
Initialize the BinaryStore.
|
Iterator |
keys()
Iterate all keys in the underlying store.
|
Binary |
load(Binary binKey)
Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.
|
void |
store(Binary binKey, Binary binValue)
Store the specified value under the specific key in the underlying store.
|
String |
toString()
Return a human readable description of the BinaryStore.
|
getDefaultDirectoryazzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, waitprotected volatile BerkeleyDBBinaryStore.DatabaseHolder m_db
protected DatabaseFactory m_factory
public BerkeleyDBBinaryStore(String sDbName, DatabaseFactory dbFactory) throws com.sleepycat.je.DatabaseException
sDbName - the name of the table to store the cache's data in, null indicates a temporary table name.dbFactory - the factory to use to create the Databasecom.sleepycat.je.DatabaseException - if the Database creation failedprotected void init(String sDbName, DatabaseFactory dbFactory) throws com.sleepycat.je.DatabaseException
sDbName - the name of the table to store the cache's data in, null indicates a temporary table name.dbFactory - the factory to use to create the Databasecom.sleepycat.je.DatabaseException - if the Database creation failedpublic String toString()
public Binary load(Binary binKey)
load in interface BinaryStoreload in class AbstractBinaryStorebinKey - key whose associated value is to be returnedpublic void store(Binary binKey, Binary binValue)
This method is supports both key/value creation and value update for a specific key.
store in interface BinaryStorestore in class AbstractBinaryStorebinKey - key to store the value underbinValue - value to be storedpublic void erase(Binary binKey)
erase in interface BinaryStoreerase in class AbstractBinaryStorebinKey - key whose mapping is to be removed from the mappublic void eraseAll()
eraseAll in interface BinaryStoreeraseAll in class AbstractBinaryStorepublic Iterator keys()
keys in interface BinaryStorekeys in class AbstractBinaryStorepublic void close()
public BerkeleyDBBinaryStore.DatabaseHolder getDbHolder()
public DatabaseFactory getFactory()