logger.info("Processing shovel " + shardNum);
/**
* Read the edges into memory.
*/
BufferedDataInputStream in = new BufferedDataInputStream(new FileInputStream(shovelFile));
for(int i=0; i<shoveled.length; i++) {
long l = in.readLong();
int from = getFirst(l);
int to = getSecond(l);
in.readFully(valueTemplate);
int newFrom = finalIdTranslate.forward(preIdTranslate.backward(from));
int newTo = finalIdTranslate.forward(preIdTranslate.backward(to));
shoveled[i] = packEdges(newFrom, newTo);
/* Edge value */
int valueIdx = i * sizeOf;
System.arraycopy(valueTemplate, 0, edgeValues, valueIdx, sizeOf);
if (!memoryEfficientDegreeCount) {
inDegrees[newTo]++;
outDegrees[newFrom]++;
}
}
numEdges += shoveled.length;
in.close();
/* Delete the shovel-file */
shovelFile.delete();
logger.info("Processing shovel " + shardNum + " ... sorting");