public class HDFSStorage extends Object implements TempletonStorage
TempletonStorage.Type
Modifier and Type | Field and Description |
---|---|
static String |
JOB_PATH |
static String |
JOB_TRACKINGPATH |
static String |
OVERHEAD_PATH |
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,
String id)
Delete a data grouping (all data for a jobid, all tracking data
for a job, etc.).
|
List<String> |
getAllForType(TempletonStorage.Type type)
Get the id of each data grouping of a given type in the storage
system.
|
String |
getField(TempletonStorage.Type type,
String id,
String key)
Get the value of one field for a given data type.
|
String |
getPath(TempletonStorage.Type type)
Get the path to storage based on the type.
|
static String |
getPath(TempletonStorage.Type type,
String root)
Static method to get the path based on the type.
|
void |
openStorage(org.apache.hadoop.conf.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,
String id,
String key,
String val)
Save a single key/value pair for a specific job id.
|
void |
startCleanup(org.apache.hadoop.conf.Configuration config)
Start the cleanup process for this storage type.
|
public String storage_root
public static final String JOB_PATH
public static final String JOB_TRACKINGPATH
public static final String OVERHEAD_PATH
public void startCleanup(org.apache.hadoop.conf.Configuration config)
TempletonStorage
startCleanup
in interface TempletonStorage
public void saveField(TempletonStorage.Type type, String id, String key, 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 String getField(TempletonStorage.Type type, String id, 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 boolean delete(TempletonStorage.Type type, 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 List<String> getAllForType(TempletonStorage.Type type)
TempletonStorage
getAllForType
in interface TempletonStorage
type
- The data type (as listed above)public void openStorage(org.apache.hadoop.conf.Configuration config) throws IOException
TempletonStorage
openStorage
in interface TempletonStorage
IOException
public void closeStorage() throws IOException
TempletonStorage
closeStorage
in interface TempletonStorage
IOException
public String getPath(TempletonStorage.Type type)
type
- public static String getPath(TempletonStorage.Type type, String root)
type
- root
- Copyright © 2017 The Apache Software Foundation. All rights reserved.