I - Vertex idV - Vertex dataE - Edge datapublic abstract class BspService<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends Object implements org.apache.zookeeper.Watcher, CentralizedService<I,V,E>
CentralizedService.| Modifier and Type | Field and Description | 
|---|---|
| static String | APPLICATION_ATTEMPTS_DIRDirectory of attempts of this application | 
| protected String | applicationAttemptsPathPath to the application attempts) | 
| static String | BASE_DIRBase ZooKeeper directory | 
| protected String | basePathPath to the job's root | 
| protected String | checkpointBasePathPath to the checkpoint's root (including job id) | 
| static String | CLEANED_UP_DIRDenotes which workers have been cleaned up | 
| protected String | cleanedUpPathPath to the cleaned up notifications | 
| static String | COUNTERS_DIRCounter sub directory | 
| static String | FORCE_CHECKPOINT_USER_FLAGUser sets this flag to checkpoint and stop the job | 
| static String | HALT_COMPUTATION_NODEDenotes that computation should be halted | 
| protected String | haltComputationPathIf this path exists computation will be halted | 
| static String | INPUT_SPLITS_ALL_DONE_NODEInput splits all done node | 
| static String | INPUT_SPLITS_WORKER_DONE_DIRInput splits worker done directory | 
| static long | INPUT_SUPERSTEPInput superstep (superstep when loading the vertices happens) | 
| protected String | inputSplitsAllDonePathInput splits all done node | 
| protected String | inputSplitsWorkerDonePathInput splits worker done directory | 
| static String | JSONOBJ_APPLICATION_ATTEMPT_KEYJSON application attempt key | 
| static String | JSONOBJ_METRICS_KEYJSON metrics key | 
| static String | JSONOBJ_NUM_MESSAGE_BYTES_KEYJSON message bytes count key | 
| static String | JSONOBJ_NUM_MESSAGES_KEYJSON message count key | 
| static String | JSONOBJ_STATE_KEYJSON state key | 
| static String | JSONOBJ_SUPERSTEP_KEYJSON superstep key | 
| static String | KRYO_REGISTERED_CLASS_DIRDirectory to store kryo className-ID assignment | 
| protected String | kryoRegisteredClassPathKryo className-ID mapping directory | 
| static String | MASTER_ELECTION_DIRWhere the master election happens | 
| static String | MASTER_JOB_STATE_NODEMaster job state znode above base dir | 
| static String | MASTER_SUFFIXSuffix denotes a master | 
| protected String | masterElectionPathPath to the master election path | 
| protected String | masterJobStatePathPath to the job state determined by the master (informative only) | 
| static String | MEMORY_OBSERVER_DIRMemory observer dir | 
| protected String | memoryObserverPathPath where memory observer stores data | 
| static String | METRICS_DIRMetrics sub directory | 
| static String | PARTITION_EXCHANGE_DIRHelps coordinate the partition exchnages | 
| protected String | savedCheckpointBasePathOld checkpoint in case we want to restart some job | 
| static String | SUPERSTEP_DIRSuperstep scope | 
| static String | SUPERSTEP_FINISHED_NODEDenotes that the superstep is done | 
| static long | UNSET_APPLICATION_ATTEMPTUnset application attempt | 
| static long | UNSET_SUPERSTEPUnset superstep | 
| static String | WORKER_FINISHED_DIRFinished workers notify here | 
| static String | WORKER_HEALTHY_DIRHealthy workers register here. | 
| static String | WORKER_SUFFIXSuffix denotes a worker | 
| static String | WORKER_UNHEALTHY_DIRUnhealthy workers register here. | 
| static String | WORKER_WROTE_CHECKPOINT_DIRWorkers which wrote checkpoint notify here | 
| Constructor and Description | 
|---|
| BspService(org.apache.hadoop.mapreduce.Mapper.Context context,
          GraphTaskManager<I,V,E> graphTaskManager)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| long | getApplicationAttempt()Get the latest application attempt and cache it. | 
| BspEvent | getApplicationAttemptChangedEvent() | 
| String | getCheckpointBasePath(long superstep)Generate the base superstep directory path for a given application
 attempt | 
| BspEvent | getCleanedUpChildrenChangedEvent() | 
| ImmutableClassesGiraphConfiguration<I,V,E> | getConfiguration()Get configuration | 
| org.apache.hadoop.mapreduce.Mapper.Context | getContext() | 
| org.apache.hadoop.fs.FileSystem | getFs()Get the file system | 
| protected GraphPartitionerFactory<I,V,E> | getGraphPartitionerFactory()Subclasses can use this to instantiate their respective partitioners | 
| GraphTaskManager<I,V,E> | getGraphTaskManager() | 
| static String | getHealthyHostnameIdFromPath(String path)Get the hostname and id from a "healthy" worker path | 
| String | getHostname() | 
| String | getHostnameTaskId() | 
| BspEvent | getInputSplitsAllDoneEvent() | 
| BspEvent | getInputSplitsWorkerDoneEvent() | 
| String | getJobId()Get the job id | 
| JobProgressTracker | getJobProgressTracker()Get JobProgressTracker to report progress to | 
| org.json.JSONObject | getJobState()Get the master commanded job state as a JSONObject. | 
| protected long | getLastCheckpointedSuperstep()Get the last saved superstep. | 
| BspEvent | getMasterElectionChildrenChangedEvent() | 
| String | getPartitionExchangePath(long attempt,
                        long superstep)Generate the "partition exchange" directory path for a superstep | 
| String | getPartitionExchangeWorkerPath(long attempt,
                              long superstep,
                              WorkerInfo workerInfo)Based on the superstep, worker info, and attempt, get the appropriate
 worker path for the exchange. | 
| long | getRestartedSuperstep()Get the restarted superstep | 
| String | getSavedCheckpointBasePath(long superstep)In case when we restart another job this will give us a path
 to saved checkpoint. | 
| long | getSuperstep()Get the latest superstep and cache it. | 
| BspEvent | getSuperstepFinishedEvent() | 
| String | getSuperstepFinishedPath(long attempt,
                        long superstep)Generate the "superstep finished" directory path for a superstep | 
| static long | getSuperstepFromPath(String path)Get the superstep from a ZooKeeper path | 
| String | getSuperstepPath(long attempt)Generate the base superstep directory path for a given application
 attempt | 
| int | getTaskId() | 
| String | getWorkerCountersFinishedPath(long attempt,
                             long superstep)Generate the worker "finished" directory path for a
 superstep, for storing the superstep-related counters | 
| BspEvent | getWorkerHealthRegistrationChangedEvent() | 
| protected int | getWorkerId(WorkerInfo workerInfo)For every worker this method returns unique number
 between 0 and N, where N is the total number of workers. | 
| protected WorkerInfo | getWorkerInfoById(int id)Returns worker info corresponding to specified worker id. | 
| String | getWorkerInfoHealthyPath(long attempt,
                        long superstep)Generate the worker information "healthy" directory path for a
 superstep | 
| String | getWorkerInfoUnhealthyPath(long attempt,
                          long superstep)Generate the worker information "unhealthy" directory path for a
 superstep | 
| String | getWorkerMetricsFinishedPath(long attempt,
                            long superstep)Generate the worker "finished" directory path for a
 superstep, for storing the superstep-related metrics | 
| String | getWorkerWroteCheckpointPath(long attempt,
                            long superstep)Generate the worker "wrote checkpoint" directory path for a
 superstep | 
| BspEvent | getWrittenCountersToZKEvent() | 
| ZooKeeperExt | getZkExt()Get the ZooKeeperExt instance. | 
| void | incrCachedSuperstep()Increment the cached superstep. | 
| void | process(org.apache.zookeeper.WatchedEvent event) | 
| protected boolean | processEvent(org.apache.zookeeper.WatchedEvent event)Derived classes that want additional ZooKeeper events to take action
 should override this. | 
| void | registerBspEvent(BspEvent event)Register a BspEvent. | 
| void | setApplicationAttempt(long applicationAttempt)Set the cached application attempt (should only be used for restart from
 failure by the master) | 
| void | setCachedSuperstep(long superstep)Set the cached superstep (should only be used for loading checkpoints
 or recovering from failure). | 
| void | setRestartedSuperstep(long superstep)Set the restarted superstep | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMasterInfo, getWorkerInfoListpublic static final long UNSET_SUPERSTEP
public static final long INPUT_SUPERSTEP
public static final long UNSET_APPLICATION_ATTEMPT
public static final String BASE_DIR
public static final String MASTER_JOB_STATE_NODE
public static final String INPUT_SPLITS_WORKER_DONE_DIR
public static final String INPUT_SPLITS_ALL_DONE_NODE
public static final String KRYO_REGISTERED_CLASS_DIR
public static final String APPLICATION_ATTEMPTS_DIR
public static final String MASTER_ELECTION_DIR
public static final String SUPERSTEP_DIR
public static final String COUNTERS_DIR
public static final String METRICS_DIR
public static final String WORKER_HEALTHY_DIR
public static final String WORKER_UNHEALTHY_DIR
public static final String WORKER_WROTE_CHECKPOINT_DIR
public static final String WORKER_FINISHED_DIR
public static final String PARTITION_EXCHANGE_DIR
public static final String SUPERSTEP_FINISHED_NODE
public static final String HALT_COMPUTATION_NODE
public static final String MEMORY_OBSERVER_DIR
public static final String FORCE_CHECKPOINT_USER_FLAG
public static final String CLEANED_UP_DIR
public static final String JSONOBJ_NUM_MESSAGES_KEY
public static final String JSONOBJ_NUM_MESSAGE_BYTES_KEY
public static final String JSONOBJ_METRICS_KEY
public static final String JSONOBJ_STATE_KEY
public static final String JSONOBJ_APPLICATION_ATTEMPT_KEY
public static final String JSONOBJ_SUPERSTEP_KEY
public static final String WORKER_SUFFIX
public static final String MASTER_SUFFIX
protected final String basePath
protected final String masterJobStatePath
protected final String inputSplitsWorkerDonePath
protected final String inputSplitsAllDonePath
protected final String applicationAttemptsPath
protected final String cleanedUpPath
protected final String checkpointBasePath
protected final String savedCheckpointBasePath
protected final String masterElectionPath
protected final String haltComputationPath
protected final String memoryObserverPath
protected final String kryoRegisteredClassPath
public BspService(org.apache.hadoop.mapreduce.Mapper.Context context,
                  GraphTaskManager<I,V,E> graphTaskManager)
context - Mapper contextgraphTaskManager - GraphTaskManager for this compute nodepublic static long getSuperstepFromPath(String path)
path - Path to parse for the supersteppublic static String getHealthyHostnameIdFromPath(String path)
path - Path to checkpublic final String getSuperstepPath(long attempt)
attempt - application attempt numberpublic final String getWorkerInfoHealthyPath(long attempt, long superstep)
attempt - application attempt numbersuperstep - superstep to usepublic final String getWorkerInfoUnhealthyPath(long attempt, long superstep)
attempt - application attempt numbersuperstep - superstep to usepublic final String getWorkerWroteCheckpointPath(long attempt, long superstep)
attempt - application attempt numbersuperstep - superstep to usepublic final String getWorkerMetricsFinishedPath(long attempt, long superstep)
attempt - application attempt numbersuperstep - superstep to usepublic final String getWorkerCountersFinishedPath(long attempt, long superstep)
attempt - application attempt numbersuperstep - superstep to usepublic final String getPartitionExchangePath(long attempt, long superstep)
attempt - application attempt numbersuperstep - superstep to usepublic final String getPartitionExchangeWorkerPath(long attempt, long superstep, WorkerInfo workerInfo)
attempt - Application attemptsuperstep - SuperstepworkerInfo - Worker info of the exchange.public final String getSuperstepFinishedPath(long attempt, long superstep)
attempt - application attempt numbersuperstep - superstep to usepublic final String getCheckpointBasePath(long superstep)
superstep - Superstep to usepublic final String getSavedCheckpointBasePath(long superstep)
superstep - superstep to usepublic final ZooKeeperExt getZkExt()
public final long getRestartedSuperstep()
CentralizedServicegetRestartedSuperstep in interface CentralizedService<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>public final void setRestartedSuperstep(long superstep)
superstep - Set the manually restarted supersteppublic final org.apache.hadoop.fs.FileSystem getFs()
public final ImmutableClassesGiraphConfiguration<I,V,E> getConfiguration()
CentralizedServicegetConfiguration in interface CentralizedService<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>public final org.apache.hadoop.mapreduce.Mapper.Context getContext()
public final String getHostname()
public final String getHostnameTaskId()
public final int getTaskId()
public final GraphTaskManager<I,V,E> getGraphTaskManager()
public final BspEvent getWorkerHealthRegistrationChangedEvent()
public final BspEvent getApplicationAttemptChangedEvent()
public final BspEvent getInputSplitsWorkerDoneEvent()
public final BspEvent getInputSplitsAllDoneEvent()
public final BspEvent getSuperstepFinishedEvent()
public final BspEvent getMasterElectionChildrenChangedEvent()
public final BspEvent getCleanedUpChildrenChangedEvent()
public final BspEvent getWrittenCountersToZKEvent()
public final org.json.JSONObject getJobState()
public final String getJobId()
public final long getApplicationAttempt()
public final long getSuperstep()
getSuperstep in interface CentralizedService<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>public final void incrCachedSuperstep()
public final void setCachedSuperstep(long superstep)
superstep - will be used as the next superstep iterationpublic final void setApplicationAttempt(long applicationAttempt)
applicationAttempt - Will denote the new application attemptpublic void registerBspEvent(BspEvent event)
event - Event to be registered.protected GraphPartitionerFactory<I,V,E> getGraphPartitionerFactory()
protected boolean processEvent(org.apache.zookeeper.WatchedEvent event)
event - Event that occurredpublic final void process(org.apache.zookeeper.WatchedEvent event)
process in interface org.apache.zookeeper.Watcherprotected long getLastCheckpointedSuperstep()
                                     throws IOException
IOExceptionpublic JobProgressTracker getJobProgressTracker()
CentralizedServicegetJobProgressTracker in interface CentralizedService<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable>protected int getWorkerId(WorkerInfo workerInfo)
workerInfo - worker info objectprotected WorkerInfo getWorkerInfoById(int id)
id - unique worker idCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.