Class DiagnosticsCommand

java.lang.Object
org.apache.nifi.runtime.command.DiagnosticsCommand
All Implemented Interfaces:
Runnable

public class DiagnosticsCommand extends Object implements Runnable
Diagnostics Command abstracted for invocation in Shutdown Command
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • DATE_TIME_FORMATTER

      private static final DateTimeFormatter DATE_TIME_FORMATTER
    • DIAGNOSTICS_FILE_FORMAT

      private static final String DIAGNOSTICS_FILE_FORMAT
      See Also:
    • properties

      private final NiFiProperties properties
    • server

      private final NiFiServer server
  • Constructor Details

  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • purgeOldestFiles

      private void purgeOldestFiles(File diagnosticDirectory)
    • writeDiagnostics

      private void writeDiagnostics(File diagnosticsPath)
    • getOldestFile

      private Path getOldestFile(File diagnosticDirectory) throws IOException
      Throws:
      IOException
    • isFileCountExceeded

      private boolean isFileCountExceeded(File diagnosticDirectory, int maxFileCount)
    • isSizeExceeded

      private boolean isSizeExceeded(File diagnosticDirectory, long maxSizeInBytes)
    • getDirectorySize

      private long getDirectorySize(Path path)
    • getFileSizeByPathFunction

      private ToLongFunction<Path> getFileSizeByPathFunction()