Search in sources :

Example 11 with VoidResult

use of com.tencent.angel.ml.matrix.psf.update.base.VoidResult in project angel by Tencent.

the class MatrixClientImpl method asyncUpdate.

@Override
public Future<VoidResult> asyncUpdate(int[] rowIds, Vector[] rows) throws AngelException {
    checkNotNull(rowIds, "rowIds");
    checkNotNull(rows, "rows");
    assert rowIds.length == rows.length;
    // Just return
    if (rowIds.length == 0) {
        LOG.warn("parameter rowIds is empty, you should check it, just return now!!!");
        FutureResult<VoidResult> result = new FutureResult<>();
        result.set(new VoidResult(ResponseType.SUCCESS));
        return result;
    }
    try {
        return PSAgentContext.get().getUserRequestAdapter().update(matrixId, rowIds, rows, UpdateOp.REPLACE);
    } catch (Throwable e) {
        throw new AngelException(e);
    }
}
Also used : AngelException(com.tencent.angel.exception.AngelException) VoidResult(com.tencent.angel.ml.matrix.psf.update.base.VoidResult) FutureResult(com.tencent.angel.psagent.matrix.transport.FutureResult)

Example 12 with VoidResult

use of com.tencent.angel.ml.matrix.psf.update.base.VoidResult in project angel by Tencent.

the class MatrixClientImpl method asyncIncrement.

@Override
public Future<VoidResult> asyncIncrement(int[] rowIds, Vector[] rows) throws AngelException {
    checkNotNull(rowIds, "rowIds");
    checkNotNull(rows, "rows");
    assert rowIds.length == rows.length;
    // Just return
    if (rowIds.length == 0) {
        LOG.warn("parameter rowIds is empty, you should check it, just return now!!!");
        FutureResult result = new FutureResult<VoidResult>();
        result.set(new VoidResult(ResponseType.SUCCESS));
        return result;
    }
    return PSAgentContext.get().getUserRequestAdapter().update(matrixId, rowIds, rows, UpdateOp.PLUS);
}
Also used : FutureResult(com.tencent.angel.psagent.matrix.transport.FutureResult) VoidResult(com.tencent.angel.ml.matrix.psf.update.base.VoidResult)

Example 13 with VoidResult

use of com.tencent.angel.ml.matrix.psf.update.base.VoidResult in project angel by Tencent.

the class MatrixClientImpl method flush.

@Deprecated
@Override
public Future<VoidResult> flush() throws AngelException {
    FutureResult<VoidResult> result = new FutureResult<>();
    result.set(new VoidResult(ResponseType.SUCCESS));
    return result;
// return PSAgentContext.get().getMatrixOpLogCache().flush(taskContext, matrixId);
}
Also used : VoidResult(com.tencent.angel.ml.matrix.psf.update.base.VoidResult) FutureResult(com.tencent.angel.psagent.matrix.transport.FutureResult)

Example 14 with VoidResult

use of com.tencent.angel.ml.matrix.psf.update.base.VoidResult in project angel by Tencent.

the class MatrixClientImpl method clock.

@Deprecated
@Override
public Future<VoidResult> clock(boolean flushFirst) throws AngelException {
    FutureResult<VoidResult> result = new FutureResult<>();
    result.set(new VoidResult(ResponseType.SUCCESS));
    return result;
// return PSAgentContext.get().getConsistencyController().clock(taskContext, matrixId, flushFirst);
}
Also used : VoidResult(com.tencent.angel.ml.matrix.psf.update.base.VoidResult) FutureResult(com.tencent.angel.psagent.matrix.transport.FutureResult)

Aggregations

VoidResult (com.tencent.angel.ml.matrix.psf.update.base.VoidResult)14 FutureResult (com.tencent.angel.psagent.matrix.transport.FutureResult)8 MatrixTransportClient (com.tencent.angel.psagent.matrix.transport.MatrixTransportClient)4 MapResponseCache (com.tencent.angel.psagent.matrix.transport.response.MapResponseCache)4 ResponseCache (com.tencent.angel.psagent.matrix.transport.response.ResponseCache)4 PartitionKey (com.tencent.angel.PartitionKey)3 CSRPartUpdateParam (com.tencent.angel.ml.lda.psf.CSRPartUpdateParam)3 UpdatePartFunc (com.tencent.angel.ml.lda.psf.UpdatePartFunc)3 MatrixMeta (com.tencent.angel.ml.matrix.MatrixMeta)3 CompStreamKeyValuePart (com.tencent.angel.psagent.matrix.transport.router.CompStreamKeyValuePart)3 Int2IntOpenHashMap (it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap)3 AngelException (com.tencent.angel.exception.AngelException)2 Request (com.tencent.angel.ps.server.data.request.Request)2 Response (com.tencent.angel.ps.server.data.response.Response)2 UserRequest (com.tencent.angel.psagent.matrix.transport.adapter.UserRequest)2 Random (java.util.Random)2 PartitionUpdateParam (com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam)1 UpdateParam (com.tencent.angel.ml.matrix.psf.update.base.UpdateParam)1 GetUDFRequest (com.tencent.angel.ps.server.data.request.GetUDFRequest)1 RequestHeader (com.tencent.angel.ps.server.data.request.RequestHeader)1