public class PRObserver
extends com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapter
| Modifier and Type | Field and Description |
|---|---|
static String |
activityListKey |
static String |
movingBucket |
static String |
movingPrimary |
static String |
rebalRecovFinished |
static String |
rebalRecovStarted |
static String |
recoveryConflated |
| Constructor and Description |
|---|
PRObserver() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_addToActivityList(String activityStr)
Add an activity to the activity List in the blackboard for this vm
|
protected static String |
activityListToString(List activityList)
Return a string representation of an activityList
|
protected void |
addFinishToActivityList(Date finishDate,
long finishTime,
com.gemstone.gemfire.cache.Region aRegion)
Add a conflated recovery activity to the activity List in the blackboard for this vm
|
protected static boolean |
completedActivities(List activityList,
int expectedNumActivities,
boolean allowConflatedActivities,
int numPRs,
List prNames,
int vmID)
Given a list of recovery activites, determine whether a certain number
has occurred for each of numPRs.
|
protected static String |
getRegionNameFromActivity(String activityStr) |
static void |
initialize()
Initialize counters.
|
static void |
initialize(int vmId)
Initialize counters for a particular vmid.
|
static void |
installObserverHook()
Install a hook to determine when rebalancing/recovery starts/stops
|
static void |
installObserverHook(boolean recordBucketMovesArg,
boolean recordPrimaryMovesArg)
Install a hook to determine when rebalancing/recovery starts/stops
|
void |
movingBucket(com.gemstone.gemfire.cache.Region region,
int bucketId,
com.gemstone.gemfire.distributed.DistributedMember source,
com.gemstone.gemfire.distributed.DistributedMember target)
Callback for moving a bucket
|
void |
movingPrimary(com.gemstone.gemfire.cache.Region region,
int bucketId,
com.gemstone.gemfire.distributed.DistributedMember source,
com.gemstone.gemfire.distributed.DistributedMember target)
Callback for moving a primary
|
void |
rebalancingOrRecoveryFinished(com.gemstone.gemfire.cache.Region region)
Log that rebalancing/recovery has finished.
|
void |
rebalancingOrRecoveryStarted(com.gemstone.gemfire.cache.Region region)
Log that rebalancing/recovery has started.
|
void |
recoveryConflated(com.gemstone.gemfire.internal.cache.PartitionedRegion region)
Log that recovery was rejected because it was already in progress.
|
static void |
verifyNoRebalRecov(Object noRebalRecovVMs)
Verify rebalancing/recovery has not run for the given vms.
|
static boolean |
waitForAnyRebalRecovToStart(long millisToWait,
int millisToSleep)
Wait for rebalancing/recovery to start in ANY vm.
|
protected static void |
waitForEachVMToFinish(Object rebalRecovVMs,
int numExpectedActivities,
int numPRsToRebalRecov,
List prNames,
boolean allowConflation)
Wait for vm(s) to finish rebalancing/recovery.
|
static void |
waitForRebalRecov(Object rebalRecovVMs,
int numRecovRebalActivities,
int numPRsToRebalRecov,
List prNames,
Object noRebalRecovVMs,
boolean allowRecovConflation)
Wait for rebalanc/recovery to finish.
|
static boolean |
waitForRebalRecovToStart(int vmID,
long millisToWait,
int millisToSleep)
Wait for rebalancing/recovery to start in a particular vm.
|
static void |
waitForRecovery(long recoveryDelay,
long startupRecoveryDelay,
Object startupRecoveryVMs,
Object departedRecoveryVMs,
int numDepartedRecoveries,
int numPRsToRecover,
List prNames,
Object noRecoveryVMs)
Wait for recovery after a stop and restart.
|
protected static void |
waitForVMToFinish(Object rebalRecovVM,
int numExpectedActivities,
int numPRsToRebalRecov,
List prNames,
boolean allowConflation)
Wait for a vm to finish rebalancing/recovery.
|
public static final String activityListKey
public static final String rebalRecovStarted
public static final String rebalRecovFinished
public static final String movingBucket
public static final String movingPrimary
public static final String recoveryConflated
public void rebalancingOrRecoveryStarted(com.gemstone.gemfire.cache.Region region)
rebalancingOrRecoveryStarted in class com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapterregion - The region that is undergoing rebalancing/recovery.public void rebalancingOrRecoveryFinished(com.gemstone.gemfire.cache.Region region)
rebalancingOrRecoveryFinished in class com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapterregion - The region that finished rebalancing/recovery.public void recoveryConflated(com.gemstone.gemfire.internal.cache.PartitionedRegion region)
recoveryConflated in interface com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverrecoveryConflated in class com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapterpublic void movingBucket(com.gemstone.gemfire.cache.Region region,
int bucketId,
com.gemstone.gemfire.distributed.DistributedMember source,
com.gemstone.gemfire.distributed.DistributedMember target)
movingBucket in interface com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObservermovingBucket in class com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapterpublic void movingPrimary(com.gemstone.gemfire.cache.Region region,
int bucketId,
com.gemstone.gemfire.distributed.DistributedMember source,
com.gemstone.gemfire.distributed.DistributedMember target)
movingPrimary in interface com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObservermovingPrimary in class com.gemstone.gemfire.internal.cache.control.InternalResourceManager.ResourceObserverAdapterpublic static void installObserverHook()
public static void installObserverHook(boolean recordBucketMovesArg,
boolean recordPrimaryMovesArg)
public static void initialize()
public static void initialize(int vmId)
public static boolean waitForRebalRecovToStart(int vmID,
long millisToWait,
int millisToSleep)
vmID - Wait for this vmID to start rebalancing/recovery.millisToWait - The number of milliseconds to wait for rebalancing/recovery to start.millisToSleep - The number of milliseconds to sleep between polling for rebalancing/recovery.public static boolean waitForAnyRebalRecovToStart(long millisToWait,
int millisToSleep)
millisToWait - The number of milliseconds to wait for rebalancing/recovery to start.millisToSleep - The number of milliseconds to sleep between polling for rebalancing/recovery.public static void waitForRebalRecov(Object rebalRecovVMs, int numRecovRebalActivities, int numPRsToRebalRecov, List prNames, Object noRebalRecovVMs, boolean allowRecovConflation)
rebalRecovVMs - The vm(s) expecting rebalancing/recovery.
This can either be a an Integer (a vmID), a ClientVmInfo containing
a vmID, or a List of Integers or ClientVmInfo instances.numRecovRebalActivities - The number of recovery/rebalance activities
each vm should receive.numPRsToRebalRecov - The number of PRs to rebalance/recover in each VM.prNames - A List of Strings, where each string is the name
of the PR to experience rebalanc/recovery. This is optional and can be null.noRebalRecovVMs - The vm(s) expecting no rebalancing/recovery.
This can either be a an Integer (a vmID), a ClientVmInfo containing
a vmID, or a List of Integers or ClientVmInfo instances.
This is optional and can be ull.allowRebalRecovConflation - True if rebalancing/recovery conflation is
allowed to have occurred in the rbalRecovVMs, false otherwise.public static void waitForRecovery(long recoveryDelay,
long startupRecoveryDelay,
Object startupRecoveryVMs,
Object departedRecoveryVMs,
int numDepartedRecoveries,
int numPRsToRecover,
List prNames,
Object noRecoveryVMs)
recoveryDelay - The recovery delay setting for departed vms.startupRecoveryDelay - The startup recovery delay setting.startupRecoveryVMs - The vm(s) expecting startup recovery.
This can either be a an Integer (a vmID), a ClientVmInfo containing
a vmID, or a List of Integers or ClientVmInfo instances.departedRecoveryVMs - The vm(s) expecting departed recovery.
This can either be a an Integer (a vmID), a ClientVmInfo containing
a vmID, or a List of Integers or ClientVmInfo instances.numDepartedRecoveries - The number of recovery activities the
departedRecoveryVMs should receive (usually the number of vms
that departed).numPRsToRecovery - The number of PRs to recovery in the vm.prNames - A List of Strings, where each string is the name
of the PR to experience recovery. This is optional and can be null.noRecoveryVMs - The vm(s) expecting no recovery.
This can either be a an Integer (a vmID), a ClientVmInfo containing
a vmID, or a List of Integers or ClientVmInfo instances.
This is optional and can be ull.public static void verifyNoRebalRecov(Object noRebalRecovVMs)
noRebalRecovVMs - The vm(s) expecting no rebalancing/recovery.
This can either be a an Integer (a vmID), a ClientVmInfo containing
a vmID, or a List of Integers or ClientVmInfo instances.protected static void waitForVMToFinish(Object rebalRecovVM, int numExpectedActivities, int numPRsToRebalRecov, List prNames, boolean allowConflation)
rebalRecovVM - A VM expected to rebalance/recover. This is either
an Integer (vmId) or an instance of ClientVmInfo containing a
vmId.numExpectedActivities - The number of times rebalancing/recovery should
either start/finish, or be conflated.numPRsToRebalRecov - The number of PRs expected to rebalance/recover in
recovRebalVMs.prNames - A List of Strings, which are the names of the PRs expected
for recovery. This is optional and can be null.allowConflation - True if recovery conflation is allowed in
the recoveryVM, false otherwise.protected static void waitForEachVMToFinish(Object rebalRecovVMs, int numExpectedActivities, int numPRsToRebalRecov, List prNames, boolean allowConflation)
rebalRecovVMs - The vm(s) expecting rebalancing/recovery.
This can either be a an Integer (a vmID), a ClientVmInfo containing
a vmID, or a List of Integers or ClientVmInfo instances.numExpectedActivities - The number of times rebalancing/recovery should
either start/finish, or be conflated for each PR in numPRsToRebalRecov.numPRsToRebalRecov - The number of PRs expected to rebalance/recover in
each vm in rebalRecovVMs.prNames - A List of Strings, which are the names of the PRs expected
for rebalancing/recovery. This is optional and can be null.allowConflation - True if recovery conflation is allowed in
the rebalRecovVMs, false otherwise.protected static boolean completedActivities(List activityList, int expectedNumActivities, boolean allowConflatedActivities, int numPRs, List prNames, int vmID)
activityList - A List of Strings containing information about
recovery activities (start/finish/conflated).expectedNumActivities - The number of expected recovery activities.allowConflatedActivities - True if the activities are allowed to
be conflated activities, false otherwise.numPRs - The number of distinct PRs that should rebalance/recover.prNames - A List of PR names the activities must occur for, or null.vmID - The vmID that we are checking activities for.protected void addFinishToActivityList(Date finishDate, long finishTime, com.gemstone.gemfire.cache.Region aRegion)
protected void _addToActivityList(String activityStr)
protected static String activityListToString(List activityList)
activityList - A list of rebalancing/recovery activites.Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.