Class TableLoadBalancer
- java.lang.Object
-
- org.apache.accumulo.server.master.balancer.TabletBalancer
-
- org.apache.accumulo.server.master.balancer.TableLoadBalancer
-
- Direct Known Subclasses:
HostRegexTableLoadBalancer
public class TableLoadBalancer extends TabletBalancer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
TabletBalancer.BalancerProblem, TabletBalancer.NoTservers, TabletBalancer.OutstandingMigrations
-
-
Field Summary
-
Fields inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
context, TIME_BETWEEN_BALANCER_WARNINGS
-
-
Constructor Summary
Constructors Constructor Description TableLoadBalancer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longbalance(SortedMap<TServerInstance,TabletServerStatus> current, Set<KeyExtent> migrations, List<TabletMigration> migrationsOut)Ask the balancer if any migrations are necessary.voidgetAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned, Map<KeyExtent,TServerInstance> assignments)Assign tablets to tablet servers.protected TabletBalancergetBalancerForTable(TableId tableId)protected StringgetLoadBalancerClassNameForTable(TableId table)protected TableOperationsgetTableOperations()-
Methods inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
checkMigrationSanity, constraintNotMet, getOnlineTabletsForTable, init, init, resetBalancerErrors
-
-
-
-
Method Detail
-
getBalancerForTable
protected TabletBalancer getBalancerForTable(TableId tableId)
-
getAssignments
public void getAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned, Map<KeyExtent,TServerInstance> assignments)
Description copied from class:TabletBalancerAssign tablets to tablet servers. This method is called whenever the master finds tablets that are unassigned.- Specified by:
getAssignmentsin classTabletBalancer- Parameters:
current- The current table-summary state of all the online tablet servers. Read-only. The TabletServerStatus for each server may be null if the tablet server has not yet responded to a recent request for status.unassigned- A map from unassigned tablet to the last known tablet server. Read-only.assignments- A map from tablet to assigned server. Write-only.
-
getTableOperations
protected TableOperations getTableOperations()
-
balance
public long balance(SortedMap<TServerInstance,TabletServerStatus> current, Set<KeyExtent> migrations, List<TabletMigration> migrationsOut)
Description copied from class:TabletBalancerAsk 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.- Specified by:
balancein classTabletBalancer- Parameters:
current- The current table-summary state of all the online tablet servers. Read-only.migrations- the current set of migrations. Read-only.migrationsOut- new migrations to perform; should not contain tablets in the current set of migrations. Write-only.- Returns:
- the time, in milliseconds, to wait before re-balancing. This method will not be called when there are unassigned tablets.
-
-