public class RegexGroupBalancer extends GroupBalancer
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.
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 of 12abc
, the
group for the tablet would be 12
.
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.
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.
GroupBalancer.Location
TabletBalancer.BalancerProblem, TabletBalancer.NoTservers, TabletBalancer.OutstandingMigrations
Modifier and Type | Field and Description |
---|---|
static String |
DEFAUT_GROUP_PROPERTY |
static String |
REGEX_PROPERTY |
static String |
WAIT_TIME_PROPERTY |
configuration, context, TIME_BETWEEN_BALANCER_WARNINGS
Constructor and Description |
---|
RegexGroupBalancer(String tableId) |
Modifier and Type | Method and Description |
---|---|
protected com.google.common.base.Function<KeyExtent,String> |
getPartitioner() |
protected long |
getWaitTime()
The amount of time to wait between balancing.
|
balance, getAssignments, getLocationProvider, getMaxMigrations, shouldBalance
checkMigrationSanity, constraintNotMet, getOnlineTabletsForTable, init, init, resetBalancerErrors
public static final String REGEX_PROPERTY
public static final String DEFAUT_GROUP_PROPERTY
public static final String WAIT_TIME_PROPERTY
public RegexGroupBalancer(String tableId)
protected long getWaitTime()
GroupBalancer
getWaitTime
in class GroupBalancer
protected com.google.common.base.Function<KeyExtent,String> getPartitioner()
getPartitioner
in class GroupBalancer
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.