use of com.hazelcast.internal.nearcache.NearCacheManager in project hazelcast by hazelcast.
the class ClientMapNearCacheBasicTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
ClientConfig clientConfig = getClientConfig().addNearCacheConfig(nearCacheConfig);
HazelcastInstance member = hazelcastFactory.newHazelcastInstance(getConfig());
HazelcastClientProxy client = (HazelcastClientProxy) hazelcastFactory.newHazelcastClient(clientConfig);
IMap<K, V> memberMap = member.getMap(DEFAULT_NEAR_CACHE_NAME);
IMap<K, V> clientMap = client.getMap(DEFAULT_NEAR_CACHE_NAME);
NearCacheManager nearCacheManager = client.client.getNearCacheManager();
NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
return new NearCacheTestContext<K, V, Data, String>(client.getSerializationService(), client, member, new IMapDataStructureAdapter<K, V>(clientMap), new IMapDataStructureAdapter<K, V>(memberMap), false, nearCache, nearCacheManager);
}
use of com.hazelcast.internal.nearcache.NearCacheManager in project hazelcast by hazelcast.
the class ClientMapNearCacheSerializationCountTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
Config config = getConfig();
config.getMapConfig(DEFAULT_NEAR_CACHE_NAME).setInMemoryFormat(mapInMemoryFormat);
prepareSerializationConfig(config.getSerializationConfig());
ClientConfig clientConfig = getClientConfig();
if (nearCacheConfig != null) {
clientConfig.addNearCacheConfig(nearCacheConfig);
}
prepareSerializationConfig(clientConfig.getSerializationConfig());
HazelcastInstance member = hazelcastFactory.newHazelcastInstance(config);
HazelcastClientProxy client = (HazelcastClientProxy) hazelcastFactory.newHazelcastClient(clientConfig);
IMap<K, V> memberMap = member.getMap(DEFAULT_NEAR_CACHE_NAME);
IMap<K, V> clientMap = client.getMap(DEFAULT_NEAR_CACHE_NAME);
NearCacheManager nearCacheManager = client.client.getNearCacheManager();
NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
return new NearCacheTestContext<K, V, Data, String>(client.getSerializationService(), client, member, new IMapDataStructureAdapter<K, V>(clientMap), new IMapDataStructureAdapter<K, V>(memberMap), false, nearCache, nearCacheManager);
}
use of com.hazelcast.internal.nearcache.NearCacheManager in project hazelcast by hazelcast.
the class ClientReplicatedMapNearCacheBasicTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
Config config = getConfig();
config.getReplicatedMapConfig(DEFAULT_NEAR_CACHE_NAME).setInMemoryFormat(nearCacheConfig.getInMemoryFormat());
ClientConfig clientConfig = getClientConfig().addNearCacheConfig(nearCacheConfig);
HazelcastInstance member = hazelcastFactory.newHazelcastInstance(config);
HazelcastClientProxy client = (HazelcastClientProxy) hazelcastFactory.newHazelcastClient(clientConfig);
ReplicatedMap<K, V> memberMap = member.getReplicatedMap(DEFAULT_NEAR_CACHE_NAME);
ReplicatedMap<K, V> clientMap = client.getReplicatedMap(DEFAULT_NEAR_CACHE_NAME);
NearCacheManager nearCacheManager = client.client.getNearCacheManager();
NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
return new NearCacheTestContext<K, V, Data, String>(client.getSerializationService(), client, member, new ReplicatedMapDataStructureAdapter<K, V>(clientMap), new ReplicatedMapDataStructureAdapter<K, V>(memberMap), false, nearCache, nearCacheManager);
}
use of com.hazelcast.internal.nearcache.NearCacheManager in project hazelcast by hazelcast.
the class LiteMemberMapNearCacheBasicTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
HazelcastInstance member = hazelcastFactory.newHazelcastInstance(createConfig(nearCacheConfig, false));
HazelcastInstance liteMember = hazelcastFactory.newHazelcastInstance(createConfig(nearCacheConfig, true));
IMap<K, V> memberMap = member.getMap(DEFAULT_NEAR_CACHE_NAME);
IMap<K, V> liteMemberMap = liteMember.getMap(DEFAULT_NEAR_CACHE_NAME);
NearCacheManager nearCacheManager = getMapNearCacheManager(liteMember);
NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
return new NearCacheTestContext<K, V, Data, String>(getSerializationService(member), liteMember, member, new IMapDataStructureAdapter<K, V>(liteMemberMap), new IMapDataStructureAdapter<K, V>(memberMap), true, nearCache, nearCacheManager);
}
use of com.hazelcast.internal.nearcache.NearCacheManager in project hazelcast by hazelcast.
the class MapNearCacheBasicTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
Config config = getConfig();
config.getMapConfig(DEFAULT_NEAR_CACHE_NAME).setNearCacheConfig(nearCacheConfig);
HazelcastInstance[] instances = hazelcastFactory.newInstances(config);
HazelcastInstance member = instances[0];
IMap<K, V> map = member.getMap(DEFAULT_NEAR_CACHE_NAME);
NearCacheManager nearCacheManager = getMapNearCacheManager(member);
NearCache<Data, String> nearCache = nearCacheManager.getNearCache(DEFAULT_NEAR_CACHE_NAME);
return new NearCacheTestContext<K, V, Data, String>(getSerializationService(member), member, new IMapDataStructureAdapter<K, V>(map), true, nearCache, nearCacheManager);
}
Aggregations