Class RegexGroupBalancer
java.lang.Object
org.apache.accumulo.core.spi.balancer.GroupBalancer
org.apache.accumulo.core.spi.balancer.RegexGroupBalancer
- All Implemented Interfaces:
TabletBalancer
A
GroupBalancer
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.
- Since:
- 2.1.0
-
Nested Class Summary
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.core.spi.balancer.GroupBalancer
environment
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
The amount of time to wait between balancing.Methods inherited from class org.apache.accumulo.core.spi.balancer.GroupBalancer
balance, getAssignments, getLocationProvider, getMaxMigrations, init, shouldBalance
-
Field Details
-
REGEX_PROPERTY
-
DEFAUT_GROUP_PROPERTY
-
WAIT_TIME_PROPERTY
-
-
Constructor Details
-
RegexGroupBalancer
-
-
Method Details
-
getWaitTime
protected long getWaitTime()Description copied from class:GroupBalancer
The amount of time to wait between balancing.- Overrides:
getWaitTime
in classGroupBalancer
-
getPartitioner
- Specified by:
getPartitioner
in classGroupBalancer
- Returns:
- A function that groups tablets into named groups.
-