Class SimpleLoadBalancer
java.lang.Object
org.apache.accumulo.core.spi.balancer.SimpleLoadBalancer
- All Implemented Interfaces:
- TabletBalancer
A simple tablet balancer that attempts to spread tablets out evenly across all available tablet
 servers. The goal is to achieve the same number of tablets on each tablet server.
 
Initial assignments attempt to maintain locality by assigning tablets to their previous location if possible, but otherwise assignments are made in a random fashion across all available tablet servers.
- Since:
- 2.1.0
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.accumulo.core.spi.balancer.TabletBalancerTabletBalancer.AssignmentParameters, TabletBalancer.BalanceParameters
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionlongAsk the balancer if any migrations are necessary.getAssignment(SortedMap<TabletServerId, TServerStatus> locations, TabletServerId last) voidAssign tablets to tablet servers.booleangetMigrations(Map<TabletServerId, TServerStatus> current, List<TabletMigration> result) protected List<TabletStatistics>getOnlineTabletsForTable(TabletServerId tabletServerId, TableId tableId) voidinit(BalancerEnvironment balancerEnvironment) Initialize the TabletBalancer.
- 
Field Details- 
environment
 
- 
- 
Constructor Details- 
SimpleLoadBalancerpublic SimpleLoadBalancer()
- 
SimpleLoadBalancer
 
- 
- 
Method Details- 
initDescription copied from interface:TabletBalancerInitialize the TabletBalancer. This gives the balancer the opportunity to read the configuration.- Specified by:
- initin interface- TabletBalancer
 
- 
getAssignmentpublic TabletServerId getAssignment(SortedMap<TabletServerId, TServerStatus> locations, TabletServerId last) 
- 
getMigrationspublic boolean getMigrations(Map<TabletServerId, TServerStatus> current, List<TabletMigration> result) 
- 
getOnlineTabletsForTableprotected List<TabletStatistics> getOnlineTabletsForTable(TabletServerId tabletServerId, TableId tableId) throws AccumuloSecurityException, AccumuloException 
- 
getAssignmentsDescription copied from interface:TabletBalancerAssign tablets to tablet servers. This method is called whenever the manager finds tablets that are unassigned.- Specified by:
- getAssignmentsin interface- TabletBalancer
 
- 
balanceDescription copied from interface: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. This method will not be called when there are unassigned tablets.- Specified by:
- balancein interface- TabletBalancer
- Returns:
- the time, in milliseconds, to wait before re-balancing.
 
 
-