use of com.hazelcast.internal.adapter.IMapMapStore in project hazelcast by hazelcast.
the class MapNearCacheBasicTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext(boolean loaderEnabled) {
IMapMapStore mapStore = loaderEnabled ? new IMapMapStore() : null;
Config config = createConfig(mapStore, 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(mapStore);
return builder.setDataInstance(dataInstance).setDataAdapter(dataAdapter).build();
}
use of com.hazelcast.internal.adapter.IMapMapStore 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();
}
use of com.hazelcast.internal.adapter.IMapMapStore in project hazelcast by hazelcast.
the class LiteMemberClientMapNearCacheBasicTest 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);
ClientConfig clientConfig = getClientConfig();
// create a Hazelcast member to hold the data
hazelcastFactory.newHazelcastInstance(config);
// create a Hazelcast client to be used in the tests
HazelcastClientProxy client = (HazelcastClientProxy) hazelcastFactory.newHazelcastClient(clientConfig);
IMap<K, V> clientMap = client.getMap(DEFAULT_NEAR_CACHE_NAME);
IMapDataStructureAdapter<K, V> dataAdapter = new IMapDataStructureAdapter<K, V>(clientMap);
// wait until the initial load is done
dataAdapter.waitUntilLoaded();
NearCacheTestContextBuilder<K, V, Data, String> builder = createNearCacheContextBuilder(mapStore);
return builder.setDataInstance(client).setDataAdapter(dataAdapter).setLoader(mapStore).build();
}
use of com.hazelcast.internal.adapter.IMapMapStore 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();
}
Aggregations