Search in sources :

Example 1 with PartitionRegionConfig

use of org.apache.geode.internal.cache.PartitionRegionConfig in project geode by apache.

the class FixedPartitioningTestBase method setPRObserverBeforeCalculateStartingBucketId.

public static void setPRObserverBeforeCalculateStartingBucketId() {
    PartitionedRegion.BEFORE_CALCULATE_STARTING_BUCKET_FLAG = true;
    origObserver = PartitionedRegionObserverHolder.setInstance(new PartitionedRegionObserverAdapter() {

        public void beforeCalculatingStartingBucketId() {
            WaitCriterion wc = new WaitCriterion() {

                String excuse;

                public boolean done() {
                    Region prRoot = PartitionedRegionHelper.getPRRoot(cache);
                    PartitionRegionConfig regionConfig = (PartitionRegionConfig) prRoot.get("#Quarter");
                    if (regionConfig == null) {
                        return false;
                    } else {
                        if (!regionConfig.isFirstDataStoreCreated()) {
                            return true;
                        } else {
                            return false;
                        }
                    }
                }

                public String description() {
                    return excuse;
                }
            };
            Wait.waitForCriterion(wc, 20000, 500, false);
            LogWriterUtils.getLogWriter().info("end of beforeCalculatingStartingBucketId");
        }
    });
}
Also used : WaitCriterion(org.apache.geode.test.dunit.WaitCriterion) PartitionRegionConfig(org.apache.geode.internal.cache.PartitionRegionConfig) PartitionedRegion(org.apache.geode.internal.cache.PartitionedRegion) HARegion(org.apache.geode.internal.cache.HARegion) Region(org.apache.geode.cache.Region) PartitionedRegionObserverAdapter(org.apache.geode.internal.cache.partitioned.PartitionedRegionObserverAdapter)

Aggregations

Region (org.apache.geode.cache.Region)1 HARegion (org.apache.geode.internal.cache.HARegion)1 PartitionRegionConfig (org.apache.geode.internal.cache.PartitionRegionConfig)1 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)1 PartitionedRegionObserverAdapter (org.apache.geode.internal.cache.partitioned.PartitionedRegionObserverAdapter)1 WaitCriterion (org.apache.geode.test.dunit.WaitCriterion)1