public abstract class GroupBalancer extends TabletBalancer
To use this balancer you must extend it and implement getPartitioner(). See RegexGroupBalancer as an example.
| Modifier and Type | Class and Description |
|---|---|
static class |
GroupBalancer.Location |
TabletBalancer.BalancerProblem, TabletBalancer.NoTservers, TabletBalancer.OutstandingMigrationsconfiguration, context, TIME_BETWEEN_BALANCER_WARNINGS| Constructor and Description |
|---|
GroupBalancer(String tableId) |
| Modifier and Type | Method and Description |
|---|---|
long |
balance(SortedMap<TServerInstance,TabletServerStatus> current,
Set<KeyExtent> migrations,
List<TabletMigration> migrationsOut)
Ask the balancer if any migrations are necessary.
|
void |
getAssignments(SortedMap<TServerInstance,TabletServerStatus> current,
Map<KeyExtent,TServerInstance> unassigned,
Map<KeyExtent,TServerInstance> assignments)
Assign tablets to tablet servers.
|
protected Iterable<Pair<KeyExtent,GroupBalancer.Location>> |
getLocationProvider() |
protected int |
getMaxMigrations()
The maximum number of migrations to perform in a single pass.
|
protected abstract com.google.common.base.Function<KeyExtent,String> |
getPartitioner() |
protected long |
getWaitTime()
The amount of time to wait between balancing.
|
protected boolean |
shouldBalance(SortedMap<TServerInstance,TabletServerStatus> current,
Set<KeyExtent> migrations) |
checkMigrationSanity, constraintNotMet, getOnlineTabletsForTable, init, init, resetBalancerErrorspublic GroupBalancer(String tableId)
protected abstract com.google.common.base.Function<KeyExtent,String> getPartitioner()
protected Iterable<Pair<KeyExtent,GroupBalancer.Location>> getLocationProvider()
protected long getWaitTime()
protected int getMaxMigrations()
protected boolean shouldBalance(SortedMap<TServerInstance,TabletServerStatus> current, Set<KeyExtent> migrations)
public void getAssignments(SortedMap<TServerInstance,TabletServerStatus> current, Map<KeyExtent,TServerInstance> unassigned, Map<KeyExtent,TServerInstance> assignments)
TabletBalancergetAssignments in class TabletBalancercurrent - 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.public long balance(SortedMap<TServerInstance,TabletServerStatus> current, Set<KeyExtent> migrations, List<TabletMigration> migrationsOut)
TabletBalancerbalance in class TabletBalancercurrent - 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.Copyright © 2015 Apache Accumulo Project. All rights reserved.