class JobVertexAccumulatorsHandler extends AbstractJobVertexRequestHandler {

	public static String createVertexAccumulatorsJson(AccessExecutionJobVertex jobVertex) throws IOException {
		StringWriter writer = new StringWriter();
		JsonGenerator gen = JsonFactory.JACKSON_FACTORY.createGenerator(writer);

		StringifiedAccumulatorResult[] accs = jobVertex.getAggregatedUserAccumulatorsStringified();

		gen.writeStartObject();
		gen.writeStringField("id", jobVertex.getJobVertexId().toString());

		gen.writeArrayFieldStart("user-accumulators");
		for (StringifiedAccumulatorResult acc : accs) {
			gen.writeStartObject();
			gen.writeStringField("name", acc.getName());
			gen.writeStringField("type", acc.getType());
			gen.writeStringField("value", acc.getValue());
			gen.writeEndObject();
		}
		gen.writeEndArray();

		gen.writeEndObject();

		gen.close();
		return writer.toString();
	}

	public  JobVertexAccumulatorsHandler(ExecutionGraphCache executionGraphHolder, Executor executor);

}