Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current
thread is interrupted, whichever happens first.
|
void |
backup(java.nio.file.Path zipPath)
Creates a backup of the entire database
|
<K extends BlueKey,T extends java.io.Serializable> |
collectionBuilder(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<T> valueType)
Creates a
BlueCollectionBuilder object for this BlueDb |
protected java.util.List<BlueCollectionOnDisk<?>> |
getAllCollectionsFromDisk() |
BackupManager |
getBackupManager() |
<T extends java.io.Serializable> |
getCollection(java.lang.String name,
java.lang.Class<T> valueType)
Gets an existing
BlueCollection |
java.nio.file.Path |
getPath() |
BlueExecutor |
getSharedExecutor() |
protected BlueCollectionOnDisk |
getUntypedCollectionForBackup(java.lang.String folderName) |
<T extends java.io.Serializable> |
initializeCollection(java.lang.String name,
java.lang.Class<? extends BlueKey> keyType,
java.lang.Class<T> valueType,
java.lang.Class<? extends java.io.Serializable>... additionalClassesToRegister)
Deprecated.
|
protected <T extends java.io.Serializable> |
initializeCollection(java.lang.String name,
java.lang.Class<? extends BlueKey> keyType,
java.lang.Class<T> valueType,
java.util.List<java.lang.Class<? extends java.io.Serializable>> additionalClassesToRegister) |
protected <T extends java.io.Serializable> |
initializeCollection(java.lang.String name,
java.lang.Class<? extends BlueKey> keyType,
java.lang.Class<T> valueType,
java.util.List<java.lang.Class<? extends java.io.Serializable>> additionalClassesToRegister,
SegmentSizeSetting segmentSize) |
void |
shutdown()
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
This method does not wait for previously submitted tasks to complete execution. |
void |
shutdownNow()
Attempts to stop all actively executing tasks and halts the processing of waiting tasks.
This method does not wait for actively executing tasks to terminate. |
public <T extends java.io.Serializable> BlueCollection<T> getCollection(java.lang.String name, java.lang.Class<T> valueType) throws BlueDbException
BlueDb
BlueCollection
getCollection
in interface BlueDb
T
- the object type of values to be serialized into the collectionname
- The unique name of the collectionvalueType
- the class type of the values stored in the collectionBlueCollection
if it exists, else nullBlueDbException
- if any issues encountered, such as the existing collection having a different key typepublic <K extends BlueKey,T extends java.io.Serializable> BlueCollectionOnDiskBuilder<K,T> collectionBuilder(java.lang.String name, java.lang.Class<K> keyType, java.lang.Class<T> valueType)
BlueDb
BlueCollectionBuilder
object for this BlueDb
collectionBuilder
in interface BlueDb
K
- the key type of the collectionT
- the object type of values to be serialized into the collectionname
- The unique name of the collectionkeyType
- the class type of the collection's keysvalueType
- the class type of the values stored in the collectionBlueCollectionBuilder
object for this BlueDb
@Deprecated public <T extends java.io.Serializable> BlueCollection<T> initializeCollection(java.lang.String name, java.lang.Class<? extends BlueKey> keyType, java.lang.Class<T> valueType, java.lang.Class<? extends java.io.Serializable>... additionalClassesToRegister) throws BlueDbException
BlueDb
BlueCollection
, or returns the existing one of the same name, if one existsinitializeCollection
in interface BlueDb
T
- the object type of values to be serialized into the collectionname
- the unique name of the collectionkeyType
- the class type of the collection's keysvalueType
- the class type of the values stored in the collectionadditionalClassesToRegister
- classes to optimize for in the serializer (should be classes that will be stored in collection keys or values)BlueDbException
- if any problems are encountered, such as the collection already existing with a different typeprotected <T extends java.io.Serializable> BlueCollection<T> initializeCollection(java.lang.String name, java.lang.Class<? extends BlueKey> keyType, java.lang.Class<T> valueType, java.util.List<java.lang.Class<? extends java.io.Serializable>> additionalClassesToRegister) throws BlueDbException
BlueDbException
protected <T extends java.io.Serializable> BlueCollection<T> initializeCollection(java.lang.String name, java.lang.Class<? extends BlueKey> keyType, java.lang.Class<T> valueType, java.util.List<java.lang.Class<? extends java.io.Serializable>> additionalClassesToRegister, SegmentSizeSetting segmentSize) throws BlueDbException
BlueDbException
public void backup(java.nio.file.Path zipPath) throws BlueDbException
BlueDb
backup
in interface BlueDb
zipPath
- where the backup will be createdBlueDbException
- if any issues encountered, such as file system problemspublic void shutdown()
BlueDb
public void shutdownNow()
BlueDb
shutdownNow
in interface BlueDb
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit timeUnit) throws BlueDbException
BlueDb
awaitTermination
in interface BlueDb
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentBlueDbException
- if any issues are encountered, such as being interruptedpublic java.nio.file.Path getPath()
public BackupManager getBackupManager()
public BlueExecutor getSharedExecutor()
protected java.util.List<BlueCollectionOnDisk<?>> getAllCollectionsFromDisk() throws BlueDbException
BlueDbException
protected BlueCollectionOnDisk getUntypedCollectionForBackup(java.lang.String folderName) throws BlueDbException
BlueDbException