List of usage examples for org.springframework.batch.core.partition StepExecutionSplitter split
Set<StepExecution> split(StepExecution stepExecution, int gridSize) throws JobExecutionException;
From source file:org.springframework.cloud.task.batch.partition.DeployerPartitionHandler.java
@Override public Collection<StepExecution> handle(StepExecutionSplitter stepSplitter, StepExecution stepExecution) throws Exception { final Set<StepExecution> tempCandidates = stepSplitter.split(stepExecution, this.gridSize); // Following two lines due to https://jira.spring.io/browse/BATCH-2490 final Set<StepExecution> candidates = new HashSet<>(tempCandidates.size()); candidates.addAll(tempCandidates);//from w w w. j a va 2s . c o m int partitions = candidates.size(); logger.debug(String.format("%s partitions were returned", partitions)); final Set<StepExecution> executed = new HashSet<>(candidates.size()); if (CollectionUtils.isEmpty(candidates)) { return null; } launchWorkers(candidates, executed); candidates.removeAll(executed); return pollReplies(stepExecution, executed, candidates, partitions); }
From source file:org.springframework.yarn.batch.partition.HdfsSplitBatchPartitionHandler.java
@Override protected Set<StepExecution> createStepExecutionSplits(StepExecutionSplitter stepSplitter, StepExecution stepExecution) throws Exception { String input = stepExecution.getJobParameters().getString("input"); log.info("Input is " + input); FileSystem fs = FileSystem.get(configuration); Path path = new Path(input); FileStatus[] fileStatuses = fs.globStatus(path); Set<StepExecution> split = stepSplitter.split(stepExecution, fileStatuses.length); return split; }
From source file:org.springframework.yarn.batch.partition.StaticBatchPartitionHandler.java
@Override protected Set<StepExecution> createStepExecutionSplits(StepExecutionSplitter stepSplitter, StepExecution stepExecution) throws Exception { if (log.isDebugEnabled()) { log.debug("Creating splits for stepExecution=" + stepExecution + " with gridSize=" + gridSize); }/*from w w w . j av a 2 s . c o m*/ return stepSplitter.split(stepExecution, gridSize); }
From source file:org.springframework.yarn.batch.partition.StaticPartitionHandler.java
@Override protected Set<StepExecution> createSplits(StepExecutionSplitter stepSplitter, StepExecution stepExecution) throws Exception { log.info("Creating splits for stepExecution=[" + stepExecution + "] with gridSize=" + gridSize); return stepSplitter.split(stepExecution, gridSize); }