protected void requestFinalize(String fileName){
  Set<String> filesPerWindow=finalizedFiles.get(currentWindow);
  if (filesPerWindow == null) {
    filesPerWindow=Sets.newHashSet();
    finalizedFiles.put(currentWindow,filesPerWindow);
  }
  if (rollingFile) {
    MutableInt part=finalizedPart.get(fileName);
    if (part == null) {
      part=new MutableInt(-1);
      finalizedPart.put(fileName,part);
    }
    MutableInt currentOpenPart=openPart.get(fileName);
    for (int x=part.getValue() + 1; x <= currentOpenPart.getValue(); x++) {
      String prevPartNotFinalized=getPartFileName(fileName,x);
      LOG.debug("request finalize {}",prevPartNotFinalized);
      filesPerWindow.add(prevPartNotFinalized);
    }
    fileName=getPartFileNamePri(fileName);
    part.setValue(currentOpenPart.getValue());
  }
  filesPerWindow.add(fileName);
}

protected void requestFinalize ( String fileName ) { Set < String > filesPerWindow = finalizedFiles . get ( currentWindow ) ; if ( filesPerWindow == null ) { filesPerWindow = Sets . newHashSet ( ) ; finalizedFiles . put ( currentWindow , filesPerWindow ) ; } if ( rollingFile ) { MutableInt part = finalizedPart . get ( fileName ) ; if ( part == null ) { part = new MutableInt ( - 1 ) ; finalizedPart . put ( fileName , part ) ; } MutableInt currentOpenPart = openPart . get ( fileName ) ; for ( int x = part . getValue ( ) + 1 ; x <= currentOpenPart . getValue ( ) ; x ++ ) { String prevPartNotFinalized = getPartFileName ( fileName , x ) ; LOG . debug ( "request finalize {}" , prevPartNotFinalized ) ; filesPerWindow . add ( prevPartNotFinalized ) ; } fileName = getPartFileNamePri ( fileName ) ; part . setValue ( currentOpenPart . getValue ( ) ) ; } filesPerWindow . add ( fileName ) ; }
requests a file to be finalized . when it is writing to a rolling file , this will request for finalizing the current open part and all the prev parts which weren ' t requested yet .
