Search in sources :

Example 1 with GemFireCache

use of org.apache.geode.cache.GemFireCache in project geode by apache.

the class RollingUpgrade2DUnitTest method rebalance.

public static void rebalance(Object cache) throws Exception {
    RebalanceOperation op = ((GemFireCache) cache).getResourceManager().createRebalanceFactory().start();
    // Wait until the rebalance is completex
    RebalanceResults results = op.getResults();
    Method getTotalTimeMethod = results.getClass().getMethod("getTotalTime");
    getTotalTimeMethod.setAccessible(true);
    System.out.println("Took " + results.getTotalTime() + " milliseconds\n");
    System.out.println("Transfered " + results.getTotalBucketTransferBytes() + "bytes\n");
}
Also used : RebalanceOperation(org.apache.geode.cache.control.RebalanceOperation) Method(java.lang.reflect.Method) RebalanceResults(org.apache.geode.cache.control.RebalanceResults) GemFireCache(org.apache.geode.cache.GemFireCache)

Aggregations

Method (java.lang.reflect.Method)1 GemFireCache (org.apache.geode.cache.GemFireCache)1 RebalanceOperation (org.apache.geode.cache.control.RebalanceOperation)1 RebalanceResults (org.apache.geode.cache.control.RebalanceResults)1