コード例 #1
0
 public boolean initializeCurrentFile(PartitionCheckpoint checkpoint) throws IOException {
   initCurrentFile();
   if (!isStreamFile(checkpoint.getFileName())) {
     LOG.info("The file " + checkpoint.getFileName() + " is not a " + "stream file");
     return false;
   }
   this.checkpoint = checkpoint;
   LOG.debug("checkpoint:" + checkpoint);
   currentFile = fileMap.getValue(checkpoint.getFileName());
   if (currentFile != null) {
     currentLineNum = checkpoint.getLineNum();
     LOG.debug("CurrentFile:" + currentFile + " currentLineNum:" + currentLineNum);
     setIterator();
   }
   return currentFile != null;
 }
コード例 #2
0
 public boolean setCurrentFile(String streamFileName, long currentLineNum) throws IOException {
   if (fileMap.containsFile(streamFileName)) {
     currentFile = fileMap.getValue(streamFileName);
     setIterator();
     this.currentLineNum = currentLineNum;
     LOG.debug("Set current file:" + currentFile + "currentLineNum:" + currentLineNum);
     openCurrentFile(false);
     return true;
   } else {
     LOG.info("Did not find current file." + streamFileName + " Trying to set next higher");
     if (!setNextHigher(streamFileName)) {
       return false;
     } else {
       return true;
     }
   }
 }