use of com.hazelcast.internal.nearcache.NearCacheManager in project hazelcast by hazelcast.
the class TxnMapNearCacheBasicTest 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];
// this creates the Near Cache instance
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 TransactionalMapDataStructureAdapter<K, V>(member, DEFAULT_NEAR_CACHE_NAME), false, nearCache, nearCacheManager);
}
use of com.hazelcast.internal.nearcache.NearCacheManager in project hazelcast by hazelcast.
the class TxnMapNearCacheSerializationCountTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
Config config = getConfig();
MapConfig mapConfig = config.getMapConfig(DEFAULT_NEAR_CACHE_NAME).setInMemoryFormat(mapInMemoryFormat);
if (nearCacheConfig != null) {
mapConfig.setNearCacheConfig(nearCacheConfig);
}
prepareSerializationConfig(config.getSerializationConfig());
HazelcastInstance[] instances = hazelcastFactory.newInstances(config);
HazelcastInstance member = instances[0];
// this creates the Near Cache instance
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 TransactionalMapDataStructureAdapter<K, V>(member, DEFAULT_NEAR_CACHE_NAME), false, nearCache, nearCacheManager);
}
use of com.hazelcast.internal.nearcache.NearCacheManager 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));
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 MapNearCacheSerializationCountTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
Config config = getConfig();
MapConfig mapConfig = config.getMapConfig(DEFAULT_NEAR_CACHE_NAME).setInMemoryFormat(mapInMemoryFormat);
if (nearCacheConfig != null) {
mapConfig.setNearCacheConfig(nearCacheConfig);
}
prepareSerializationConfig(config.getSerializationConfig());
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);
}
use of com.hazelcast.internal.nearcache.NearCacheManager in project hazelcast by hazelcast.
the class ClientReplicatedMapNearCacheSerializationCountTest method createContext.
@Override
protected <K, V> NearCacheTestContext<K, V, Data, String> createContext() {
Config config = getConfig();
config.getReplicatedMapConfig(DEFAULT_NEAR_CACHE_NAME).setInMemoryFormat(replicatedMapInMemoryFormat);
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);
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);
}
Aggregations