public class BasicPartitionOwner extends Object implements PartitionOwner, ImmutableClassesGiraphConfigurable
Constructor and Description |
---|
BasicPartitionOwner()
Default constructor.
|
BasicPartitionOwner(int partitionId,
WorkerInfo workerInfo)
Constructor with partition id and worker info.
|
BasicPartitionOwner(int partitionId,
WorkerInfo workerInfo,
WorkerInfo previousWorkerInfo,
String checkpointFilesPrefix)
Constructor with partition id and worker info.
|
Modifier and Type | Method and Description |
---|---|
ImmutableClassesGiraphConfiguration |
getConf()
Return the configuration used by this object.
|
int |
getPartitionId()
Get the partition id that maps to the relevant
Partition object |
WorkerInfo |
getPreviousWorkerInfo()
Get the worker information that was previously responsible for the
partition id.
|
WorkerInfo |
getWorkerInfo()
Get the worker information that is currently responsible for
the partition id.
|
void |
readFields(DataInput input) |
void |
readFieldsWithWorkerIds(DataInput input,
Map<Integer,WorkerInfo> workerInfoMap)
A match for writeWithWorkerIds method - for WorkerInfos it will read
just task ids from input and then find the matching WorkerInfo in the
provided map and set it
|
void |
setConf(ImmutableClassesGiraphConfiguration conf)
Set the configuration to be used by this object.
|
void |
setPreviousWorkerInfo(WorkerInfo workerInfo)
Set the previous worker info.
|
void |
setWorkerInfo(WorkerInfo workerInfo)
Set the current worker info.
|
String |
toString() |
void |
write(DataOutput output) |
void |
writeWithWorkerIds(DataOutput output)
Write to the output, but don't serialize the whole WorkerInfo,
instead use just the task id
|
public BasicPartitionOwner()
public BasicPartitionOwner(int partitionId, WorkerInfo workerInfo)
partitionId
- Partition id of this partition.workerInfo
- Owner of the partition.public BasicPartitionOwner(int partitionId, WorkerInfo workerInfo, WorkerInfo previousWorkerInfo, String checkpointFilesPrefix)
partitionId
- Partition id of this partition.workerInfo
- Owner of the partition.previousWorkerInfo
- Previous owner of this partition.checkpointFilesPrefix
- Prefix of the checkpoint files.public int getPartitionId()
PartitionOwner
Partition
objectgetPartitionId
in interface PartitionOwner
public WorkerInfo getWorkerInfo()
PartitionOwner
getWorkerInfo
in interface PartitionOwner
public void setWorkerInfo(WorkerInfo workerInfo)
PartitionOwner
setWorkerInfo
in interface PartitionOwner
workerInfo
- Worker info responsible for partitionpublic WorkerInfo getPreviousWorkerInfo()
PartitionOwner
getPreviousWorkerInfo
in interface PartitionOwner
public void setPreviousWorkerInfo(WorkerInfo workerInfo)
PartitionOwner
setPreviousWorkerInfo
in interface PartitionOwner
workerInfo
- Worker info that was previously responsible for the
partition.public void writeWithWorkerIds(DataOutput output) throws IOException
PartitionOwner
writeWithWorkerIds
in interface PartitionOwner
output
- Output to write toIOException
public void readFieldsWithWorkerIds(DataInput input, Map<Integer,WorkerInfo> workerInfoMap) throws IOException
PartitionOwner
readFieldsWithWorkerIds
in interface PartitionOwner
input
- Input to read fromworkerInfoMap
- Map from task id to WorkerInfoIOException
public void readFields(DataInput input) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput output) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public ImmutableClassesGiraphConfiguration getConf()
ImmutableClassesGiraphConfigurable
getConf
in interface ImmutableClassesGiraphConfigurable
public void setConf(ImmutableClassesGiraphConfiguration conf)
GiraphConfigurationSettable
setConf
in interface GiraphConfigurationSettable
conf
- Set configurationCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.