Tabnine Logo
ChunkMonitor.getExecutionContextKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getExecutionContextKey
method
in
org.springframework.batch.core.step.item.ChunkMonitor

Best Java code snippets using org.springframework.batch.core.step.item.ChunkMonitor.getExecutionContextKey (Showing top 8 results out of 315)

origin: spring-projects/spring-batch

@Override
public void update(ExecutionContext executionContext) throws ItemStreamException {
  super.update(executionContext);
  if (streamsRegistered) {
    ChunkMonitorData data = getData();
    if (data.offset == 0) {
      // Only call the underlying update method if we are on a chunk
      // boundary
      stream.update(executionContext);
      executionContext.remove(getExecutionContextKey(OFFSET));
    }
    else {
      executionContext.putInt(getExecutionContextKey(OFFSET), data.offset);
    }
  }
}
origin: spring-projects/spring-batch

@Override
public void open(ExecutionContext executionContext) throws ItemStreamException {
  super.open(executionContext);
  if (streamsRegistered) {
    stream.open(executionContext);
    ChunkMonitorData data = new ChunkMonitorData(executionContext.getInt(getExecutionContextKey(OFFSET), 0), 0);
    holder.set(data);
    if (reader == null) {
      logger.warn("No ItemReader set (must be concurrent step), so ignoring offset data.");
      return;
    }
    for (int i = 0; i < data.offset; i++) {
      try {
        reader.read();
      }
      catch (Exception e) {
        throw new ItemStreamException("Could not position reader with offset: " + data.offset, e);
      }
    }
    resetOffset();
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
public void update(ExecutionContext executionContext) throws ItemStreamException {
  super.update(executionContext);
  if (streamsRegistered) {
    ChunkMonitorData data = getData();
    if (data.offset == 0) {
      // Only call the underlying update method if we are on a chunk
      // boundary
      stream.update(executionContext);
      executionContext.remove(getExecutionContextKey(OFFSET));
    }
    else {
      executionContext.putInt(getExecutionContextKey(OFFSET), data.offset);
    }
  }
}
origin: apache/servicemix-bundles

@Override
public void update(ExecutionContext executionContext) throws ItemStreamException {
  super.update(executionContext);
  if (streamsRegistered) {
    ChunkMonitorData data = getData();
    if (data.offset == 0) {
      // Only call the underlying update method if we are on a chunk
      // boundary
      stream.update(executionContext);
      executionContext.remove(getExecutionContextKey(OFFSET));
    }
    else {
      executionContext.putInt(getExecutionContextKey(OFFSET), data.offset);
    }
  }
}
origin: org.springframework.batch/spring-batch-core

@Override
public void update(ExecutionContext executionContext) throws ItemStreamException {
  super.update(executionContext);
  if (streamsRegistered) {
    ChunkMonitorData data = getData();
    if (data.offset == 0) {
      // Only call the underlying update method if we are on a chunk
      // boundary
      stream.update(executionContext);
      executionContext.remove(getExecutionContextKey(OFFSET));
    }
    else {
      executionContext.putInt(getExecutionContextKey(OFFSET), data.offset);
    }
  }
}
origin: org.springframework.batch/spring-batch-core

@Override
public void open(ExecutionContext executionContext) throws ItemStreamException {
  super.open(executionContext);
  if (streamsRegistered) {
    stream.open(executionContext);
    ChunkMonitorData data = new ChunkMonitorData(executionContext.getInt(getExecutionContextKey(OFFSET), 0), 0);
    holder.set(data);
    if (reader == null) {
      logger.warn("No ItemReader set (must be concurrent step), so ignoring offset data.");
      return;
    }
    for (int i = 0; i < data.offset; i++) {
      try {
        reader.read();
      }
      catch (Exception e) {
        throw new ItemStreamException("Could not position reader with offset: " + data.offset, e);
      }
    }
    resetOffset();
  }
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
public void open(ExecutionContext executionContext) throws ItemStreamException {
  super.open(executionContext);
  if (streamsRegistered) {
    stream.open(executionContext);
    ChunkMonitorData data = new ChunkMonitorData(executionContext.getInt(getExecutionContextKey(OFFSET), 0), 0);
    holder.set(data);
    if (reader == null) {
      logger.warn("No ItemReader set (must be concurrent step), so ignoring offset data.");
      return;
    }
    for (int i = 0; i < data.offset; i++) {
      try {
        reader.read();
      }
      catch (Exception e) {
        throw new ItemStreamException("Could not position reader with offset: " + data.offset, e);
      }
    }
    resetOffset();
  }
}
origin: apache/servicemix-bundles

@Override
public void open(ExecutionContext executionContext) throws ItemStreamException {
  super.open(executionContext);
  if (streamsRegistered) {
    stream.open(executionContext);
    ChunkMonitorData data = new ChunkMonitorData(executionContext.getInt(getExecutionContextKey(OFFSET), 0), 0);
    holder.set(data);
    if (reader == null) {
      logger.warn("No ItemReader set (must be concurrent step), so ignoring offset data.");
      return;
    }
    for (int i = 0; i < data.offset; i++) {
      try {
        reader.read();
      }
      catch (Exception e) {
        throw new ItemStreamException("Could not position reader with offset: " + data.offset, e);
      }
    }
    resetOffset();
  }
}
org.springframework.batch.core.step.itemChunkMonitorgetExecutionContextKey

Popular methods of ChunkMonitor

  • incrementOffset
  • registerItemStream
  • resetOffset
  • setChunkSize
  • setItemReader
  • getData
  • setExecutionContextName
  • <init>
  • close
  • getOffset
  • open
  • update
  • open,
  • update

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Reference (javax.naming)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top Vim 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