commonlib/src/main/java/com/streamsets/pipeline/lib/io/BaseFileContextProvider.java
@Override
  public void setOffsets(Map<String, String> offsets) throws IOException{
    Utils.checkNotNull(offsets, "offsets");
    // retrieve file:offset for each directory
    for (FileContext fileContext : fileContexts) {
      String offset = offsets.get(fileContext.getMultiFileInfo().getFileKey());
      LiveFile file = null;
      long fileOffset = 0;
      if (offset != null && !offset.isEmpty()) {
        file = FileContextProviderUtil.getRefreshedLiveFileFromFileOffset(offset);
        fileOffset = FileContextProviderUtil.getLongOffsetFromFileOffset(offset);
      }
      fileContext.setStartingCurrentFileName(file);
      fileContext.setStartingOffset(fileOffset);
      if (LOG.isTraceEnabled()) {
        LOG.trace("Setting offset: directory '{}', file '{}', offset '{}'",
            fileContext.getMultiFileInfo().getFileFullPath(), file, fileOffset);
      }
    }
    currentIdx = startingIdx;
  }
@Override
  public void setOffsets(Map<String, String> offsets) throws IOException{
    Utils.checkNotNull(offsets, "offsets");
    // retrieve file:offset for each directory
    for (FileContext fileContext : fileContexts) {
      String offset = offsets.get(fileContext.getMultiFileInfo().getFileKey());
      LiveFile file = null;
      long fileOffset = 0;
      if (offset != null && !offset.isEmpty()) {
        file = FileContextProviderUtil.getRefreshedLiveFileFromFileOffset(offset);
        fileOffset = FileContextProviderUtil.getLongOffsetFromFileOffset(offset);
      }
      fileContext.setStartingCurrentFileName(file);
      fileContext.setStartingOffset(fileOffset);
      if (LOG.isTraceEnabled()) {
        LOG.trace("Setting offset: directory '{}', file '{}', offset '{}'",
            fileContext.getMultiFileInfo().getFileFullPath(), file, fileOffset);
      }
    }
    currentIdx = startingIdx;
  }
@ Override public void setOffsets ( Map < String , String > offsets ) throws IOException { Utils . checkNotNull ( offsets , "offsets" ) ; // retrieve file:offset for each directory for ( FileContext fileContext : fileContexts ) { String offset = offsets . get ( fileContext . getMultiFileInfo ( ) . getFileKey ( ) ) ; LiveFile file = null ; long fileOffset = 0 ; if ( offset != null && ! offset . isEmpty ( ) ) { file = FileContextProviderUtil . getRefreshedLiveFileFromFileOffset ( offset ) ; fileOffset = FileContextProviderUtil . getLongOffsetFromFileOffset ( offset ) ; } fileContext . setStartingCurrentFileName ( file ) ; fileContext . setStartingOffset ( fileOffset ) ; if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "Setting offset: directory '{}', file '{}', offset '{}'" , fileContext . getMultiFileInfo ( ) . getFileFullPath ( ) , file , fileOffset ) ; } } currentIdx = startingIdx ; }
Sets the file offsets to use for the next read. To work correctly, the last return offsets should be used or
an empty <code>Map</code> if there is none.
<p/>
If a reader is already live, the corresponding set offset is ignored as we cache all the contextual information
of live readers.

@param offsets directory offsets.
@throws IOException thrown if there was an IO error while preparing file offsets.
Sets the file offsets to use for the next read . To work correctly the last return offsets should be used or an empty <code > Map< / code > if there is none . <p / > If a reader is already live the corresponding set offset is ignored as we cache all the contextual information of live readers .