use of com.tencent.angel.ps.impl.matrix.ServerPartition in project angel by Tencent.
the class PeriodPusher method recover.
@Override
public FutureResult<Response> recover(RecoverPartKey partKey) {
FutureResult<Response> result = new FutureResult<>();
workerPool.execute(() -> {
ServerPartition part = context.getMatrixStorageManager().getPart(partKey.partKey);
if (part == null) {
result.set(new Response(ResponseType.UNKNOWN_ERROR, "Can not find partition " + partKey.partKey.getMatrixId() + ":" + partKey.partKey.getPartitionId()));
return;
}
try {
result.set(psClient.recoverPart(partKey.psLoc.psId, partKey.psLoc.loc, part).get());
} catch (Throwable e) {
LOG.error("recover part " + partKey + " falied ", e);
result.set(new Response(ResponseType.UNKNOWN_ERROR, e.getMessage()));
}
});
return result;
}
use of com.tencent.angel.ps.impl.matrix.ServerPartition in project angel by Tencent.
the class MatrixCache method update.
/**
* Update a row split in the cache
*
* @param partKey partition key
* @param rowSplit row split
*/
public void update(PartitionKey partKey, ServerRow rowSplit) {
ServerPartition partCache = partitionCacheMap.get(partKey);
if (partCache == null) {
partitionCacheMap.putIfAbsent(partKey, new ServerPartition(partKey, PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId).getRowType()));
partCache = partitionCacheMap.get(partKey);
}
partCache.update(rowSplit);
}
use of com.tencent.angel.ps.impl.matrix.ServerPartition in project angel by Tencent.
the class MatrixCache method update.
/**
* Update a batch row splits in the cache
*
* @param partKey partition key
* @param rowsSplit a batch row splits
*/
public void update(PartitionKey partKey, List<ServerRow> rowsSplit) {
ServerPartition partCache = partitionCacheMap.get(partKey);
if (partCache == null) {
partitionCacheMap.putIfAbsent(partKey, new ServerPartition(partKey, PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId).getRowType()));
partCache = partitionCacheMap.get(partKey);
}
partCache.update(rowsSplit);
}
Aggregations