Class ThrottledBalancerProblemReporter

java.lang.Object
org.apache.accumulo.core.spi.balancer.util.ThrottledBalancerProblemReporter

public class ThrottledBalancerProblemReporter extends Object
Throttles logging of balancer problems by storing the last log time for each problem and limiting reports to once per minute. The logger is generated internally from the supplied class in order to adhere to the requirements for the SPI package (which prohibits having the Logger class in the API).
  • Constructor Details

    • ThrottledBalancerProblemReporter

      public ThrottledBalancerProblemReporter(Class<?> loggerClass)
  • Method Details

    • createNoTabletServersProblem

      public ThrottledBalancerProblemReporter.Problem createNoTabletServersProblem()
      Create a new problem reporter to indicate there are no tablet servers available and balancing could not be performed. Balancers should only create a single instance of this problem, and reuse each time the problem is reported.
    • createOutstandingMigrationsProblem

      public ThrottledBalancerProblemReporter.OutstandingMigrationsProblem createOutstandingMigrationsProblem()
      Create a new problem reporter to indicate that balancing could not be performed due to the existence of outstanding migrations. Balancers should only create a single instance of this problem and update its migrations list before each report.
    • reportProblem

      public void reportProblem(ThrottledBalancerProblemReporter.Problem problem)
      Reports a balance problem. The ThrottledBalancerProblemReporter.Problem.report() will only be called up to once a minute for each problem that is reported repeatedly.
    • clearProblemReportTimes

      public void clearProblemReportTimes()
      Clears reported problems so that a problem report will be logged immediately the next time reportProblem(Problem) is invoked.