@Experimental(value="The autobalancer may be removed or the API may change in future releases") public class AutoBalancer extends 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 ConfigInitialization
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 Object |
AUTO_BALANCER_LOCK |
static 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 String |
MINIMUM_SIZE
In the initial data load phases,
SIZE_THRESHOLD_PERCENT based rebalance
invocation may be unnecessary. |
static String |
SCHEDULE
Use this configuration to manage out-of-balance audit frequency.
|
static 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(Properties props)
Deprecated.
as of Geode 1.5 use initialize instead.
|
void |
initialize(Cache cache,
Properties props)
Initializes a user-defined object, owned by the given cache, using the given properties.
|
public static final String SCHEDULE
For. e.g. 0 0 * * * ?
for auditing the system every hour
public static final 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 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 String AUTO_BALANCER_LOCK_SERVICE_NAME
AutoBalancer
will use to guard against
concurrent maintenance activitypublic static final 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 initialize(Cache cache, Properties props)
Declarable
Cache
initialization to fail.
Note that if this method is implemented then the deprecated init method should not be
implemented.
The product will call both methods assuming that only one will have a non-default
implementation.initialize
in interface Declarable
cache
- the cache that owns this declarableprops
- Contains the parameters declared in the declarative xml file.@Deprecated public void init(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()