Interface Store
-
- All Known Implementing Classes:
FileStore
,LogStore
,MemoryStore
,PackStore
,SlowStore
,StatsStore
public interface Store
Storage for files in a tree store.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_FILE_SIZE_BYTES
static String
MAX_FILE_SIZE_BYTES
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
Close the storedefault PageFile
get(String key)
Get a filedefault byte[]
getBytes(String key)
Properties
getConfig()
PageFile
getIfExists(String key)
Get a file if it existslong
getMaxFileSizeBytes()
Get the maximum file size configured.long
getReadCount()
Get the number of files read.long
getWriteCount()
Get the number of files written.Set<String>
keySet()
Get the list of files.String
newFileName()
Generate a new file name.void
put(String key, PageFile value)
Storage a file.default void
putBytes(String key, byte[] data)
void
remove(Set<String> set)
Remove a number of files.void
removeAll()
Remove all files.void
setWriteCompression(Compression compression)
Set the compression algorithm used for writing from now on.default boolean
supportsByteOperations()
-
-
-
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)
-
-