Class ContainerLogger

java.lang.Object
org.apache.hadoop.ozone.container.common.utils.ContainerLogger

public final class ContainerLogger extends Object
Utility class defining methods to write to the datanode container log. The container log contains brief messages about container replica level events like state changes or replication/reconstruction. Messages in this log are minimal, so it can be used to track the history of every container on a datanode for a long period of time without rolling off. All messages should be logged after their corresponding event succeeds, to prevent misleading state changes or logs filling with retries on errors. Errors and retries belong in the main datanode application log.
  • Field Details

  • Method Details

    • logOpen

      public static void logOpen(ContainerData containerData)
      Logged when an open container is first created.
      Parameters:
      containerData - The container that was created and opened.
    • logClosing

      public static void logClosing(ContainerData containerData)
      Logged when a container is moved to the closing state.
      Parameters:
      containerData - The container that was marked as closing.
    • logQuasiClosed

      public static void logQuasiClosed(ContainerData containerData, String message)
      Logged when a Ratis container is moved to the quasi-closed state.
      Parameters:
      containerData - The container that was quasi-closed.
      message - The reason the container was quasi-closed, if known.
    • logClosed

      public static void logClosed(ContainerData containerData)
      Logged when a container is moved to the closed state.
      Parameters:
      containerData - The container that was closed.
    • logUnhealthy

      public static void logUnhealthy(ContainerData containerData, ScanResult reason)
      Logged when a container is moved to the unhealthy state.
      Parameters:
      containerData - The container that was marked unhealthy.
      reason - The reason the container was marked unhealthy.
    • logLost

      public static void logLost(ContainerData containerData, String message)
      Logged when a container is lost from this datanode. Currently this would only happen on volume failure. Container deletes do not count as lost containers.
      Parameters:
      containerData - The container that was lost.
      message - The reason the container was lost.
    • logDeleted

      public static void logDeleted(ContainerData containerData, boolean force)
      Logged when a container is deleted because it is empty.
      Parameters:
      containerData - The container that was deleted.
    • logImported

      public static void logImported(ContainerData containerData)
      Logged when a container is copied in to this datanode.
      Parameters:
      containerData - The container that was imported to this datanode.
    • logExported

      public static void logExported(ContainerData containerData)
      Logged when a container is copied from this datanode.
      Parameters:
      containerData - The container that was exported from this datanode.
    • logRecovered

      public static void logRecovered(ContainerData containerData)
      Logged when a container is recovered using EC offline reconstruction.
      Parameters:
      containerData - The container that was recovered on this datanode.
    • logChecksumUpdated

      public static void logChecksumUpdated(ContainerData containerData, long oldDataChecksum)
      Logged when a container's checksum is updated.
      Parameters:
      containerData - The container which has the updated data checksum.
      oldDataChecksum - The old data checksum.
    • logReconciled

      public static void logReconciled(ContainerData containerData, long oldDataChecksum, org.apache.hadoop.hdds.protocol.DatanodeDetails peer)
      Logged when a container is reconciled.
      Parameters:
      containerData - The container that was reconciled on this datanode.
      oldDataChecksum - The old data checksum.