Tabnine Logo
Chunk$ChunkIterator.remove
Code IndexAdd Tabnine to your IDE (free)

How to use
remove
method
in
org.springframework.batch.core.step.item.Chunk$ChunkIterator

Best Java code snippets using org.springframework.batch.core.step.item.Chunk$ChunkIterator.remove (Showing top 20 results out of 315)

origin: spring-projects/spring-batch

iterator.remove();
origin: spring-projects/spring-batch

private void checkSkipPolicy(Chunk<I>.ChunkIterator inputIterator, Chunk<O>.ChunkIterator outputIterator,
    Throwable e, StepContribution contribution, boolean recovery) throws Exception {
  logger.debug("Checking skip policy after failed write");
  if (shouldSkip(itemWriteSkipPolicy, e, contribution.getStepSkipCount())) {
    contribution.incrementWriteSkipCount();
    inputIterator.remove();
    outputIterator.remove(e);
    logger.debug("Skipping after failed write", e);
  }
  else {
    if (recovery) {
      // Only if already recovering should we check skip policy
      throw new RetryException("Non-skippable exception in recoverer", e);
    }
    else {
      if (e instanceof Exception) {
        throw (Exception) e;
      }
      else if (e instanceof Error) {
        throw (Error) e;
      }
      else {
        throw new RetryException("Non-skippable throwable in recoverer", e);
      }
    }
  }
}
origin: spring-projects/spring-batch

@Override
public O recover(RetryContext context) throws Exception {
  Throwable e = context.getLastThrowable();
  if (shouldSkip(itemProcessSkipPolicy, e, contribution.getStepSkipCount())) {
    iterator.remove(e);
    contribution.incrementProcessSkipCount();
    logger.debug("Skipping after failed process", e);
    return null;
  }
  else {
    if (rollbackClassifier.classify(e)) {
      // Default is to rollback unless the classifier
      // allows us to continue
      throw new RetryException("Non-skippable exception in recoverer while processing", e);
    }
    iterator.remove(e);
    return null;
  }
}
origin: org.springframework.batch/spring-batch-core

iterator.remove();
origin: org.springframework.batch/org.springframework.batch.core

inputIterator.remove();
outputIterator.remove();
  inputIterator.remove();
  outputIterator.remove();
origin: apache/servicemix-bundles

private void checkSkipPolicy(Chunk<I>.ChunkIterator inputIterator, Chunk<O>.ChunkIterator outputIterator,
    Throwable e, StepContribution contribution, boolean recovery) throws Exception {
  logger.debug("Checking skip policy after failed write");
  if (shouldSkip(itemWriteSkipPolicy, e, contribution.getStepSkipCount())) {
    contribution.incrementWriteSkipCount();
    inputIterator.remove();
    outputIterator.remove(e);
    logger.debug("Skipping after failed write", e);
  }
  else {
    if (recovery) {
      // Only if already recovering should we check skip policy
      throw new RetryException("Non-skippable exception in recoverer", e);
    }
    else {
      if (e instanceof Exception) {
        throw (Exception) e;
      }
      else if (e instanceof Error) {
        throw (Error) e;
      }
      else {
        throw new RetryException("Non-skippable throwable in recoverer", e);
      }
    }
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

private void checkSkipPolicy(Chunk<I>.ChunkIterator inputIterator, Chunk<O>.ChunkIterator outputIterator,
    Throwable e, StepContribution contribution, boolean recovery) throws Exception {
  logger.debug("Checking skip policy after failed write");
  if (shouldSkip(itemWriteSkipPolicy, e, contribution.getStepSkipCount())) {
    contribution.incrementWriteSkipCount();
    inputIterator.remove();
    outputIterator.remove(e);
    logger.debug("Skipping after failed write", e);
  }
  else {
    if (recovery) {
      // Only if already recovering should we check skip policy
      throw new RetryException("Non-skippable exception in recoverer", e);
    }
    else {
      if (e instanceof Exception) {
        throw (Exception) e;
      }
      else if (e instanceof Error) {
        throw (Error) e;
      }
      else {
        throw new RetryException("Non-skippable throwable in recoverer", e);
      }
    }
  }
}
origin: apache/servicemix-bundles

protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception {
  Chunk<O> outputs = new Chunk<O>();
  for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) {
    final I item = iterator.next();
    O output;
    try {
      output = doProcess(item);
    }
    catch (Exception e) {
      /*
       * For a simple chunk processor (no fault tolerance) we are done
       * here, so prevent any more processing of these inputs.
       */
      inputs.clear();
      throw e;
    }
    if (output != null) {
      outputs.add(output);
    }
    else {
      iterator.remove();
    }
  }
  return outputs;
}
origin: org.springframework.batch/spring-batch-core

private void checkSkipPolicy(Chunk<I>.ChunkIterator inputIterator, Chunk<O>.ChunkIterator outputIterator,
    Throwable e, StepContribution contribution, boolean recovery) throws Exception {
  logger.debug("Checking skip policy after failed write");
  if (shouldSkip(itemWriteSkipPolicy, e, contribution.getStepSkipCount())) {
    contribution.incrementWriteSkipCount();
    inputIterator.remove();
    outputIterator.remove(e);
    logger.debug("Skipping after failed write", e);
  }
  else {
    if (recovery) {
      // Only if already recovering should we check skip policy
      throw new RetryException("Non-skippable exception in recoverer", e);
    }
    else {
      if (e instanceof Exception) {
        throw (Exception) e;
      }
      else if (e instanceof Error) {
        throw (Error) e;
      }
      else {
        throw new RetryException("Non-skippable throwable in recoverer", e);
      }
    }
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception {
  Chunk<O> outputs = new Chunk<O>();
  for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) {
    final I item = iterator.next();
    O output;
    try {
      output = doProcess(item);
    }
    catch (Exception e) {
      /*
       * For a simple chunk processor (no fault tolerance) we are done
       * here, so prevent any more processing of these inputs.
       */
      inputs.clear();
      throw e;
    }
    if (output != null) {
      outputs.add(output);
    }
    else {
      iterator.remove();
    }
  }
  return outputs;
}
origin: apache/servicemix-bundles

@Override
public O recover(RetryContext context) throws Exception {
  Throwable e = context.getLastThrowable();
  if (shouldSkip(itemProcessSkipPolicy, e, contribution.getStepSkipCount())) {
    iterator.remove(e);
    contribution.incrementProcessSkipCount();
    logger.debug("Skipping after failed process", e);
    return null;
  }
  else {
    if (rollbackClassifier.classify(e)) {
      // Default is to rollback unless the classifier
      // allows us to continue
      throw new RetryException("Non-skippable exception in recoverer while processing", e);
    }
    iterator.remove(e);
    return null;
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
public O recover(RetryContext context) throws Exception {
  Throwable e = context.getLastThrowable();
  if (shouldSkip(itemProcessSkipPolicy, e, contribution.getStepSkipCount())) {
    iterator.remove(e);
    contribution.incrementProcessSkipCount();
    logger.debug("Skipping after failed process", e);
    return null;
  }
  else {
    if (rollbackClassifier.classify(e)) {
      // Default is to rollback unless the classifier
      // allows us to continue
      throw new RetryException("Non-skippable exception in recoverer while processing", e);
    }
    iterator.remove(e);
    return null;
  }
}
origin: org.springframework.batch/spring-batch-core

protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception {
  Chunk<O> outputs = new Chunk<O>();
  for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) {
    final I item = iterator.next();
    O output;
    try {
      output = doProcess(item);
    }
    catch (Exception e) {
      /*
       * For a simple chunk processor (no fault tolerance) we are done
       * here, so prevent any more processing of these inputs.
       */
      inputs.clear();
      throw e;
    }
    if (output != null) {
      outputs.add(output);
    }
    else {
      iterator.remove();
    }
  }
  return outputs;
}
origin: org.springframework.batch/spring-batch-core

@Override
public O recover(RetryContext context) throws Exception {
  Throwable e = context.getLastThrowable();
  if (shouldSkip(itemProcessSkipPolicy, e, contribution.getStepSkipCount())) {
    iterator.remove(e);
    contribution.incrementProcessSkipCount();
    logger.debug("Skipping after failed process", e);
    return null;
  }
  else {
    if (rollbackClassifier.classify(e)) {
      // Default is to rollback unless the classifier
      // allows us to continue
      throw new RetryException("Non-skippable exception in recoverer while processing", e);
    }
    iterator.remove(e);
    return null;
  }
}
origin: org.springframework.batch/org.springframework.batch.core

protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception {
  Chunk<O> outputs = new Chunk<O>();
  for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) {
    final I item = iterator.next();
    O output = doProcess(item);
    if (output != null) {
      outputs.add(output);
    }
    else {
      iterator.remove();
    }
  }
  return outputs;
}
origin: org.springframework.batch/org.springframework.batch.core

private void checkSkipPolicy(Chunk<I>.ChunkIterator inputIterator, Chunk<O>.ChunkIterator outputIterator,
    Throwable e, StepContribution contribution) {
  logger.debug("Checking skip policy after failed write");
  if (shouldSkip(itemWriteSkipPolicy, e, contribution.getStepSkipCount())) {
    contribution.incrementWriteSkipCount();
    inputIterator.remove();
    outputIterator.remove(e);
    logger.debug("Skipping after failed write", e);
  }
  else {
    throw new RetryException("Non-skippable exception in recoverer", e);
  }
}
origin: org.springframework.batch/org.springframework.batch.core

public O recover(RetryContext context) throws Exception {
  Throwable e = context.getLastThrowable();
  if (shouldSkip(itemProcessSkipPolicy, e, contribution.getStepSkipCount())) {
    contribution.incrementProcessSkipCount();
    iterator.remove(e);
    logger.debug("Skipping after failed process", e);
    return null;
  }
  else {
    throw new RetryException("Non-skippable exception in recoverer while processing", e);
  }
}
origin: spring-projects/spring-batch

  outputIterator.remove();
  return;
inputIterator.remove();
outputIterator.remove();
    inputIterator.remove();
    outputIterator.remove();
origin: spring-projects/spring-batch

protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception {
  Chunk<O> outputs = new Chunk<>();
  for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) {
    final I item = iterator.next();
    O output;
    try {
      output = doProcess(item);
    }
    catch (Exception e) {
      /*
       * For a simple chunk processor (no fault tolerance) we are done
       * here, so prevent any more processing of these inputs.
       */
      inputs.clear();
      throw e;
    }
    if (output != null) {
      outputs.add(output);
    }
    else {
      iterator.remove();
    }
  }
  return outputs;
}
origin: spring-projects/spring-batch

/**
 * @param chunk Chunk to recover
 */
private void recover(Chunk<String> chunk) throws Exception {
  for (Chunk<String>.ChunkIterator iterator = chunk.iterator(); iterator.hasNext();) {
    String string = iterator.next();
    try {
      doWrite(Collections.singletonList(string));
    } catch (Exception e) {
      iterator.remove(e);
      throw e;
    }
  }
}
org.springframework.batch.core.step.itemChunk$ChunkIteratorremove

Popular methods of Chunk$ChunkIterator

  • hasNext
  • next
  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now