hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java [1317:1342]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private FileInputStream deleteFileOnClose(final File file) throws IOException {
    return new FileInputStream(file) {
      private File myFile;

      private FileInputStream init(File file) {
        myFile = file;
        return this;
      }

      @Override
      public void close() throws IOException {
        // close() will be called during try-with-resources and it will be
        // called by finalizer thread during GC. To avoid double-free resource,
        // set myFile to null after the first call.
        if (myFile == null) {
          return;
        }

        super.close();
        if (!myFile.delete()) {
          throw new IOException("Failed deleting persistence file " + myFile.getAbsolutePath());
        }
        myFile = null;
      }
    }.init(file);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/PrefetchExecutor.java [181:203]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static FileInputStream deleteFileOnClose(final File file) throws IOException {
    return new FileInputStream(file) {
      private File myFile;

      private FileInputStream init(File file) {
        myFile = file;
        return this;
      }

      @Override
      public void close() throws IOException {
        if (myFile == null) {
          return;
        }

        super.close();
        if (!myFile.delete()) {
          throw new IOException("Failed deleting persistence file " + myFile.getAbsolutePath());
        }
        myFile = null;
      }
    }.init(file);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



