org.apache.accumulo.server.master.balancer
Class DefaultLoadBalancer
java.lang.Object
org.apache.accumulo.server.master.balancer.TabletBalancer
org.apache.accumulo.server.master.balancer.DefaultLoadBalancer
public class DefaultLoadBalancer
- extends TabletBalancer
Method Summary |
long |
balance(java.util.SortedMap<TServerInstance,TabletServerStatus> current,
java.util.Set<KeyExtent> migrations,
java.util.List<TabletMigration> migrationsOut)
Ask the balancer if any migrations are necessary. |
TServerInstance |
getAssignment(java.util.SortedMap<TServerInstance,TabletServerStatus> locations,
KeyExtent extent,
TServerInstance last)
|
void |
getAssignments(java.util.SortedMap<TServerInstance,TabletServerStatus> current,
java.util.Map<KeyExtent,TServerInstance> unassigned,
java.util.Map<KeyExtent,TServerInstance> assignments)
Assign tablets to tablet servers |
boolean |
getMigrations(java.util.Map<TServerInstance,TabletServerStatus> current,
java.util.List<TabletMigration> result)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultLoadBalancer
public DefaultLoadBalancer()
DefaultLoadBalancer
public DefaultLoadBalancer(java.lang.String table)
getAssignment
public TServerInstance getAssignment(java.util.SortedMap<TServerInstance,TabletServerStatus> locations,
KeyExtent extent,
TServerInstance last)
getMigrations
public boolean getMigrations(java.util.Map<TServerInstance,TabletServerStatus> current,
java.util.List<TabletMigration> result)
getAssignments
public void getAssignments(java.util.SortedMap<TServerInstance,TabletServerStatus> current,
java.util.Map<KeyExtent,TServerInstance> unassigned,
java.util.Map<KeyExtent,TServerInstance> assignments)
- Description copied from class:
TabletBalancer
- Assign tablets to tablet servers
- Specified by:
getAssignments
in class TabletBalancer
- 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.
balance
public long balance(java.util.SortedMap<TServerInstance,TabletServerStatus> current,
java.util.Set<KeyExtent> migrations,
java.util.List<TabletMigration> migrationsOut)
- Description copied from class:
TabletBalancer
- Ask the balancer if any migrations are necessary.
- Specified by:
balance
in class TabletBalancer
- Parameters:
current
- The current table-summary state of all the online tablet servers. Read-only.migrations
- the current set of migrations. Read-only.migrationsOut
- the migrations to perform. Write-only.
- Returns:
- the time, in milliseconds, to wait before re-balancing.
This method will not be called when there are unassigned tablets.
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.