Search in sources :

Example 1 with TransactionalMapDataStructureAdapter

use of com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter in project hazelcast by hazelcast.

the class TxnMapNearCacheLeakTest method createContext.

@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
    Config config = getConfig(false);
    HazelcastInstance dataInstance = hazelcastFactory.newHazelcastInstance(config);
    TransactionalMapDataStructureAdapter<K, V> dataAdapter = new TransactionalMapDataStructureAdapter<K, V>(dataInstance, DEFAULT_NEAR_CACHE_NAME);
    NearCacheTestContextBuilder<K, V, Data, String> builder = createNearCacheContextBuilder();
    return builder.setDataInstance(dataInstance).setDataAdapter(dataAdapter).build();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) NearCacheTestUtils.createNearCacheConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig) NearCacheTestUtils.getBaseConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig) TransactionalMapDataStructureAdapter(com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter) Data(com.hazelcast.internal.serialization.Data)

Example 2 with TransactionalMapDataStructureAdapter

use of com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter in project hazelcast by hazelcast.

the class TxnMapNearCacheBasicTest method createContext.

@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext(boolean loaderEnabled) {
    Config config = getConfig(false);
    HazelcastInstance dataInstance = hazelcastFactory.newHazelcastInstance(config);
    TransactionalMapDataStructureAdapter<K, V> dataAdapter = new TransactionalMapDataStructureAdapter<K, V>(dataInstance, DEFAULT_NEAR_CACHE_NAME);
    NearCacheTestContextBuilder<K, V, Data, String> builder = createNearCacheContextBuilder();
    return builder.setDataInstance(dataInstance).setDataAdapter(dataAdapter).build();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) NearCacheTestUtils.createNearCacheConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig) NearCacheTestUtils.getBaseConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig) TransactionalMapDataStructureAdapter(com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter) Data(com.hazelcast.internal.serialization.Data)

Example 3 with TransactionalMapDataStructureAdapter

use of com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter in project hazelcast by hazelcast.

the class TxnMapNearCacheLeakTest method createNearCacheContextBuilder.

private <K, V> NearCacheTestContextBuilder<K, V, Data, String> createNearCacheContextBuilder() {
    Config configWithNearCache = getConfig(true);
    HazelcastInstance nearCacheInstance = hazelcastFactory.newHazelcastInstance(configWithNearCache);
    nearCacheInstance.getMap(DEFAULT_NEAR_CACHE_NAME);
    NearCacheManager nearCacheManager = getMapNearCacheManager(nearCacheInstance);
    NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
    RepairingTask repairingTask = ((MapNearCacheManager) nearCacheManager).getRepairingTask();
    return new NearCacheTestContextBuilder<K, V, Data, String>(nearCacheConfig, getSerializationService(nearCacheInstance)).setNearCacheInstance(nearCacheInstance).setNearCacheAdapter(new TransactionalMapDataStructureAdapter<K, V>(nearCacheInstance, DEFAULT_NEAR_CACHE_NAME)).setNearCache(nearCache).setNearCacheManager(nearCacheManager).setRepairingTask(repairingTask);
}
Also used : NearCacheTestUtils.getMapNearCacheManager(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getMapNearCacheManager) MapNearCacheManager(com.hazelcast.map.impl.nearcache.MapNearCacheManager) HazelcastInstance(com.hazelcast.core.HazelcastInstance) NearCacheTestUtils.getMapNearCacheManager(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getMapNearCacheManager) NearCacheManager(com.hazelcast.internal.nearcache.NearCacheManager) MapNearCacheManager(com.hazelcast.map.impl.nearcache.MapNearCacheManager) RepairingTask(com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask) Config(com.hazelcast.config.Config) NearCacheTestUtils.createNearCacheConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig) NearCacheTestUtils.getBaseConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig) TransactionalMapDataStructureAdapter(com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter) Data(com.hazelcast.internal.serialization.Data)

Example 4 with TransactionalMapDataStructureAdapter

use of com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter in project hazelcast by hazelcast.

the class TxnMapNearCacheSerializationCountTest method createContext.

@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
    HazelcastInstance dataMember = hazelcastFactory.newHazelcastInstance(getConfig(false));
    NearCacheTestContextBuilder<K, V, Data, String> builder = createNearCacheContextBuilder();
    return builder.setDataInstance(dataMember).setDataAdapter(new TransactionalMapDataStructureAdapter<K, V>(dataMember, DEFAULT_NEAR_CACHE_NAME)).build();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) TransactionalMapDataStructureAdapter(com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter) Data(com.hazelcast.internal.serialization.Data)

Aggregations

HazelcastInstance (com.hazelcast.core.HazelcastInstance)4 TransactionalMapDataStructureAdapter (com.hazelcast.internal.adapter.TransactionalMapDataStructureAdapter)4 Data (com.hazelcast.internal.serialization.Data)4 Config (com.hazelcast.config.Config)3 NearCacheTestUtils.createNearCacheConfig (com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig)3 NearCacheTestUtils.getBaseConfig (com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig)3 NearCacheManager (com.hazelcast.internal.nearcache.NearCacheManager)1 NearCacheTestUtils.getMapNearCacheManager (com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getMapNearCacheManager)1 RepairingTask (com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask)1 MapNearCacheManager (com.hazelcast.map.impl.nearcache.MapNearCacheManager)1