public abstract class Persist
extends java.lang.Object
store(Value v)
- Store a Value, using storage space.load(Value v)
- Load a previously stored Value.delete(Value v)
- Free storage from a previously store Value.Modifier and Type | Class and Description |
---|---|
static class |
Persist.PersistEntry |
Constructor and Description |
---|
Persist() |
Modifier and Type | Method and Description |
---|---|
abstract java.util.List<java.lang.String> |
calcTypeaheadMatches(java.lang.String filter,
int limit)
Calculate typeahead matches for src
|
abstract void |
cleanUp()
Delete persistent storage on startup and shutdown
|
java.io.OutputStream |
create(java.lang.String path,
boolean overwrite)
Create a new file and return OutputStream for writing.
|
boolean |
delete(java.lang.String path) |
abstract void |
delete(Value v)
Reclaim space from a previously stored Value
|
boolean |
exists(java.lang.String path) |
java.lang.String |
getHomeDirectory() |
long |
getTotalSpace()
Total storage space, or -1 for unknown
|
long |
getUsableSpace()
Usable storage space, or -1 for unknown
|
abstract void |
importFiles(java.lang.String path,
java.util.ArrayList<java.lang.String> files,
java.util.ArrayList<java.lang.String> keys,
java.util.ArrayList<java.lang.String> fails,
java.util.ArrayList<java.lang.String> dels) |
protected static java.lang.String |
key2Str(Key k) |
long |
length(java.lang.String path) |
Persist.PersistEntry[] |
list(java.lang.String path) |
abstract byte[] |
load(Value v)
Load a previously stored Value
|
boolean |
mkdirs(java.lang.String path) |
java.io.InputStream |
open(java.lang.String path) |
boolean |
rename(java.lang.String fromPath,
java.lang.String toPath) |
abstract void |
store(Value v)
Store a Value into persistent storage, consuming some storage space.
|
abstract Key |
uriToKey(java.net.URI uri)
Transform given uri into file vector holding file name.
|
public abstract void store(Value v) throws java.io.IOException
java.io.IOException
public abstract byte[] load(Value v) throws java.io.IOException
java.io.IOException
public abstract void delete(Value v)
public long getUsableSpace()
public long getTotalSpace()
public abstract Key uriToKey(java.net.URI uri) throws java.io.IOException
java.io.IOException
public abstract void cleanUp()
public abstract java.util.List<java.lang.String> calcTypeaheadMatches(java.lang.String filter, int limit)
filter
- Source string to match for typeaheadlimit
- Max number of entries to returnpublic abstract void importFiles(java.lang.String path, java.util.ArrayList<java.lang.String> files, java.util.ArrayList<java.lang.String> keys, java.util.ArrayList<java.lang.String> fails, java.util.ArrayList<java.lang.String> dels)
protected static java.lang.String key2Str(Key k)
public java.lang.String getHomeDirectory()
public Persist.PersistEntry[] list(java.lang.String path)
public boolean exists(java.lang.String path)
public long length(java.lang.String path)
public java.io.InputStream open(java.lang.String path)
public boolean mkdirs(java.lang.String path)
public boolean rename(java.lang.String fromPath, java.lang.String toPath)
public java.io.OutputStream create(java.lang.String path, boolean overwrite)
path
- persist layer specific pathoverwrite
- overwrite destination filejava.io.IOException
- in case of underlying FS errorpublic boolean delete(java.lang.String path)