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 AbstractEvictableRecordStore method sampleAndForceRemoveEntries.
@Override
public void sampleAndForceRemoveEntries(int entryCountToRemove) {
Queue<Data> keysToRemove = new LinkedList<>();
Iterable<EntryView> sample = storage.getRandomSamples(entryCountToRemove);
for (EntryView entryView : sample) {
Data dataKey = storage.extractDataKeyFromLazy(entryView);
keysToRemove.add(dataKey);
}
Data dataKey;
while ((dataKey = keysToRemove.poll()) != null) {
evict(dataKey, true);
}
}
use of com.hazelcast.core.EntryView in project hazelcast by hazelcast.
the class MapProxySupport method getEntryViewInternal.
protected EntryView getEntryViewInternal(Data key) {
int partitionId = partitionService.getPartitionId(key);
MapOperation operation = operationProvider.createGetEntryViewOperation(name, key);
operation.setThreadId(getThreadId());
operation.setServiceName(SERVICE_NAME);
try {
Future future = operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
return (EntryView) toObject(future.get());
} catch (Throwable t) {
throw rethrow(t);
}
}
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());
assertEquals(Long.MAX_VALUE, view.getMaxIdle());
assertEquals(Long.MAX_VALUE, view.getTtl());
}
Aggregations