Interface Store
-
- All Known Implementing Classes:
FileStore,LogStore,MemoryStore,PackStore,SlowStore,StatsStore
public interface StoreStorage for files in a tree store.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_FILE_SIZE_BYTESstatic StringMAX_FILE_SIZE_BYTES
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Close the storedefault PageFileget(String key)Get a filedefault byte[]getBytes(String key)PropertiesgetConfig()PageFilegetIfExists(String key)Get a file if it existslonggetMaxFileSizeBytes()Get the maximum file size configured.longgetReadCount()Get the number of files read.longgetWriteCount()Get the number of files written.Set<String>keySet()Get the list of files.StringnewFileName()Generate a new file name.voidput(String key, PageFile value)Storage a file.default voidputBytes(String key, byte[] data)voidremove(Set<String> set)Remove a number of files.voidremoveAll()Remove all files.voidsetWriteCompression(Compression compression)Set the compression algorithm used for writing from now on.default booleansupportsByteOperations()
-
-
-
Field Detail
-
MAX_FILE_SIZE_BYTES
static final String MAX_FILE_SIZE_BYTES
- See Also:
- Constant Field Values
-
DEFAULT_MAX_FILE_SIZE_BYTES
static final int DEFAULT_MAX_FILE_SIZE_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIfExists
PageFile getIfExists(String key)
Get a file if it exists- Parameters:
key- the file name- Returns:
- the file, or null
-
put
void put(String key, PageFile value)
Storage a file.- Parameters:
key- the file namevalue- the file
-
newFileName
String newFileName()
Generate a new file name.- Returns:
-
removeAll
void removeAll()
Remove all files.
-
getWriteCount
long getWriteCount()
Get the number of files written.- Returns:
- the result
-
getReadCount
long getReadCount()
Get the number of files read.- Returns:
- the result
-
setWriteCompression
void setWriteCompression(Compression compression)
Set the compression algorithm used for writing from now on.- Parameters:
compression- the compression algorithm
-
close
void close()
Close the store
-
getConfig
Properties getConfig()
-
getMaxFileSizeBytes
long getMaxFileSizeBytes()
Get the maximum file size configured.- Returns:
- the file size, in bytes
-
supportsByteOperations
default boolean supportsByteOperations()
-
getBytes
default byte[] getBytes(String key)
-
putBytes
default void putBytes(String key, byte[] data)
-
-