@Override
public void initialize(InputSplit inputSplit,
TaskAttemptContext context) throws IOException {
int aggregateVertices = getConf().getInt(
PseudoRandomInputFormatConstants.AGGREGATE_VERTICES, 0);
BspInputSplit bspInputSplit = (BspInputSplit) inputSplit;
int extraVertices = aggregateVertices % bspInputSplit.getNumSplits();
totalSplitVertices = aggregateVertices / bspInputSplit.getNumSplits();
if (bspInputSplit.getSplitIndex() < extraVertices) {
++totalSplitVertices;
}
startingVertexId = bspInputSplit.getSplitIndex() *
(aggregateVertices / bspInputSplit.getNumSplits()) +
Math.min(bspInputSplit.getSplitIndex(), extraVertices);
edgesPerVertex = getConf().getInt(
PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, 0);
rand = new Random(bspInputSplit.getSplitIndex());
if (getConf().reuseEdgeObjects()) {
reusableEdge = getConf().createReusableEdge();
}
localEdgesHelper = new PseudoRandomIntNullLocalEdgesHelper(
aggregateVertices, getConf());