public synchronized void addNewFile(long seqno,String fileName){
  logger.info("Adding new index entry for " + fileName + " starting at seqno "+ seqno);
  index.add(new LogIndexEntry(seqno,Long.MAX_VALUE,fileName));
  if (retentionMillis > 0) {
    String activeFile=getFile(activeSeqno);
    File[] purgeCandidates=FileCommands.filesOverRetentionAndInactive(logDir,filePrefix,2,activeFile);
    File[] filesToPurge=FileCommands.filesOverModDate(purgeCandidates,new Interval(retentionMillis));
    if (filesToPurge.length > 0) {
      for (      File file : filesToPurge)       removeFile(file.getName());
      FileCommands.deleteFiles(filesToPurge,false);
    }
  }
}

public synchronized void addNewFile ( long seqno , String fileName ) { logger . info ( "Adding new index entry for " + fileName + " starting at seqno " + seqno ) ; index . add ( new LogIndexEntry ( seqno , Long . MAX_VALUE , fileName ) ) ; if ( retentionMillis > 0 ) { String activeFile = getFile ( activeSeqno ) ; File [ ] purgeCandidates = FileCommands . filesOverRetentionAndInactive ( logDir , filePrefix , 2 , activeFile ) ; File [ ] filesToPurge = FileCommands . filesOverModDate ( purgeCandidates , new Interval ( retentionMillis ) ) ; if ( filesToPurge . length > 0 ) { for ( File file : filesToPurge ) removeFile ( file . getName ( ) ) ; FileCommands . deleteFiles ( filesToPurge , false ) ; } } }
adds a new file to the index .
