Class RegexGroupBalancer
- java.lang.Object
-
- org.apache.accumulo.server.master.balancer.TabletBalancer
-
- org.apache.accumulo.server.master.balancer.GroupBalancer
-
- org.apache.accumulo.server.master.balancer.RegexGroupBalancer
-
public class RegexGroupBalancer extends GroupBalancer
AGroupBalancer
that groups tablets using a configurable regex. To use this balancer configure the following settings for your table then configure this balancer for your table.- Set
table.custom.balancer.group.regex.pattern
to a regular expression. This regular expression must have one group. The regex is applied to the tablet end row and whatever the regex group matches is used as the group. For example with a regex of(\d\d).*
and an end row of12abc
, the group for the tablet would be12
. - Set
table.custom.balancer.group.regex.default
to a default group. This group is returned for the last tablet in the table and tablets for which the regex does not match. - Optionally set
table.custom.balancer.group.regex.wait.time
to time (can use time suffixes). This determines how long to wait between balancing. Since this balancer scans the metadata table, may want to set this higher for large tables.
- Set
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.accumulo.server.master.balancer.GroupBalancer
GroupBalancer.Location
-
Nested classes/interfaces inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
TabletBalancer.BalancerProblem, TabletBalancer.NoTservers, TabletBalancer.OutstandingMigrations
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAUT_GROUP_PROPERTY
static String
REGEX_PROPERTY
static String
WAIT_TIME_PROPERTY
-
Fields inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
configuration, context, TIME_BETWEEN_BALANCER_WARNINGS
-
-
Constructor Summary
Constructors Constructor Description RegexGroupBalancer(String tableId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.common.base.Function<KeyExtent,String>
getPartitioner()
protected long
getWaitTime()
The amount of time to wait between balancing.-
Methods inherited from class org.apache.accumulo.server.master.balancer.GroupBalancer
balance, getAssignments, getLocationProvider, getMaxMigrations, shouldBalance
-
Methods inherited from class org.apache.accumulo.server.master.balancer.TabletBalancer
checkMigrationSanity, constraintNotMet, getOnlineTabletsForTable, init, init, resetBalancerErrors
-
-
-
-
Constructor Detail
-
RegexGroupBalancer
public RegexGroupBalancer(String tableId)
-
-
Method Detail
-
getWaitTime
protected long getWaitTime()
Description copied from class:GroupBalancer
The amount of time to wait between balancing.- Overrides:
getWaitTime
in classGroupBalancer
-
getPartitioner
protected com.google.common.base.Function<KeyExtent,String> getPartitioner()
- Specified by:
getPartitioner
in classGroupBalancer
- Returns:
- A function that groups tablets into named groups.
-
-