Search in sources :

Example 11 with IMapDataStructureAdapter

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

the class ClientMapNearCacheBasicTest method createContext.

@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext(boolean loaderEnabled) {
    IMapMapStore mapStore = loaderEnabled ? new IMapMapStore() : null;
    Config config = getConfig();
    addMapStoreConfig(mapStore, config.getMapConfig(DEFAULT_NEAR_CACHE_NAME));
    HazelcastInstance member = hazelcastFactory.newHazelcastInstance(config);
    IMap<K, V> memberMap = member.getMap(DEFAULT_NEAR_CACHE_NAME);
    IMapDataStructureAdapter<K, V> dataAdapter = new IMapDataStructureAdapter<K, V>(memberMap);
    // wait until the initial load is done
    dataAdapter.waitUntilLoaded();
    NearCacheTestContextBuilder<K, V, Data, String> builder = createNearCacheContextBuilder();
    return builder.setDataInstance(member).setDataAdapter(dataAdapter).setLoader(mapStore).build();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) MapNearCacheBasicTest.addMapStoreConfig(com.hazelcast.map.impl.nearcache.MapNearCacheBasicTest.addMapStoreConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) Config(com.hazelcast.config.Config) NearCacheTestUtils.createNearCacheConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig) NearCacheTestUtils.getBaseConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig) IMapDataStructureAdapter(com.hazelcast.internal.adapter.IMapDataStructureAdapter) Data(com.hazelcast.internal.serialization.Data) IMapMapStore(com.hazelcast.internal.adapter.IMapMapStore)

Example 12 with IMapDataStructureAdapter

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

the class LiteMemberMapNearCacheBasicTest method createContext.

@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext(boolean loaderEnabled) {
    IMapMapStore mapStore = loaderEnabled ? new IMapMapStore() : null;
    Config config = getConfig(mapStore, false);
    HazelcastInstance member = hazelcastFactory.newHazelcastInstance(config);
    IMap<K, V> memberMap = member.getMap(DEFAULT_NEAR_CACHE_NAME);
    IMapDataStructureAdapter<K, V> dataAdapter = new IMapDataStructureAdapter<K, V>(memberMap);
    // wait until the initial load is done
    dataAdapter.waitUntilLoaded();
    NearCacheTestContextBuilder<K, V, Data, String> builder = createNearCacheContextBuilder(mapStore);
    return builder.setDataInstance(member).setDataAdapter(dataAdapter).build();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) MapNearCacheBasicTest.addMapStoreConfig(com.hazelcast.map.impl.nearcache.MapNearCacheBasicTest.addMapStoreConfig) MapConfig(com.hazelcast.config.MapConfig) Config(com.hazelcast.config.Config) NearCacheTestUtils.createNearCacheConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig) NearCacheTestUtils.getBaseConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig) IMapDataStructureAdapter(com.hazelcast.internal.adapter.IMapDataStructureAdapter) Data(com.hazelcast.internal.serialization.Data) IMapMapStore(com.hazelcast.internal.adapter.IMapMapStore)

Example 13 with IMapDataStructureAdapter

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

the class LiteMemberMapNearCacheSerializationCountTest method createContext.

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

Example 14 with IMapDataStructureAdapter

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

the class LiteMemberMapNearCacheLeakTest method createContext.

@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
    Config config = getConfig(false);
    HazelcastInstance member = hazelcastFactory.newHazelcastInstance(config);
    IMap<K, V> memberMap = member.getMap(DEFAULT_NEAR_CACHE_NAME);
    IMapDataStructureAdapter<K, V> dataAdapter = new IMapDataStructureAdapter<K, V>(memberMap);
    // wait until the initial load is done
    dataAdapter.waitUntilLoaded();
    NearCacheTestContextBuilder<K, V, Data, String> builder = createNearCacheContextBuilder();
    return builder.setDataInstance(member).setDataAdapter(dataAdapter).build();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) MapConfig(com.hazelcast.config.MapConfig) Config(com.hazelcast.config.Config) NearCacheTestUtils.createNearCacheConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig) NearCacheTestUtils.getBaseConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig) IMapDataStructureAdapter(com.hazelcast.internal.adapter.IMapDataStructureAdapter) Data(com.hazelcast.internal.serialization.Data)

Example 15 with IMapDataStructureAdapter

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

the class MapNearCacheLeakTest method createContext.

@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
    Config config = getConfig(false);
    HazelcastInstance dataInstance = hazelcastFactory.newHazelcastInstance(config);
    IMap<K, V> dataMap = dataInstance.getMap(DEFAULT_NEAR_CACHE_NAME);
    IMapDataStructureAdapter<K, V> dataAdapter = new IMapDataStructureAdapter<K, V>(dataMap);
    // wait until the initial load is done
    dataAdapter.waitUntilLoaded();
    NearCacheTestContextBuilder<K, V, Data, String> builder = createNearCacheContextBuilder();
    return builder.setDataInstance(dataInstance).setDataAdapter(dataAdapter).build();
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) MapConfig(com.hazelcast.config.MapConfig) Config(com.hazelcast.config.Config) NearCacheTestUtils.createNearCacheConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig) NearCacheTestUtils.getBaseConfig(com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig) IMapDataStructureAdapter(com.hazelcast.internal.adapter.IMapDataStructureAdapter) Data(com.hazelcast.internal.serialization.Data)

Aggregations

IMapDataStructureAdapter (com.hazelcast.internal.adapter.IMapDataStructureAdapter)15 Data (com.hazelcast.internal.serialization.Data)14 Config (com.hazelcast.config.Config)12 HazelcastInstance (com.hazelcast.core.HazelcastInstance)12 NearCacheTestUtils.getBaseConfig (com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getBaseConfig)12 NearCacheTestUtils.createNearCacheConfig (com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.createNearCacheConfig)11 MapConfig (com.hazelcast.config.MapConfig)8 ClientConfig (com.hazelcast.client.config.ClientConfig)7 NearCacheManager (com.hazelcast.internal.nearcache.NearCacheManager)5 MapNearCacheBasicTest.addMapStoreConfig (com.hazelcast.map.impl.nearcache.MapNearCacheBasicTest.addMapStoreConfig)5 IMapMapStore (com.hazelcast.internal.adapter.IMapMapStore)4 NearCacheTestUtils.getMapNearCacheManager (com.hazelcast.internal.nearcache.impl.NearCacheTestUtils.getMapNearCacheManager)3 HazelcastClientProxy (com.hazelcast.client.impl.clientside.HazelcastClientProxy)2 RepairingTask (com.hazelcast.internal.nearcache.impl.invalidation.RepairingTask)2 ClientContext (com.hazelcast.client.impl.spi.ClientContext)1 ClientProxy (com.hazelcast.client.impl.spi.ClientProxy)1 ClientContext (com.hazelcast.client.spi.ClientContext)1 MapStoreConfig (com.hazelcast.config.MapStoreConfig)1 NearCacheConfig (com.hazelcast.config.NearCacheConfig)1