Review Board 1.7.22


FLUME-1872: SpoolingDirectorySource doesn't delete tracker file when deletePolicy is "immediate"

Review Request #9080 - Created Jan. 24, 2013 and submitted

Mike Percy
FLUME-1872
Reviewers
Flume
flume-git
Fix issue where tracker file is not deleted when deletePolicy is set to "immediate" for spooled files.
Added unit test. Unit tests pass.
flume-ng-core/src/main/java/org/apache/flume/client/avro/ReliableSpoolingFileEventReader.java
Revision b19d0ea New Change
[20] 368 lines
[+20] [+] private void deleteCurrentFile(File fileToDelete) throws IOException {
369
      return;
369
      return;
370
    }
370
    }
371
    if (!fileToDelete.delete()) {
371
    if (!fileToDelete.delete()) {
372
      throw new IOException("Unable to delete spool file: " + fileToDelete);
372
      throw new IOException("Unable to delete spool file: " + fileToDelete);
373
    }
373
    }

    
   
374
    // now we no longer need the meta file

    
   
375
    deleteMetaFile();
374
  }
376
  }
375

    
   
377

   
376
  /**
378
  /**
377
   * Find and open the oldest file in the chosen directory. If two or more
379
   * Find and open the oldest file in the chosen directory. If two or more
378
   * files are equally old, the file name with lower lexicographical value is
380
   * files are equally old, the file name with lower lexicographical value is
[+20] [20] 182 lines
flume-ng-core/src/test/java/org/apache/flume/client/avro/TestReliableSpoolingFileEventReader.java
Revision a29606e New Change
 
  1. flume-ng-core/src/main/java/org/apache/flume/client/avro/ReliableSpoolingFileEventReader.java: Loading...
  2. flume-ng-core/src/test/java/org/apache/flume/client/avro/TestReliableSpoolingFileEventReader.java: Loading...