@Experimental(value="The autobalancer may be removed or the API may change in future releases") public class AutoBalancer extends java.lang.Object implements Declarable
AutoBalancer
monitors these statistics and if necessary, triggers a
re-balancing request. Auto-Balancing is expected to prevent failures and data loss.
This implementation is based on Initializer
implementation. By default auto-balancing is
disabled. A user needs to configure AutoBalancer
during cache initialization
GemFireCache.getInitializer()
In a cluster only one member owns auto-balancing responsibility. This is achieved by grabbing a distributed lock. In case of a failure a new member will grab the lock and manage auto balancing.
AutoBalancer
can be controlled using the following configurations
SCHEDULE
Modifier and Type | Field and Description |
---|---|
static java.lang.Object |
AUTO_BALANCER_LOCK |
static java.lang.String |
AUTO_BALANCER_LOCK_SERVICE_NAME
Name of the DistributedLockService that
AutoBalancer will use to guard against
concurrent maintenance activity |
static int |
DEFAULT_MINIMUM_SIZE
Default value of
MINIMUM_SIZE . |
static int |
DEFAULT_SIZE_THRESHOLD_PERCENT
Default value of
SIZE_THRESHOLD_PERCENT . |
static java.lang.String |
MINIMUM_SIZE
In the initial data load phases,
SIZE_THRESHOLD_PERCENT based rebalance
invocation may be unnecessary. |
static java.lang.String |
SCHEDULE
Use this configuration to manage out-of-balance audit frequency.
|
static java.lang.String |
SIZE_THRESHOLD_PERCENT
Use this configuration to manage re-balance invocation.
|
Constructor and Description |
---|
AutoBalancer() |
AutoBalancer(org.apache.geode.cache.util.AutoBalancer.AuditScheduler scheduler,
org.apache.geode.cache.util.AutoBalancer.OOBAuditor auditor,
org.apache.geode.cache.util.AutoBalancer.TimeProvider clock,
org.apache.geode.cache.util.AutoBalancer.CacheOperationFacade cacheFacade) |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
org.apache.geode.cache.util.AutoBalancer.CacheOperationFacade |
getCacheOperationFacade() |
void |
init(java.util.Properties props)
Initializes a user-defined object using the given properties.
|
public static final java.lang.String SCHEDULE
For. e.g. 0 0 * * * ?
for auditing the system every hour
public static final java.lang.String SIZE_THRESHOLD_PERCENT
Default value DEFAULT_SIZE_THRESHOLD_PERCENT
public static final int DEFAULT_SIZE_THRESHOLD_PERCENT
SIZE_THRESHOLD_PERCENT
. If 10% of data is misplaced, its
a good time to redistribute bucketspublic static final java.lang.String MINIMUM_SIZE
SIZE_THRESHOLD_PERCENT
based rebalance
invocation may be unnecessary. Rebalance should not be triggered if the total data size managed
by cluster is too small. Rebalance operation will be triggered if the total number of bytes
rebalance operation may move is more than this number of bytes.
Default value DEFAULT_MINIMUM_SIZE
public static final int DEFAULT_MINIMUM_SIZE
MINIMUM_SIZE
. In the initial data load phases,
SIZE_THRESHOLD_PERCENT
based rebalance invocation may be unnecessary. Do
not rebalance if the data to be moved is less than 100MBpublic static final java.lang.String AUTO_BALANCER_LOCK_SERVICE_NAME
AutoBalancer
will use to guard against
concurrent maintenance activitypublic static final java.lang.Object AUTO_BALANCER_LOCK
public AutoBalancer()
public AutoBalancer(org.apache.geode.cache.util.AutoBalancer.AuditScheduler scheduler, org.apache.geode.cache.util.AutoBalancer.OOBAuditor auditor, org.apache.geode.cache.util.AutoBalancer.TimeProvider clock, org.apache.geode.cache.util.AutoBalancer.CacheOperationFacade cacheFacade)
public void init(java.util.Properties props)
Declarable
Cache
initialization to fail.init
in interface Declarable
props
- Contains the parameters declared in the declarative xml file.public org.apache.geode.cache.util.AutoBalancer.CacheOperationFacade getCacheOperationFacade()
public void destroy()