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
IOException
public static org.apache.curator.framework.CuratorFramework zkOpen(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public void close() throws IOException
IOException
public void startCleanup(org.apache.hadoop.conf.Configuration config)
TempletonStorage
startCleanup
in interface TempletonStorage
public void create(TempletonStorage.Type type, String id) throws IOException
IOException
public 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
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
Copyright © 2016 The Apache Software Foundation. All rights reserved.