public class ZooKeeperStorage extends Object implements TempletonStorage
TempletonStorage.Type| Modifier and Type | Field and Description |
|---|---|
static String |
ENCODING |
String |
job_path |
String |
job_trackingpath |
String |
overhead_path |
String |
storage_root |
static String |
TRACKINGDIR |
static String |
ZK_HOSTS |
static String |
ZK_SESSION_TIMEOUT |
STORAGE_CLASS, STORAGE_ROOT| Constructor and Description |
|---|
ZooKeeperStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this ZK connection.
|
void |
closeStorage()
For storage methods that require a connection, this is a hint
that it's time to close the connection.
|
void |
create(TempletonStorage.Type type,
String id)
Create a node in ZooKeeper
|
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 based on the job type.
|
static String[] |
getPaths(String fullpath) |
String |
makeFieldZnode(TempletonStorage.Type type,
String id,
String name)
Make a ZK path to the named field.
|
String |
makeZnode(TempletonStorage.Type type,
String id)
Make a ZK path to job
|
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.
|
static org.apache.curator.framework.CuratorFramework |
zkOpen(org.apache.hadoop.conf.Configuration conf)
Open a ZooKeeper connection for the JobState.
|
static org.apache.curator.framework.CuratorFramework |
zkOpen(String zkHosts,
int zkSessionTimeoutMs)
Open a ZooKeeper connection for the JobState.
|
public static final String TRACKINGDIR
public String storage_root
public String job_path
public String job_trackingpath
public String overhead_path
public static final String ZK_HOSTS
public static final String ZK_SESSION_TIMEOUT
public static final String ENCODING
public static org.apache.curator.framework.CuratorFramework zkOpen(String zkHosts, int zkSessionTimeoutMs) throws IOException
IOExceptionpublic static org.apache.curator.framework.CuratorFramework zkOpen(org.apache.hadoop.conf.Configuration conf)
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic void startCleanup(org.apache.hadoop.conf.Configuration config)
TempletonStoragestartCleanup in interface TempletonStoragepublic void create(TempletonStorage.Type type, String id) throws IOException
IOExceptionpublic String getPath(TempletonStorage.Type type)
type - public String makeFieldZnode(TempletonStorage.Type type, String id, String name)
public String makeZnode(TempletonStorage.Type type, String id)
public void saveField(TempletonStorage.Type type, String id, String key, 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 String getField(TempletonStorage.Type type, String id, 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 boolean delete(TempletonStorage.Type type, 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 List<String> getAllForType(TempletonStorage.Type type)
TempletonStoragegetAllForType in interface TempletonStoragetype - The data type (as listed above)public void openStorage(org.apache.hadoop.conf.Configuration config)
throws IOException
TempletonStorageopenStorage in interface TempletonStorageIOExceptionpublic void closeStorage()
throws IOException
TempletonStoragecloseStorage in interface TempletonStorageIOExceptionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.