public class PersistManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PersistManager.PersistStatsEntry |
static interface |
PersistManager.Schemes
Persistence schemes; used as file prefixes eg "hdfs://some_hdfs_path/some_file"
|
Modifier and Type | Field and Description |
---|---|
static int |
MAX_BACKENDS |
static int |
VALUE_DRIVE |
Constructor and Description |
---|
PersistManager(java.net.URI iceRoot) |
Modifier and Type | Method and Description |
---|---|
Key |
anyURIToKey(java.net.URI uri)
Convert given URI into a specific H2O key representation.
|
java.util.List<java.lang.String> |
calcTypeaheadMatches(java.lang.String filter,
int limit)
Calculate typeahead matches for src
|
java.io.OutputStream |
create(java.lang.String path,
boolean overwrite) |
void |
delete(int backend,
Value v) |
boolean |
delete(java.lang.String path) |
boolean |
exists(java.lang.String path) |
java.lang.String |
getHdfsHomeDirectory() |
Persist |
getIce()
Get the current Persist flavor for user-mode swapping.
|
Persist |
getPersistForURI(java.net.URI uri) |
PersistManager.PersistStatsEntry[] |
getStats() |
void |
importFiles(java.lang.String[] paths,
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) |
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)
From a path produce a list of files and keys for parsing.
|
boolean |
isEmptyDirectoryAllNodes(java.lang.String path)
Checks whether a given path is either an empty directory or it doesn't yet exist.
|
boolean |
isGcsPath(java.lang.String path) |
boolean |
isHdfsPath(java.lang.String path) |
boolean |
isHexPath(java.lang.String path) |
boolean |
isWritableDirectory(java.lang.String path)
Check whether given path represents a writable directory.
|
long |
length(java.lang.String path) |
Persist.PersistEntry[] |
list(java.lang.String path) |
byte[] |
load(int backend,
Key k,
long skip,
int max) |
byte[] |
load(int backend,
Value v) |
boolean |
mkdirs(java.lang.String path) |
java.io.InputStream |
open(java.lang.String path) |
java.io.InputStream |
openSeekable(Vec vec)
Opens a
Vec in seekable implementation of an InputStream . |
boolean |
rename(java.lang.String fromPath,
java.lang.String toPath) |
void |
store(int backend,
Value v) |
java.lang.String |
toHexPath(Key<?> key) |
public static final int MAX_BACKENDS
public static final int VALUE_DRIVE
public PersistManager.PersistStatsEntry[] getStats()
public boolean isHdfsPath(java.lang.String path)
public boolean isGcsPath(java.lang.String path)
public boolean isHexPath(java.lang.String path)
public java.lang.String toHexPath(Key<?> key)
public void store(int backend, Value v) throws java.io.IOException
java.io.IOException
public void delete(int backend, Value v)
public byte[] load(int backend, Value v) throws java.io.IOException
java.io.IOException
public byte[] load(int backend, Key k, long skip, int max) throws java.io.IOException
java.io.IOException
public Persist getIce()
public final Key anyURIToKey(java.net.URI uri) throws java.io.IOException
uri
- file locationjava.io.IOException
- in the case of uri conversion problemH2OIllegalArgumentException
- in case of unsupported schemepublic 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 void importFiles(java.lang.String[] paths, 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)
public 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)
path
- (Input) Path to import data frompattern
- (Input) Regex pattern to match files byfiles
- (Output) List of files foundkeys
- (Output) List of keys corresponding to filesfails
- (Output) List of failed files which mismatch among nodesdels
- (Output) I don't know what this ispublic java.lang.String getHdfsHomeDirectory()
public Persist.PersistEntry[] list(java.lang.String path)
public boolean exists(java.lang.String path)
public boolean isEmptyDirectoryAllNodes(java.lang.String path)
path
- path we want to checkpublic boolean isWritableDirectory(java.lang.String path)
path
- Path to check if a writable directorypublic long length(java.lang.String path)
public java.io.InputStream open(java.lang.String path)
public java.io.InputStream openSeekable(Vec vec) throws java.io.IOException
Vec
in seekable implementation of an InputStream
.vec
- An instance of Vec
to openInputStream
, never null.java.io.IOException
- When the underlying resource does not allow seekable resource creation and all fallback solutions
failed. Or on reading error.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)
public boolean delete(java.lang.String path)
public Persist getPersistForURI(java.net.URI uri)