Search in sources :

Example 1 with UpdateUDFResponse

use of com.tencent.angel.ps.server.data.response.UpdateUDFResponse in project angel by Tencent.

the class PSFUpdateHandler method handle.

@Override
public ResponseData handle(RequestHeader header, RequestData data) throws Exception {
    UpdateUDFRequest request = (UpdateUDFRequest) data;
    Class<? extends UpdateFunc> funcClass = (Class<? extends UpdateFunc>) Class.forName(request.getUpdaterFuncClass());
    Constructor<? extends UpdateFunc> constructor = funcClass.getConstructor();
    constructor.setAccessible(true);
    UpdateFunc func = constructor.newInstance();
    func.setPsContext(context);
    func.partitionUpdate(request.getPartParam());
    return new UpdateUDFResponse();
}
Also used : UpdateFunc(com.tencent.angel.ml.matrix.psf.update.base.UpdateFunc) UpdateUDFRequest(com.tencent.angel.ps.server.data.request.UpdateUDFRequest) UpdateUDFResponse(com.tencent.angel.ps.server.data.response.UpdateUDFResponse)

Example 2 with UpdateUDFResponse

use of com.tencent.angel.ps.server.data.response.UpdateUDFResponse in project angel by Tencent.

the class UpdateUDFHandler method parseResponse.

@Override
public ResponseData parseResponse(ByteBuf in) {
    UpdateUDFResponse response = new UpdateUDFResponse();
    response.deserialize(in);
    return response;
}
Also used : UpdateUDFResponse(com.tencent.angel.ps.server.data.response.UpdateUDFResponse)

Aggregations

UpdateUDFResponse (com.tencent.angel.ps.server.data.response.UpdateUDFResponse)2 UpdateFunc (com.tencent.angel.ml.matrix.psf.update.base.UpdateFunc)1 UpdateUDFRequest (com.tencent.angel.ps.server.data.request.UpdateUDFRequest)1