use of com.tencent.angel.psagent.matrix.transport.router.operator.ILongKeyLongValuePartOp in project angel by Tencent.
the class SampleNeighborWithFilter method partitionGet.
@Override
public PartitionGetResult partitionGet(PartitionGetParam partParam) {
PartSampleNeighborWithFilterParam sampleParam = (PartSampleNeighborWithFilterParam) partParam;
ServerLongAnyRow row = GraphMatrixUtils.getPSLongKeyRow(psContext, partParam);
ILongKeyLongValuePartOp split = (ILongKeyLongValuePartOp) sampleParam.getIndicesToFilterPart();
long[] nodeIds = split.getKeys();
long[] filterWithNeighKeys = split.getValues();
long[] filterWithoutNeighKeys = sampleParam.getFilterWithoutNeighKeys();
SampleType sampleType = sampleParam.getSampleType();
switch(sampleType) {
case NODE:
case EDGE:
{
Tuple2<Long2ObjectOpenHashMap<long[]>, Long2ObjectOpenHashMap<int[]>> nodeId2SampleNeighbors = SampleUtils.sampleWithType(row, nodeIds, sampleType, filterWithNeighKeys, filterWithoutNeighKeys, System.currentTimeMillis());
return new PartSampleNeighborResultWithType(sampleParam.getPartKey().getPartitionId(), nodeId2SampleNeighbors._1, nodeId2SampleNeighbors._2, sampleType);
}
default:
{
throw new UnsupportedOperationException("Not support sample type " + sampleType + " now");
}
}
}
Aggregations