Search in sources :

Example 1 with UpdateFunc

use of com.tencent.angel.ml.matrix.psf.update.base.UpdateFunc 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)

Aggregations

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