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)
TempletonStorage
startCleanup
in interface TempletonStorage
public void saveField(TempletonStorage.Type type, java.lang.String id, java.lang.String key, java.lang.String val) throws NotFoundException
TempletonStorage
saveField
in interface TempletonStorage
type
- 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 saveNotFoundException
public java.lang.String getField(TempletonStorage.Type type, java.lang.String id, java.lang.String key)
TempletonStorage
getField
in interface TempletonStorage
type
- 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)
TempletonStorage
getFields
in interface TempletonStorage
type
- 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
TempletonStorage
delete
in interface TempletonStorage
type
- The data type (as listed above)id
- The String id of this data grouping (jobid, etc.)NotFoundException
public java.util.List<java.lang.String> getAll()
TempletonStorage
getAll
in interface TempletonStorage
public java.util.List<java.lang.String> getAllForType(TempletonStorage.Type type)
TempletonStorage
getAllForType
in interface TempletonStorage
type
- The data type (as listed above)public java.util.List<java.lang.String> getAllForKey(java.lang.String key, java.lang.String value)
TempletonStorage
getAllForKey
in interface TempletonStorage
key
- 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)
TempletonStorage
getAllForTypeAndKey
in interface TempletonStorage
type
- 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
TempletonStorage
openStorage
in interface TempletonStorage
java.io.IOException
public void closeStorage() throws java.io.IOException
TempletonStorage
closeStorage
in interface TempletonStorage
java.io.IOException
public 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