use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class PutIfAbsentMapMergePolicyTest method merge_existingValueAbsent.
@Test
public void merge_existingValueAbsent() {
EntryView existing = entryWithGivenValue(null);
EntryView merging = entryWithGivenValue(MERGING);
assertEquals(MERGING, policy.merge("map", merging, existing));
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class MapReplicationSupportingService method handleUpdate.
private void handleUpdate(MapReplicationUpdate replicationUpdate) {
EntryView entryView = replicationUpdate.getEntryView();
MapMergePolicy mergePolicy = replicationUpdate.getMergePolicy();
String mapName = replicationUpdate.getMapName();
MapContainer mapContainer = mapServiceContext.getMapContainer(mapName);
MapOperationProvider operationProvider = mapServiceContext.getMapOperationProvider(mapName);
Data dataKey = mapServiceContext.toData(entryView.getKey(), mapContainer.getPartitioningStrategy());
MapOperation operation = operationProvider.createMergeOperation(mapName, dataKey, entryView, mergePolicy, true);
try {
int partitionId = nodeEngine.getPartitionService().getPartitionId(entryView.getKey());
Future f = nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME, operation, partitionId);
f.get();
} catch (Throwable t) {
throw ExceptionUtil.rethrow(t);
}
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class LazyEntryViewFromRecordTest method test_equals.
@Test
public void test_equals() throws Exception {
EntryView entryView = createDefaultEntryView();
assertTrue(view.equals(entryView) && entryView.equals(view));
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class LazyEntryViewFromRecordTest method test_hashCode.
@Test
public void test_hashCode() throws Exception {
EntryView entryView = createDefaultEntryView();
assertEquals(entryView.hashCode(), view.hashCode());
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class ClientMapBasicTest method testGetEntryView.
@Test
public void testGetEntryView() {
IMap<String, String> map = client.getMap(randomString());
String key = "Key";
String value = "Value";
map.put(key, value);
EntryView view = map.getEntryView(key);
assertEquals(key, view.getKey());
assertEquals(value, view.getValue());
}
Aggregations