Search in sources :

Example 1 with JobVertexAccumulatorsInfo

use of org.apache.flink.runtime.rest.messages.JobVertexAccumulatorsInfo in project flink by apache.

the class JobVertexAccumulatorsHandler method handleRequest.

@Override
protected JobVertexAccumulatorsInfo handleRequest(HandlerRequest<EmptyRequestBody> request, AccessExecutionJobVertex jobVertex) throws RestHandlerException {
    StringifiedAccumulatorResult[] accs = jobVertex.getAggregatedUserAccumulatorsStringified();
    ArrayList<UserAccumulator> userAccumulatorList = new ArrayList<>(accs.length);
    for (StringifiedAccumulatorResult acc : accs) {
        userAccumulatorList.add(new UserAccumulator(acc.getName(), acc.getType(), acc.getValue()));
    }
    return new JobVertexAccumulatorsInfo(jobVertex.getJobVertexId().toString(), userAccumulatorList);
}
Also used : UserAccumulator(org.apache.flink.runtime.rest.messages.job.UserAccumulator) StringifiedAccumulatorResult(org.apache.flink.runtime.accumulators.StringifiedAccumulatorResult) ArrayList(java.util.ArrayList) JobVertexAccumulatorsInfo(org.apache.flink.runtime.rest.messages.JobVertexAccumulatorsInfo)

Aggregations

ArrayList (java.util.ArrayList)1 StringifiedAccumulatorResult (org.apache.flink.runtime.accumulators.StringifiedAccumulatorResult)1 JobVertexAccumulatorsInfo (org.apache.flink.runtime.rest.messages.JobVertexAccumulatorsInfo)1 UserAccumulator (org.apache.flink.runtime.rest.messages.job.UserAccumulator)1