Class LeakReporter

java.lang.Object
org.apache.hadoop.fs.impl.LeakReporter
All Implemented Interfaces:
Closeable, AutoCloseable

public class LeakReporter extends Object implements Closeable
A class to report leaks of streams.

It is created during object creation, and closed during finalization. Predicates should be supplied for the isOpen probe check if the resource is still open, and an operation to actually close the target.

  • Field Details

    • RESOURCE_LEAKS_LOG_NAME

      public static final String RESOURCE_LEAKS_LOG_NAME
      Name of logger used to report leaks: "org.apache.hadoop.fs.resource.leaks".
      See Also:
  • Constructor Details

    • LeakReporter

      public LeakReporter(String message, BooleanSupplier isOpen, RunnableRaisingIOE closeAction)
      Constructor.

      Validates the parameters and builds the stack; append "; thread: " + thread name.

      Parameters:
      message - error message
      isOpen - open predicate
      closeAction - action to close
  • Method Details