public class BerkeleyStorage extends java.lang.Object implements BTreeStorage
Modifier and Type | Class and Description |
---|---|
class |
BerkeleyStorage.BerkeleyTransaction
Berkeley TransactionContext implementation
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BACKUPDIR
The directory of the storage execution log
|
static int |
INTERNALCACHE_PERCENT
The percentage of memory cache, Berkeley should use internally.
|
Constructor and Description |
---|
BerkeleyStorage()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Called by kernel on shut down
|
void |
closeStorage(java.lang.String domain)
Close a storage
|
void |
createHotBackup(java.lang.String domain)
Copy the domain database to a mirrored location and clear up the Execution log
|
void |
deleteDatabase(java.lang.String domain,
java.lang.String entity)
Delete a complete entity table
|
void |
deleteRecord(TransactionContext context,
java.lang.String taskID,
java.lang.String domain,
java.lang.String entity,
java.lang.Object key)
Dedicated deletion of an object
|
boolean |
exists(java.lang.String domain,
java.lang.String entity,
java.lang.Object key)
Check if a record exists in Storage
|
org.resoa.util.SymCipher |
getAes()
The internal symmetric cipher, used for TaskLog encryption
|
com.sleepycat.je.Database |
getDatabase(java.lang.String domain,
java.lang.String entity)
get a direct handle to a database
|
static com.sleepycat.je.DatabaseConfig |
getDBConfig()
Returns a DB configuration handle
|
static com.sleepycat.je.EnvironmentConfig |
getEnvConfig()
Returns an environment handle
|
<T> void |
openOrCreateStorage(PersistentType<T> persistentType,
java.lang.String storagePath)
Create a new Storage for a persistent type
|
void |
openOrCreateStorage(java.lang.String domain,
java.lang.String entity,
java.lang.String storagePath,
org.resoa.util.SymCipher aes,
boolean isCompressed)
Creates a storage
|
java.lang.String |
readRecord(java.lang.String domain,
java.lang.String entity,
java.lang.Object key)
Read Data from storage
|
org.resoa.grid.RecordSet |
readRecords(java.lang.String domain,
java.lang.String entity,
org.resoa.grid.RecordSet rules,
SqlSelectExpression sqlExpression,
boolean keysOnly)
Read key data from storage
|
TransactionContext |
startTransaction(java.lang.String domain,
TransactionContext.TransactionType type)
Start a transaction for a persistent service domain
|
void |
storeRecord(TransactionContext context,
java.lang.String taskID,
java.lang.String domain,
java.lang.String entity,
java.lang.Object key,
byte[] valueBytes)
Dedicated store of an object
|
public static int INTERNALCACHE_PERCENT
public static java.lang.String BACKUPDIR
public static com.sleepycat.je.EnvironmentConfig getEnvConfig()
public static com.sleepycat.je.DatabaseConfig getDBConfig()
public org.resoa.util.SymCipher getAes()
BTreeStorage
getAes
in interface BTreeStorage
public void openOrCreateStorage(java.lang.String domain, java.lang.String entity, java.lang.String storagePath, org.resoa.util.SymCipher aes, boolean isCompressed) throws StorageException
openOrCreateStorage
in interface BTreeStorage
domain
- entity
- storagePath
- aes
- isCompressed
- StorageException
public <T> void openOrCreateStorage(PersistentType<T> persistentType, java.lang.String storagePath) throws StorageException
BTreeStorage
openOrCreateStorage
in interface BTreeStorage
persistentType
- the PersistentType descriptorstoragePath
- the path to the storageStorageException
public com.sleepycat.je.Database getDatabase(java.lang.String domain, java.lang.String entity)
domain
- entity
- public void createHotBackup(java.lang.String domain) throws StorageException
BTreeStorage
createHotBackup
in interface BTreeStorage
domain
- the domainStorageException
public void closeStorage(java.lang.String domain)
BTreeStorage
closeStorage
in interface BTreeStorage
domain
- the domain to closepublic void close()
BTreeStorage
close
in interface BTreeStorage
public org.resoa.grid.RecordSet readRecords(java.lang.String domain, java.lang.String entity, org.resoa.grid.RecordSet rules, SqlSelectExpression sqlExpression, boolean keysOnly)
BTreeStorage
readRecords
in interface BTreeStorage
domain
- the domainentity
- the internal idrules
- a result set with additional restrictions (indices, max records)sqlExpression
- the sqlExpression handlekeysOnly
- if true, only keys will be readpublic java.lang.String readRecord(java.lang.String domain, java.lang.String entity, java.lang.Object key)
BTreeStorage
readRecord
in interface BTreeStorage
domain
- the domainentity
- the internal idkey
- the keypublic boolean exists(java.lang.String domain, java.lang.String entity, java.lang.Object key)
BTreeStorage
exists
in interface BTreeStorage
domain
- the domainentity
- the internal idkey
- the keypublic void storeRecord(TransactionContext context, java.lang.String taskID, java.lang.String domain, java.lang.String entity, java.lang.Object key, byte[] valueBytes) throws StorageException
BTreeStorage
storeRecord
in interface BTreeStorage
taskID
- the taskIDdomain
- the domainentity
- the internal idkey
- the keyvalueBytes
- the value to storeStorageException
public void deleteRecord(TransactionContext context, java.lang.String taskID, java.lang.String domain, java.lang.String entity, java.lang.Object key) throws StorageException
BTreeStorage
deleteRecord
in interface BTreeStorage
taskID
- the taskIDdomain
- the domainentity
- the internal idkey
- the keyStorageException
public void deleteDatabase(java.lang.String domain, java.lang.String entity) throws StorageException
BTreeStorage
deleteDatabase
in interface BTreeStorage
StorageException
public TransactionContext startTransaction(java.lang.String domain, TransactionContext.TransactionType type) throws org.resoa.exception.PersistenceException
BTreeStorage
startTransaction
in interface BTreeStorage
org.resoa.exception.PersistenceException
Copyright © 2005-2014 The Resoa Project, resoa.org.