Search in sources :

Example 6 with ClientUpdateMessage

use of org.apache.geode.internal.cache.tier.sockets.ClientUpdateMessage in project geode by apache.

the class HARQueueNewImplDUnitTest method verifyNullValuesInCMR.

public static void verifyNullValuesInCMR(final Integer numOfEntries, final Integer port, String[] keys) {
    final Region msgsRegion = cache.getRegion(CacheServerImpl.generateNameForClientMsgsRegion(port.intValue()));
    WaitCriterion wc = new WaitCriterion() {

        String excuse;

        @Override
        public boolean done() {
            int sz = msgsRegion.size();
            return sz == numOfEntries.intValue();
        }

        @Override
        public String description() {
            return excuse;
        }
    };
    waitForCriterion(wc, 60 * 1000, 1000, true);
    Set entries = msgsRegion.entrySet();
    Iterator iter = entries.iterator();
    for (; iter.hasNext(); ) {
        Region.Entry entry = (Region.Entry) iter.next();
        ClientUpdateMessage cum = (ClientUpdateMessage) entry.getValue();
        for (int i = 0; i < keys.length; i++) {
            logger.fine("cum.key: " + cum.getKeyToConflate());
            // assert that the keys are not present in entries set
            assertTrue(!keys[i].equals(cum.getKeyToConflate()));
        }
    }
}
Also used : ClientUpdateMessage(org.apache.geode.internal.cache.tier.sockets.ClientUpdateMessage) WaitCriterion(org.apache.geode.test.dunit.WaitCriterion) Set(java.util.Set) Iterator(java.util.Iterator) LocalRegion(org.apache.geode.internal.cache.LocalRegion) Region(org.apache.geode.cache.Region)

Example 7 with ClientUpdateMessage

use of org.apache.geode.internal.cache.tier.sockets.ClientUpdateMessage in project geode by apache.

the class HARQueueNewImplDUnitTest method makeValuesOfSomeKeysNullInClientMsgsRegion.

public static void makeValuesOfSomeKeysNullInClientMsgsRegion(Integer port, String[] keys) {
    Region msgsRegion = cache.getRegion(CacheServerImpl.generateNameForClientMsgsRegion(port.intValue()));
    assertNotNull(msgsRegion);
    Set entries = msgsRegion.entrySet();
    Iterator iter = entries.iterator();
    deletedValues = new Object[keys.length];
    while (iter.hasNext()) {
        Region.Entry entry = (Region.Entry) iter.next();
        ClientUpdateMessage cum = (ClientUpdateMessage) entry.getValue();
        for (int i = 0; i < keys.length; i++) {
            if (keys[i].equals(cum.getKeyToConflate())) {
                logger.fine("HARQueueNewImplDUnit: Removing " + cum.getKeyOfInterest());
                deletedValues[i] = msgsRegion.remove(entry.getKey());
            }
        }
    }
}
Also used : ClientUpdateMessage(org.apache.geode.internal.cache.tier.sockets.ClientUpdateMessage) Set(java.util.Set) Iterator(java.util.Iterator) LocalRegion(org.apache.geode.internal.cache.LocalRegion) Region(org.apache.geode.cache.Region)

Aggregations

ClientUpdateMessage (org.apache.geode.internal.cache.tier.sockets.ClientUpdateMessage)7 Iterator (java.util.Iterator)3 Region (org.apache.geode.cache.Region)3 LocalRegion (org.apache.geode.internal.cache.LocalRegion)3 Set (java.util.Set)2 FilterInfo (org.apache.geode.internal.cache.FilterRoutingInfo.FilterInfo)2 HAEventWrapper (org.apache.geode.internal.cache.tier.sockets.HAEventWrapper)2 IOException (java.io.IOException)1 ConcurrentModificationException (java.util.ConcurrentModificationException)1 NoSuchElementException (java.util.NoSuchElementException)1 CancelException (org.apache.geode.CancelException)1 InternalGemFireException (org.apache.geode.InternalGemFireException)1 CacheException (org.apache.geode.cache.CacheException)1 CacheWriterException (org.apache.geode.cache.CacheWriterException)1 EntryNotFoundException (org.apache.geode.cache.EntryNotFoundException)1 RegionDestroyedException (org.apache.geode.cache.RegionDestroyedException)1 TimeoutException (org.apache.geode.cache.TimeoutException)1 CqQueryVsdStats (org.apache.geode.cache.query.internal.CqQueryVsdStats)1 CqService (org.apache.geode.cache.query.internal.cq.CqService)1 InternalCqQuery (org.apache.geode.cache.query.internal.cq.InternalCqQuery)1