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
|
boolean |
canHandle(java.lang.String path)
Returns true if the persist layer understands given path.
|
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() |
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
|
abstract 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) |
boolean |
isSeekableOpenSupported()
Indicates whether this Persist backend can natively support Seekable InputStreams
|
protected static java.lang.String |
key2Str(Key k) |
long |
length(java.lang.String path) |
Persist.PersistEntry[] |
list(java.lang.String path) |
byte[] |
load(Key k,
long skip,
int max) |
abstract byte[] |
load(Value v)
Load a previously stored Value
|
boolean |
mkdirs(java.lang.String path) |
java.io.InputStream |
open(java.lang.String path) |
java.io.InputStream |
openSeekable(java.lang.String path)
Creates a seekable Hadoop implementation of InputStream (FSDataInputStream)
h2o-core doesn't depend on Hadoop libraries and can thus not declare the return type specifically
|
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.
|
java.io.InputStream |
wrapSeekable(Vec vec)
Creates a Seekable InputStream for a given Vec
|
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 byte[] load(Key k, long skip, int max) 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.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)
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 java.lang.String getParent(java.lang.String path)
public boolean isDirectory(java.lang.String path)
public long length(java.lang.String path)
public java.io.InputStream open(java.lang.String path)
public java.io.InputStream openSeekable(java.lang.String path)
path
- any H2O-3 allowed pathpublic boolean isSeekableOpenSupported()
public java.io.InputStream wrapSeekable(Vec vec)
vec
- any Vec in theory typically a ByteVec/FileVecpublic 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 fileFSIOException
- in case of underlying FS errorpublic boolean delete(java.lang.String path)
public boolean canHandle(java.lang.String path)