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.patternto 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.defaultto 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.timeto 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
FieldsFields inherited from class org.apache.accumulo.core.spi.balancer.GroupBalancer
environment -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longThe 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:GroupBalancerThe amount of time to wait between balancing.- Overrides:
getWaitTimein classGroupBalancer
-
getPartitioner
- Specified by:
getPartitionerin classGroupBalancer- Returns:
- A function that groups tablets into named groups.
-