use of com.hazelcast.map.impl.recordstore.RecordStore in project hazelcast by hazelcast.
the class EntryLoaderSimpleTest method assertInMemory.
private void assertInMemory(HazelcastInstance[] instances, String mapName, String key, String expectedValue) {
InternalPartitionService partitionService = getPartitionService(instances[0]);
int partitionId = partitionService.getPartitionId(key);
Address partitionOwnerAddress = partitionService.getPartitionOwner(partitionId);
HazelcastInstance owner = getInstance(instances, partitionOwnerAddress);
InternalSerializationService serializationService = getSerializationService(owner);
Data keyData = serializationService.toData(key);
NodeEngineImpl nodeEngine = getNodeEngineImpl(owner);
MapService mapService = nodeEngine.getService(MapService.SERVICE_NAME);
RecordStore recordStore = mapService.getMapServiceContext().getPartitionContainer(partitionId).getRecordStore(mapName);
Record record = recordStore.getRecordOrNull(keyData);
Object actualValue = record == null ? null : serializationService.toObject(record.getValue());
assertEquals(expectedValue, actualValue);
}
Aggregations