public class HDFSStorage extends java.lang.Object implements TempletonStorage
TempletonStorage.Type| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JOB_PATH |
static java.lang.String |
JOB_TRACKINGPATH |
static java.lang.String |
OVERHEAD_PATH |
java.lang.String |
storage_root |
STORAGE_CLASS, STORAGE_ROOT| Constructor and Description |
|---|
HDFSStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeStorage()
For storage methods that require a connection, this is a hint
that it's time to close the connection.
|
boolean |
delete(TempletonStorage.Type type,
java.lang.String id)
Delete a data grouping (all data for a jobid, all tracking data
for a job, etc.).
|
java.util.List<java.lang.String> |
getAll()
Get the id of each data grouping in the storage system.
|
java.util.List<java.lang.String> |
getAllForKey(java.lang.String key,
java.lang.String value)
Get the id of each data grouping that has the specific key/value
pair.
|
java.util.List<java.lang.String> |
getAllForType(TempletonStorage.Type type)
Get the id of each data grouping of a given type in the storage
system.
|
java.util.List<java.lang.String> |
getAllForTypeAndKey(TempletonStorage.Type type,
java.lang.String key,
java.lang.String value)
Get the id of each data grouping of a given type that has the
specific key/value pair.
|
java.lang.String |
getField(TempletonStorage.Type type,
java.lang.String id,
java.lang.String key)
Get the value of one field for a given data type.
|
java.util.Map<java.lang.String,java.lang.String> |
getFields(TempletonStorage.Type type,
java.lang.String id)
Get all the name/value pairs stored for this id.
|
java.lang.String |
getPath(TempletonStorage.Type type)
Get the path to storage based on the type.
|
static java.lang.String |
getPath(TempletonStorage.Type type,
java.lang.String root)
Static method to get the path based on the type.
|
void |
openStorage(Configuration config)
For storage methods that require a connection, this is a hint
that it's time to open a connection.
|
void |
saveField(TempletonStorage.Type type,
java.lang.String id,
java.lang.String key,
java.lang.String val)
Save a single key/value pair for a specific job id.
|
void |
startCleanup(Configuration config)
Start the cleanup process for this storage type.
|
public java.lang.String storage_root
public static final java.lang.String JOB_PATH
public static final java.lang.String JOB_TRACKINGPATH
public static final java.lang.String OVERHEAD_PATH
public void startCleanup(Configuration config)
TempletonStoragestartCleanup in interface TempletonStoragepublic void saveField(TempletonStorage.Type type, java.lang.String id, java.lang.String key, java.lang.String val) throws NotFoundException
TempletonStoragesaveField in interface TempletonStoragetype - The data type (as listed above)id - The String id of this data grouping (jobid, etc.)key - The name of the field to saveval - The value of the field to saveNotFoundExceptionpublic java.lang.String getField(TempletonStorage.Type type, java.lang.String id, java.lang.String key)
TempletonStoragegetField in interface TempletonStoragetype - The data type (as listed above)id - The String id of this data grouping (jobid, etc.)key - The name of the field to retrievepublic java.util.Map<java.lang.String,java.lang.String> getFields(TempletonStorage.Type type, java.lang.String id)
TempletonStoragegetFields in interface TempletonStoragetype - The data type (as listed above)id - The String id of this data grouping (jobid, etc.)public boolean delete(TempletonStorage.Type type, java.lang.String id) throws NotFoundException
TempletonStoragedelete in interface TempletonStoragetype - The data type (as listed above)id - The String id of this data grouping (jobid, etc.)NotFoundExceptionpublic java.util.List<java.lang.String> getAll()
TempletonStoragegetAll in interface TempletonStoragepublic java.util.List<java.lang.String> getAllForType(TempletonStorage.Type type)
TempletonStoragegetAllForType in interface TempletonStoragetype - The data type (as listed above)public java.util.List<java.lang.String> getAllForKey(java.lang.String key,
java.lang.String value)
TempletonStoragegetAllForKey in interface TempletonStoragekey - The name of the field to search forvalue - The value of the field to search forpublic java.util.List<java.lang.String> getAllForTypeAndKey(TempletonStorage.Type type, java.lang.String key, java.lang.String value)
TempletonStoragegetAllForTypeAndKey in interface TempletonStoragetype - The data type (as listed above)key - The name of the field to search forvalue - The value of the field to search forpublic void openStorage(Configuration config)
throws java.io.IOException
TempletonStorageopenStorage in interface TempletonStoragejava.io.IOExceptionpublic void closeStorage()
throws java.io.IOException
TempletonStoragecloseStorage in interface TempletonStoragejava.io.IOExceptionpublic java.lang.String getPath(TempletonStorage.Type type)
type - public static java.lang.String getPath(TempletonStorage.Type type, java.lang.String root)
type - root - Copyright © 2012 The Apache Software Foundation