public class ZooKeeperManager extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ZooKeeperManager.State
State of the application
|
Constructor and Description |
---|
ZooKeeperManager(org.apache.hadoop.mapreduce.Mapper.Context context,
ImmutableClassesGiraphConfiguration configuration)
Constructor with context.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Do necessary cleanup in zookeeper wrapper.
|
void |
cleanupOnExit()
Mark files zookeeper creates in hdfs to be deleted on exit.
|
boolean |
computationDone()
Check if all the computation is done.
|
void |
createCandidateStamp()
Create a HDFS stamp for this task.
|
static String |
getBasePath(org.apache.hadoop.conf.Configuration conf)
Return the base ZooKeeper ZNode from which all other ZNodes Giraph creates
should be sited, for instance in a multi-tenant ZooKeeper, the znode
reserved for Giraph
|
String |
getZooKeeperServerPortString()
Users can get the server port string to connect to ZooKeeper
|
void |
offlineZooKeeperServers(ZooKeeperManager.State state)
Notify the ZooKeeper servers that this partition is done with all
ZooKeeper communication.
|
void |
onlineZooKeeperServer()
If this task has been selected, online a ZooKeeper server.
|
boolean |
runsZooKeeper()
Is this task running a ZooKeeper server? Only could be true if called
after onlineZooKeeperServers().
|
void |
setup()
Create the candidate stamps and decide on the servers to start if
you are partition 0.
|
public ZooKeeperManager(org.apache.hadoop.mapreduce.Mapper.Context context, ImmutableClassesGiraphConfiguration configuration) throws IOException
context
- Context to be stored internallyconfiguration
- ConfigurationIOException
public static String getBasePath(org.apache.hadoop.conf.Configuration conf)
conf
- Necessary to access user-provided valuespublic void setup() throws IOException, InterruptedException
IOException
InterruptedException
public void createCandidateStamp()
public boolean computationDone()
public String getZooKeeperServerPortString()
public void onlineZooKeeperServer() throws IOException
IOException
public void offlineZooKeeperServers(ZooKeeperManager.State state)
state
- State of the applicationpublic boolean runsZooKeeper()
public void cleanupOnExit()
public void cleanup()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.