I
- Vertex idV
- Vertex valueE
- Edge valuepublic interface CentralizedServiceWorker<I extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,E extends org.apache.hadoop.io.Writable> extends CentralizedService<I,V,E>, PartitionSplitInfo<I>
Modifier and Type | Method and Description |
---|---|
void |
addressesAndPartitionsReceived(AddressesAndPartitionsWritable addressesAndPartitions)
Received addresses and partitions assignments from master.
|
void |
cleanup(FinishedSuperstepStats finishedSuperstepStats)
Clean up the service (no calls may be issued after this)
|
void |
closeZooKeeper()
Close zookeeper
|
void |
exchangeVertexPartitions(Collection<? extends PartitionOwner> masterSetPartitionOwners)
If desired by the user, vertex partitions are redistributed among
workers according to the chosen WorkerGraphPartitioner.
|
void |
failureCleanup()
Operations that will be called if there is a failure by a worker.
|
FinishedSuperstepStats |
finishSuperstep(List<PartitionStats> partitionStatsList,
GiraphTimerContext superstepTimerContext)
Worker is done with its portion of the superstep.
|
WorkerAggregatorHandler |
getAggregatorHandler()
Get worker aggregator handler
|
GlobalStats |
getGlobalStats()
Loads Global stats from zookeeper.
|
GraphTaskManager<I,V,E> |
getGraphTaskManager()
Get the GraphTaskManager that this service is using.
|
WorkerInputSplitsHandler |
getInputSplitsHandler()
Get input splits handler used during input
|
int |
getPartitionId(I vertexId)
Get the partition id that a vertex id would belong to.
|
Iterable<? extends PartitionOwner> |
getPartitionOwners()
Get all partition owners.
|
PartitionStore<I,V,E> |
getPartitionStore()
Get the partition store for this worker.
|
ServerData<I,V,E> |
getServerData()
Get server data
|
SuperstepOutput<I,V,E> |
getSuperstepOutput()
Get the superstep output class
|
PartitionOwner |
getVertexPartitionOwner(I vertexId)
Every client will need to get a partition owner from a vertex id so that
they know which worker to sent the request to.
|
WorkerClient<I,V,E> |
getWorkerClient()
Get the worker client (for instantiating WorkerClientRequestProcessor
instances.
|
WorkerContext |
getWorkerContext()
Get the worker context.
|
WorkerInfo |
getWorkerInfo()
Get the worker information
|
WorkerObserver[] |
getWorkerObservers()
Get the observers for this Worker.
|
boolean |
hasPartition(Integer partitionId)
Whether a partition with given id exists on this worker.
|
VertexEdgeCount |
loadCheckpoint(long superstep)
Load the vertices, edges, messages from the beginning of a superstep.
|
void |
prepareSuperstep()
Final preparation for superstep, called after startSuperstep and
potential loading from checkpoint, right before the computation started
TODO how to avoid this additional function
|
FinishedSuperstepStats |
setup()
Setup (must be called prior to any other function)
|
Collection<? extends PartitionOwner> |
startSuperstep()
Take all steps prior to actually beginning the computation of a
superstep.
|
void |
storeCheckpoint()
Both the vertices and the messages need to be checkpointed in order
for them to be used.
|
void |
storeCountersInZooKeeper(boolean allSuperstepsDone)
Store the counter values in the zookeeper after every superstep
and also after all supersteps are done.
|
getConfiguration, getJobProgressTracker, getMasterInfo, getRestartedSuperstep, getSuperstep, getWorkerInfoList
getNextPartition, getPartitionIds, getPartitionVertexCount, putPartition, startIteration
FinishedSuperstepStats setup()
WorkerInfo getWorkerInfo()
WorkerClient<I,V,E> getWorkerClient()
WorkerContext getWorkerContext()
WorkerObserver[] getWorkerObservers()
PartitionStore<I,V,E> getPartitionStore()
void storeCheckpoint() throws IOException
IOException
VertexEdgeCount loadCheckpoint(long superstep) throws IOException
superstep
- which checkpoint to useIOException
Collection<? extends PartitionOwner> startSuperstep()
FinishedSuperstepStats finishSuperstep(List<PartitionStats> partitionStatsList, GiraphTimerContext superstepTimerContext)
partitionStatsList
- All the partition stats for this workersuperstepTimerContext
- superstep timer context only given when the
function needs to stop the timer, otherwise null.int getPartitionId(I vertexId)
getPartitionId
in interface PartitionSplitInfo<I extends org.apache.hadoop.io.WritableComparable>
vertexId
- Vertex idboolean hasPartition(Integer partitionId)
partitionId
- Partition idPartitionOwner getVertexPartitionOwner(I vertexId)
vertexId
- Vertex index to look forIterable<? extends PartitionOwner> getPartitionOwners()
void exchangeVertexPartitions(Collection<? extends PartitionOwner> masterSetPartitionOwners)
masterSetPartitionOwners
- Partition owner info passed from the
master.GraphTaskManager<I,V,E> getGraphTaskManager()
void failureCleanup()
ServerData<I,V,E> getServerData()
WorkerAggregatorHandler getAggregatorHandler()
void prepareSuperstep()
SuperstepOutput<I,V,E> getSuperstepOutput()
void cleanup(FinishedSuperstepStats finishedSuperstepStats) throws IOException, InterruptedException
finishedSuperstepStats
- Finished supestep statsIOException
InterruptedException
GlobalStats getGlobalStats()
WorkerInputSplitsHandler getInputSplitsHandler()
void addressesAndPartitionsReceived(AddressesAndPartitionsWritable addressesAndPartitions)
addressesAndPartitions
- Addresses and partitions assignmentvoid storeCountersInZooKeeper(boolean allSuperstepsDone)
allSuperstepsDone
- boolean value whether all the supersteps
are completedvoid closeZooKeeper()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.