public class PathData extends Object implements Writable
| Constructor and Description |
|---|
PathData()
The Default Constructor for PathData:
Sets Distance to the Max long value.
Sets source to -1.
Sets from to -1.
Sets dependency to -1.
Sets numPaths to -1.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getDependency()
Gets the dependency value.
|
static PathData |
getDependencyMessage(String source,
double dependency,
long numPaths)
Get a new PathData message for accumulating pair dependency values
|
long |
getDistance()
Gets the distance from source to a predecessor.
|
String |
getFrom()
Gets the predecessor/successor value.
|
long |
getNumPaths()
Gets the number of shortest paths.
|
static PathData |
getPingMessage(String source)
Get a new PathData message for sending successor / predecessor information to neighbors
|
static PathData |
getShortestPathMessage(String source,
String from,
long distance,
long numPaths)
Get a new PathData message for shortest path computation.
|
String |
getSource()
Gets the source value.
|
void |
readFields(DataInput in) |
void |
setDependency(double dependency)
Sets the dependency value.
|
void |
setDistance(long distance)
Sets the distance from a source to a predecessor.
|
void |
setFrom(String from)
Sets the value of from.
|
void |
setNumPaths(long numPaths)
Set the number of paths.
|
void |
setSource(String source)
Sets the source value.
|
void |
write(DataOutput out) |
public PathData()
public static PathData getShortestPathMessage(String source, String from, long distance, long numPaths)
source - The source Idfrom - The predecessor Id.distance - The distance from the source to the predecessor.numPaths - The number of paths from source to the predecessor.public static PathData getPingMessage(String source)
source - The source that the ping came from.public static PathData getDependencyMessage(String source, double dependency, long numPaths)
source - The source that the ping came from.dependency - The pair dependency value.numPaths - The number of shortest paths.public void write(DataOutput out) throws IOException
write in interface WritableIOExceptionpublic void readFields(DataInput in) throws IOException
readFields in interface WritableIOExceptionpublic long getDistance()
public void setDistance(long distance)
distance - Distance value to set it to.public String getSource()
public void setSource(String source)
source - The value to set the source to.public String getFrom()
public void setFrom(String from)
from - The value to set from to.public double getDependency()
public void setDependency(double dependency)
dependency - The value to set dependency to.public long getNumPaths()
public void setNumPaths(long numPaths)
numPaths - The value to set numPaths to.