@Override public A23 process(A23 item) throws Exception { ExecutionContext stepContext = stepExecution.getExecutionContext(); long processCount = stepContext.getLong("PROCESS_COUNT", 0); processCount++; stepContext.putLong("PROCESS_COUNT", processCount); if (processCount % writeSampleFrequency == 1) { item.setSample(true); } return item; }
@Override public Map<String, ExecutionContext> partition(int gridSize) { Map<String, ExecutionContext> partitions = new HashMap<String, ExecutionContext>(gridSize); long count = repository.count(); long recordCount = count / gridSize; // do the split for (int i = 0; i < gridSize; i++) { ExecutionContext context = new ExecutionContext(); context.putLong("paramB", count); count = count - recordCount; if (count != 1) { context.putLong("paramA", count + 1); } else { context.putLong("paramA", count); } // end if partitions.put(PREFIX + i, context); } // end for // return return partitions; }
public void update(ExecutionContext executionContext) throws ItemStreamException { executionContext.putLong(EXPECTED, localState.expected); executionContext.putLong(ACTUAL, localState.actual); }
public void update(ExecutionContext executionContext) throws ItemStreamException { executionContext.putLong("POSITION", index); }