Class GroupBalancer
- java.lang.Object
-
- org.apache.accumulo.server.master.balancer.TabletBalancer
-
- org.apache.accumulo.server.master.balancer.GroupBalancer
-
- All Implemented Interfaces:
TabletBalancer
- Direct Known Subclasses:
RegexGroupBalancer
@Deprecated(since="2.1.0") public abstract class GroupBalancer extends TabletBalancer
Deprecated.since 2.1.0. UseGroupBalancer
instead.A balancer that evenly spreads groups of tablets across all tablet server. This balancer accomplishes the following two goals :- Evenly spreads each group across all tservers.
- Minimizes the total number of groups on each tserver.
To use this balancer you must extend it and implement
getPartitioner()
. SeeRegexGroupBalancer
as an example.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
TabletBalancer.BalancerProblem, TabletBalancer.NoTservers, TabletBalancer.OutstandingMigrations
-
Nested classes/interfaces inherited from interface org.apache.accumulo.core.spi.balancer.TabletBalancer
TabletBalancer.AssignmentParameters, TabletBalancer.BalanceParameters
-
-
Field Summary
-
Fields inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
context, TIME_BETWEEN_BALANCER_WARNINGS
-
-
Constructor Summary
Constructors Constructor Description GroupBalancer(TableId tableId)
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
balance(SortedMap<TServerInstance,TabletServerStatus> current, Set<KeyExtent> migrations, List<TabletMigration> migrationsOut)
Deprecated.Ask the balancer if any migrations are necessary.void
getAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned, Map<KeyExtent,TServerInstance> assignments)
Deprecated.Assign tablets to tablet servers.protected Map<KeyExtent,TServerInstance>
getLocationProvider()
Deprecated.protected int
getMaxMigrations()
Deprecated.The maximum number of migrations to perform in a single pass.protected abstract Function<KeyExtent,String>
getPartitioner()
Deprecated.protected long
getWaitTime()
Deprecated.The amount of time to wait between balancing.protected boolean
shouldBalance(SortedMap<TServerInstance,TabletServerStatus> current, Set<KeyExtent> migrations)
Deprecated.-
Methods inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
balance, checkMigrationSanity, constraintNotMet, getAssignments, getOnlineTabletsForTable, init, init, init, resetBalancerErrors
-
-
-
-
Constructor Detail
-
GroupBalancer
public GroupBalancer(TableId tableId)
Deprecated.
-
-
Method Detail
-
getPartitioner
protected abstract Function<KeyExtent,String> getPartitioner()
Deprecated.- Returns:
- A function that groups tablets into named groups.
-
getLocationProvider
protected Map<KeyExtent,TServerInstance> getLocationProvider()
Deprecated.
-
getWaitTime
protected long getWaitTime()
Deprecated.The amount of time to wait between balancing.
-
getMaxMigrations
protected int getMaxMigrations()
Deprecated.The maximum number of migrations to perform in a single pass.
-
shouldBalance
protected boolean shouldBalance(SortedMap<TServerInstance,TabletServerStatus> current, Set<KeyExtent> migrations)
Deprecated.- Returns:
- Examine current tserver and migrations and return true if balancing should occur.
-
getAssignments
public void getAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned, Map<KeyExtent,TServerInstance> assignments)
Deprecated.Description copied from class:TabletBalancer
Assign tablets to tablet servers. This method is called whenever the manager finds tablets that are unassigned.- Specified by:
getAssignments
in 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.
-
balance
public long balance(SortedMap<TServerInstance,TabletServerStatus> current, Set<KeyExtent> migrations, List<TabletMigration> migrationsOut)
Deprecated.Description copied from class:TabletBalancer
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.- Specified by:
balance
in 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.
-
-