Search in sources :

Example 6 with DefaultNearCache

use of com.hazelcast.internal.nearcache.impl.DefaultNearCache in project hazelcast by hazelcast.

the class MemberMapRecordStateStressTest method assertFinalRecordStateIsReadPermitted.

private void assertFinalRecordStateIsReadPermitted(HazelcastInstance member, NearCache nearCache) {
    InternalSerializationService ss = getSerializationService(member);
    DefaultNearCache unwrap = (DefaultNearCache) nearCache.unwrap(DefaultNearCache.class);
    for (int i = 0; i < KEY_SPACE; i++) {
        Data key = ss.toData(i);
        AbstractNearCacheRecordStore nearCacheRecordStore = (AbstractNearCacheRecordStore) unwrap.getNearCacheRecordStore();
        NearCacheRecord record = nearCacheRecordStore.getRecord(key);
        if (record != null) {
            assertEquals(record.toString(), READ_PERMITTED, record.getRecordState());
        }
    }
}
Also used : DefaultNearCache(com.hazelcast.internal.nearcache.impl.DefaultNearCache) NearCacheRecord(com.hazelcast.internal.nearcache.NearCacheRecord) Data(com.hazelcast.nio.serialization.Data) AbstractNearCacheRecordStore(com.hazelcast.internal.nearcache.impl.store.AbstractNearCacheRecordStore) InternalSerializationService(com.hazelcast.internal.serialization.InternalSerializationService)

Example 7 with DefaultNearCache

use of com.hazelcast.internal.nearcache.impl.DefaultNearCache in project hazelcast by hazelcast.

the class ClientCacheNearCacheRecordStateStressTest method assertFinalRecordStateIsReadPermitted.

private static void assertFinalRecordStateIsReadPermitted(Cache clientCache) {
    NearCachedClientCacheProxy proxy = (NearCachedClientCacheProxy) clientCache;
    DefaultNearCache nearCache = (DefaultNearCache) proxy.getNearCache().unwrap(DefaultNearCache.class);
    assertNearCacheRecordStates(nearCache, KEY_SPACE);
}
Also used : DefaultNearCache(com.hazelcast.internal.nearcache.impl.DefaultNearCache)

Example 8 with DefaultNearCache

use of com.hazelcast.internal.nearcache.impl.DefaultNearCache in project hazelcast by hazelcast.

the class MapNearCacheRecordStateStressTest method assertFinalRecordStateIsReadPermitted.

private static void assertFinalRecordStateIsReadPermitted(IMap memberMap) {
    NearCachedMapProxyImpl proxy = (NearCachedMapProxyImpl) memberMap;
    DefaultNearCache nearCache = (DefaultNearCache) proxy.getNearCache().unwrap(DefaultNearCache.class);
    assertNearCacheRecordStates(nearCache, KEY_SPACE);
}
Also used : DefaultNearCache(com.hazelcast.internal.nearcache.impl.DefaultNearCache) NearCachedMapProxyImpl(com.hazelcast.map.impl.proxy.NearCachedMapProxyImpl)

Aggregations

DefaultNearCache (com.hazelcast.internal.nearcache.impl.DefaultNearCache)8 NearCacheRecord (com.hazelcast.internal.nearcache.NearCacheRecord)5 AbstractNearCacheRecordStore (com.hazelcast.internal.nearcache.impl.store.AbstractNearCacheRecordStore)5 Data (com.hazelcast.nio.serialization.Data)4 NearCache (com.hazelcast.internal.nearcache.NearCache)3 CacheEventHandler (com.hazelcast.cache.impl.CacheEventHandler)2 ClientCacheProxy (com.hazelcast.client.cache.impl.ClientCacheProxy)2 ClientConfig (com.hazelcast.client.config.ClientConfig)2 CacheConfig (com.hazelcast.config.CacheConfig)2 Config (com.hazelcast.config.Config)2 NearCacheConfig (com.hazelcast.config.NearCacheConfig)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 MetaDataContainer (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataContainer)2 MetaDataGenerator (com.hazelcast.internal.nearcache.impl.invalidation.MetaDataGenerator)2 InternalSerializationService (com.hazelcast.internal.serialization.InternalSerializationService)2 AssertTask (com.hazelcast.test.AssertTask)2 NightlyTest (com.hazelcast.test.annotation.NightlyTest)2 ArrayList (java.util.ArrayList)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 CacheManager (javax.cache.CacheManager)2