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.StackFrame
BinaryStore.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.
|
getDefaultDirectory
azzert, 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, getProcessRandom, 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, 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, wait
protected 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 BinaryStore
load
in class AbstractBinaryStore
binKey
- 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 BinaryStore
store
in class AbstractBinaryStore
binKey
- key to store the value underbinValue
- value to be storedpublic void erase(Binary binKey)
erase
in interface BinaryStore
erase
in class AbstractBinaryStore
binKey
- key whose mapping is to be removed from the mappublic void eraseAll()
eraseAll
in interface BinaryStore
eraseAll
in class AbstractBinaryStore
public Iterator keys()
keys
in interface BinaryStore
keys
in class AbstractBinaryStore
public void close()
public BerkeleyDBBinaryStore.DatabaseHolder getDbHolder()
public DatabaseFactory getFactory()