use of com.tencent.angel.ml.matrix.psf.get.indexed.IndexPartGetLongResult in project angel by Tencent.
the class GetNodes method merge.
@Override
public GetResult merge(List<PartitionGetResult> partResults) {
int size = 0;
for (PartitionGetResult result : partResults) {
if (result instanceof IndexPartGetLongResult) {
size += ((IndexPartGetLongResult) result).getValues().length;
}
}
long[] values = new long[size];
int start = 0;
for (PartitionGetResult result : partResults) {
if (result instanceof IndexPartGetLongResult) {
long[] vals = ((IndexPartGetLongResult) result).getValues();
System.arraycopy(vals, 0, values, start, vals.length);
start += vals.length;
}
}
return new GetRowResult(ResponseType.SUCCESS, VFactory.denseLongVector(values));
}
Aggregations