Interface TabletBalancer

    • Method Detail

      • init

        void init​(BalancerEnvironment balancerEnvironment)
        Initialize the TabletBalancer. This gives the balancer the opportunity to read the configuration.
      • getAssignments

        void getAssignments​(TabletBalancer.AssignmentParameters params)
        Assign tablets to tablet servers. This method is called whenever the manager finds tablets that are unassigned.
      • balance

        long balance​(TabletBalancer.BalanceParameters params)
        Ask the balancer if any migrations are necessary. If the balancer is going to self-abort due to some environmental constraint (e.g. it requires some minimum number of tservers, or a maximum number of outstanding migrations), it should issue a log message to alert operators. The message should be at WARN normally and at ERROR if the balancer knows that the problem can not self correct. It should not issue these messages more than once a minute. This method will not be called when there are unassigned tablets.
        Returns:
        the time, in milliseconds, to wait before re-balancing.