use of com.hazelcast.cache.impl.ICacheRecordStore in project hazelcast by hazelcast.
the class CacheRecordStoreTest method putObjectAndGetDataFromCacheRecordStore.
@Test
public void putObjectAndGetDataFromCacheRecordStore() {
ICacheRecordStore cacheRecordStore = createCacheRecordStore(InMemoryFormat.BINARY);
putAndGetFromCacheRecordStore(cacheRecordStore, InMemoryFormat.BINARY);
}
use of com.hazelcast.cache.impl.ICacheRecordStore in project hazelcast by hazelcast.
the class CacheRecordStoreTestSupport method createCacheRecordStore.
protected ICacheRecordStore createCacheRecordStore(HazelcastInstance instance, String cacheName, int partitionId, InMemoryFormat inMemoryFormat) {
NodeEngine nodeEngine = getNodeEngine(instance);
ICacheService cacheService = getCacheService(instance);
CacheConfig cacheConfig = createCacheConfig(cacheName, inMemoryFormat);
cacheService.putCacheConfigIfAbsent(cacheConfig);
return new CacheRecordStore(CACHE_NAME_PREFIX + cacheName, partitionId, nodeEngine, (AbstractCacheService) cacheService);
}
use of com.hazelcast.cache.impl.ICacheRecordStore in project hazelcast by hazelcast.
the class CacheGetAllOperation method run.
public void run() {
ICacheService service = getService();
ICacheRecordStore cache = service.getOrCreateRecordStore(name, getPartitionId());
int partitionId = getPartitionId();
Set<Data> partitionKeySet = new HashSet<Data>();
for (Data key : keys) {
if (partitionId == getNodeEngine().getPartitionService().getPartitionId(key)) {
partitionKeySet.add(key);
}
}
response = cache.getAll(partitionKeySet, expiryPolicy);
}
use of com.hazelcast.cache.impl.ICacheRecordStore in project hazelcast by hazelcast.
the class CacheReplicationOperation method run.
@Override
public void run() throws Exception {
ICacheService service = getService();
for (Map.Entry<String, Map<Data, CacheRecord>> entry : data.entrySet()) {
ICacheRecordStore cache = service.getOrCreateRecordStore(entry.getKey(), getPartitionId());
cache.clear();
Map<Data, CacheRecord> map = entry.getValue();
Iterator<Map.Entry<Data, CacheRecord>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Data, CacheRecord> next = iterator.next();
Data key = next.getKey();
CacheRecord record = next.getValue();
iterator.remove();
cache.putRecord(key, record);
}
}
data.clear();
if (getReplicaIndex() == 0) {
nearCacheStateHolder.applyState();
}
}
use of com.hazelcast.cache.impl.ICacheRecordStore in project hazelcast by hazelcast.
the class CacheRecordStoreTest method putObjectAndGetObjectFromCacheRecordStore.
@Test
public void putObjectAndGetObjectFromCacheRecordStore() {
ICacheRecordStore cacheRecordStore = createCacheRecordStore(InMemoryFormat.OBJECT);
putAndGetFromCacheRecordStore(cacheRecordStore, InMemoryFormat.OBJECT);
}
Aggregations