/** * Build a step that processes items in chunks with the size provided. To extend the step to being fault tolerant, * call the {@link SimpleStepBuilder#faultTolerant()} method on the builder. In most cases you will want to * parameterize your call to this method, to preserve the type safety of your readers and writers, e.g. * * <pre> * new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) * // ... etc. * </pre> * * @param chunkSize the chunk size (commit interval) * @return a {@link SimpleStepBuilder} * @param <I> the type of item to be processed as input * @param <O> the type of item to be output */ public <I, O> SimpleStepBuilder<I, O> chunk(int chunkSize) { return new SimpleStepBuilder<I, O>(this).chunk(chunkSize); }
/** * Build a step that processes items in chunks with the completion policy provided. To extend the step to being * fault tolerant, call the {@link SimpleStepBuilder#faultTolerant()} method on the builder. In most cases you will * want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g. * * <pre> * new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) * // ... etc. * </pre> * * @param completionPolicy the completion policy to use to control chunk processing * @return a {@link SimpleStepBuilder} * @param <I> the type of item to be processed as input * @param <O> the type of item to be output * */ public <I, O> SimpleStepBuilder<I, O> chunk(CompletionPolicy completionPolicy) { return new SimpleStepBuilder<I, O>(this).chunk(completionPolicy); }
@Override protected void setChunk(SimpleStepBuilder<I, O> builder) { if(timeout != null && getCommitInterval() != null) { CompositeCompletionPolicy completionPolicy = new CompositeCompletionPolicy(); CompletionPolicy [] policies = new CompletionPolicy[2]; policies[0] = new SimpleCompletionPolicy(getCommitInterval()); policies[1] = new TimeoutTerminationPolicy(timeout * 1000); completionPolicy.setPolicies(policies); builder.chunk(completionPolicy); } else if(timeout != null) { builder.chunk(new TimeoutTerminationPolicy(timeout * 1000)); } else if(getCommitInterval() != null) { builder.chunk(getCommitInterval()); } if(getCompletionPolicy() != null) { builder.chunk(getCompletionPolicy()); } }
/** * Build a step that processes items in chunks with the completion policy provided. To extend the step to being * fault tolerant, call the {@link SimpleStepBuilder#faultTolerant()} method on the builder. In most cases you will * want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g. * * <pre> * new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) * // ... etc. * </pre> * * @param completionPolicy the completion policy to use to control chunk processing * @return a {@link SimpleStepBuilder} * @param <I> the type of item to be processed as input * @param <O> the type of item to be output * */ public <I, O> SimpleStepBuilder<I, O> chunk(CompletionPolicy completionPolicy) { return new SimpleStepBuilder<I, O>(this).chunk(completionPolicy); }
/** * Build a step that processes items in chunks with the size provided. To extend the step to being fault tolerant, * call the {@link SimpleStepBuilder#faultTolerant()} method on the builder. In most cases you will want to * parameterize your call to this method, to preserve the type safety of your readers and writers, e.g. * * <pre> * new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) * // ... etc. * </pre> * * @param chunkSize the chunk size (commit interval) * @return a {@link SimpleStepBuilder} * @param <I> the type of item to be processed as input * @param <O> the type of item to be output */ public <I, O> SimpleStepBuilder<I, O> chunk(int chunkSize) { return new SimpleStepBuilder<I, O>(this).chunk(chunkSize); }
/** * Build a step that processes items in chunks with the size provided. To extend the step to being fault tolerant, * call the {@link SimpleStepBuilder#faultTolerant()} method on the builder. In most cases you will want to * parameterize your call to this method, to preserve the type safety of your readers and writers, e.g. * * <pre> * new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) * // ... etc. * </pre> * * @param chunkSize the chunk size (commit interval) * @return a {@link SimpleStepBuilder} * @param <I> the type of item to be processed as input * @param <O> the type of item to be output */ public <I, O> SimpleStepBuilder<I, O> chunk(int chunkSize) { return new SimpleStepBuilder<I, O>(this).chunk(chunkSize); }
/** * Build a step that processes items in chunks with the completion policy provided. To extend the step to being * fault tolerant, call the {@link SimpleStepBuilder#faultTolerant()} method on the builder. In most cases you will * want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g. * * <pre> * new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) * // ... etc. * </pre> * * @param completionPolicy the completion policy to use to control chunk processing * @return a {@link SimpleStepBuilder} * @param <I> the type of item to be processed as input * @param <O> the type of item to be output * */ public <I, O> SimpleStepBuilder<I, O> chunk(CompletionPolicy completionPolicy) { return new SimpleStepBuilder<I, O>(this).chunk(completionPolicy); }
/** * Build a step that processes items in chunks with the size provided. To extend the step to being fault tolerant, * call the {@link SimpleStepBuilder#faultTolerant()} method on the builder. In most cases you will want to * parameterize your call to this method, to preserve the type safety of your readers and writers, e.g. * * <pre> * new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) * // ... etc. * </pre> * * @param chunkSize the chunk size (commit interval) * @return a {@link SimpleStepBuilder} * @param <I> the type of item to be processed as input * @param <O> the type of item to be output */ public <I, O> SimpleStepBuilder<I, O> chunk(int chunkSize) { return new SimpleStepBuilder<I, O>(this).chunk(chunkSize); }
/** * Build a step that processes items in chunks with the completion policy provided. To extend the step to being * fault tolerant, call the {@link SimpleStepBuilder#faultTolerant()} method on the builder. In most cases you will * want to parameterize your call to this method, to preserve the type safety of your readers and writers, e.g. * * <pre> * new StepBuilder("step1").<Order, Ledger> chunk(100).reader(new OrderReader()).writer(new LedgerWriter()) * // ... etc. * </pre> * * @param completionPolicy the completion policy to use to control chunk processing * @return a {@link SimpleStepBuilder} * @param <I> the type of item to be processed as input * @param <O> the type of item to be output * */ public <I, O> SimpleStepBuilder<I, O> chunk(CompletionPolicy completionPolicy) { return new SimpleStepBuilder<I, O>(this).chunk(completionPolicy); }
@Override protected void setChunk(SimpleStepBuilder<I, O> builder) { if(timeout != null && getCommitInterval() != null) { CompositeCompletionPolicy completionPolicy = new CompositeCompletionPolicy(); CompletionPolicy [] policies = new CompletionPolicy[2]; policies[0] = new SimpleCompletionPolicy(getCommitInterval()); policies[1] = new TimeoutTerminationPolicy(timeout * 1000); completionPolicy.setPolicies(policies); builder.chunk(completionPolicy); } else if(timeout != null) { builder.chunk(new TimeoutTerminationPolicy(timeout * 1000)); } else if(getCommitInterval() != null) { builder.chunk(getCommitInterval()); } if(getCompletionPolicy() != null) { builder.chunk(getCompletionPolicy()); } }
@Override protected void setChunk(SimpleStepBuilder<I, O> builder) { if(timeout != null && getCommitInterval() != null) { CompositeCompletionPolicy completionPolicy = new CompositeCompletionPolicy(); CompletionPolicy [] policies = new CompletionPolicy[2]; policies[0] = new SimpleCompletionPolicy(getCommitInterval()); policies[1] = new TimeoutTerminationPolicy(timeout * 1000); completionPolicy.setPolicies(policies); builder.chunk(completionPolicy); } else if(timeout != null) { builder.chunk(new TimeoutTerminationPolicy(timeout * 1000)); } else if(getCommitInterval() != null) { builder.chunk(getCommitInterval()); } if(getCompletionPolicy() != null) { builder.chunk(getCompletionPolicy()); } }
@Override protected void setChunk(SimpleStepBuilder<I, O> builder) { if(timeout != null && getCommitInterval() != null) { CompositeCompletionPolicy completionPolicy = new CompositeCompletionPolicy(); CompletionPolicy [] policies = new CompletionPolicy[2]; policies[0] = new SimpleCompletionPolicy(getCommitInterval()); policies[1] = new TimeoutTerminationPolicy(timeout * 1000); completionPolicy.setPolicies(policies); builder.chunk(completionPolicy); } else if(timeout != null) { builder.chunk(new TimeoutTerminationPolicy(timeout * 1000)); } else if(getCommitInterval() != null) { builder.chunk(getCommitInterval()); } if(getCompletionPolicy() != null) { builder.chunk(getCompletionPolicy()); } }