Class MapDBConfiguration
- java.lang.Object
-
- com.datumbox.framework.common.storage.abstracts.AbstractFileStorageConfiguration
-
- com.datumbox.framework.storage.mapdb.MapDBConfiguration
-
- All Implemented Interfaces:
Configurable,StorageConfiguration
public class MapDBConfiguration extends AbstractFileStorageConfiguration
The MapDBConfiguration class is used to configure the MapDB storage and generate new storage engines. MapDB storage uses collections which are backed by file and thus it does not load all the data in memory. The data are stored in MapDB files.- Author:
- Vasilis Vryniotis
-
-
Field Summary
-
Fields inherited from class com.datumbox.framework.common.storage.abstracts.AbstractFileStorageConfiguration
directory
-
-
Constructor Summary
Constructors Constructor Description MapDBConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StorageEnginecreateStorageEngine(String storageName)intgetCacheSize()Getter for the size of items stored in the LRU cache by MapDB.booleanisAsynchronous()Getter for the asynchronous option.booleanisCompressed()Getter for the compression option.booleanisHybridized()Getter for the Hybridized option.voidload(Properties properties)voidsetAsynchronous(boolean asynchronous)Setter for the asynchronous option.voidsetCacheSize(int cacheSize)Setter for the size of items stored in LRU cache by MapDB.voidsetCompressed(boolean compressed)Setter for the compression option.voidsetHybridized(boolean hybridized)Setter for the Hybridized option.-
Methods inherited from class com.datumbox.framework.common.storage.abstracts.AbstractFileStorageConfiguration
getDirectory, getStorageNameSeparator, setDirectory
-
-
-
-
Method Detail
-
createStorageEngine
public StorageEngine createStorageEngine(String storageName)
-
load
public void load(Properties properties)
-
getCacheSize
public int getCacheSize()
Getter for the size of items stored in the LRU cache by MapDB.- Returns:
-
setCacheSize
public void setCacheSize(int cacheSize)
Setter for the size of items stored in LRU cache by MapDB. Set it to 0 to turn off caching.- Parameters:
cacheSize-
-
isCompressed
public boolean isCompressed()
Getter for the compression option.- Returns:
-
setCompressed
public void setCompressed(boolean compressed)
Setter for the compression option. If turned on the records will be compressed. It is turned on by default.- Parameters:
compressed-
-
isHybridized
public boolean isHybridized()
Getter for the Hybridized option.- Returns:
-
setHybridized
public void setHybridized(boolean hybridized)
Setter for the Hybridized option. If turned on, it will take into account the storage hints provided during Map initialization and it will move more objects out of MapDB and into main Memory. This will lead to significantly improved speed but also higher memory utilization.- Parameters:
hybridized-
-
isAsynchronous
public boolean isAsynchronous()
Getter for the asynchronous option.- Returns:
-
setAsynchronous
public void setAsynchronous(boolean asynchronous)
Setter for the asynchronous option. If turned on, it will write the data asynchronously leading to speed improvements.- Parameters:
asynchronous-
-
-