public final class PersistFS extends Persist
Persist.PersistEntry
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.lang.String> |
calcTypeaheadMatches(java.lang.String src,
int limit)
Calculate typeahead matches for src
|
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) |
void |
delete(Value v)
Reclaim space from a previously stored Value
|
boolean |
exists(java.lang.String path) |
java.io.File |
getFile(Value v)
Get destination file where value is stored
|
java.lang.String |
getParent(java.lang.String path) |
long |
getTotalSpace()
Total storage space, or -1 for unknown
|
long |
getUsableSpace()
Usable storage space, or -1 for unknown
|
void |
importFiles(java.lang.String path,
java.lang.String pattern,
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) |
boolean |
isDirectory(java.lang.String path) |
Persist.PersistEntry[] |
list(java.lang.String path) |
byte[] |
load(Value v)
Load a previously stored Value
|
boolean |
mkdirs(java.lang.String path) |
java.io.InputStream |
open(java.lang.String path) |
void |
store(Value v)
Store a Value into persistent storage, consuming some storage space.
|
Key |
uriToKey(java.net.URI uri)
Transform given uri into file vector holding file name.
|
canHandle, getHomeDirectory, isSeekableOpenSupported, key2Str, length, load, openSeekable, rename, wrapSeekable
public void cleanUp()
Persist
public java.io.File getFile(Value v)
v
- any value from K/Vpublic byte[] load(Value v) throws java.io.IOException
Persist
public void store(Value v) throws java.io.IOException
Persist
public void delete(Value v)
Persist
public long getUsableSpace()
Persist
getUsableSpace
in class Persist
public long getTotalSpace()
Persist
getTotalSpace
in class Persist
public Key uriToKey(java.net.URI uri)
Persist
public java.util.ArrayList<java.lang.String> calcTypeaheadMatches(java.lang.String src, int limit)
Persist
calcTypeaheadMatches
in class Persist
src
- Source string to match for typeaheadlimit
- Max number of entries to returnpublic void importFiles(java.lang.String path, java.lang.String pattern, 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)
importFiles
in class Persist
public java.io.OutputStream create(java.lang.String path, boolean overwrite)
Persist
public Persist.PersistEntry[] list(java.lang.String path)
public java.lang.String getParent(java.lang.String path)
public boolean isDirectory(java.lang.String path)
isDirectory
in class Persist