ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
......
JobExecutionResult jobExecutionResult = env.execute(XXXOffline.class.getName());
int records = jobExecutionResult.<Integer>getAccumulatorResult("counter");
LOGGER.info("total records: {}", records);
However the log was not written to the log file(ps: other log output works well). I think env.execute() is blocking call and when all subtasks are over the getAccumulatorResult() executes. I don't know why the last line log output doesn't work.