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 |
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 |
isDirectory(java.lang.String path) |
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 |
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,
Value v) |
java.util.ArrayList<java.lang.String> |
matchPattern(java.lang.String prefix,
java.util.ArrayList<java.lang.String> fileList,
java.lang.String matchStr)
Finds all entries in the list that matches the regex
|
boolean |
mkdirs(java.lang.String path) |
java.io.InputStream |
open(java.lang.String path) |
boolean |
rename(java.lang.String fromPath,
java.lang.String toPath) |
void |
store(int backend,
Value v) |
public static final int MAX_BACKENDS
public PersistManager.PersistStatsEntry[] getStats()
public boolean isHdfsPath(java.lang.String path)
public boolean isGcsPath(java.lang.String path)
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 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 isDirectory(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 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)
public java.util.ArrayList<java.lang.String> matchPattern(java.lang.String prefix, java.util.ArrayList<java.lang.String> fileList, java.lang.String matchStr)
prefix
- The substring to extract before pattern matchingfileList
- The list of strings to checkmatchStr
- The regular expression to use on the string after prefix