use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class MapProxySupport method getAsyncInternal.
protected InternalCompletableFuture<Data> getAsyncInternal(Data key) {
int partitionId = partitionService.getPartitionId(key);
MapOperation operation = operationProvider.createGetOperation(name, key);
try {
long startTime = System.currentTimeMillis();
InternalCompletableFuture<Data> future = operationService.createInvocationBuilder(SERVICE_NAME, operation, partitionId).setResultDeserialized(false).invoke();
if (statisticsEnabled) {
future.andThen(new IncrementStatsExecutionCallback<Data>(operation, startTime));
}
return future;
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class MapProxySupport method putAsyncInternal.
protected InternalCompletableFuture<Data> putAsyncInternal(Data key, Data value, long ttl, TimeUnit timeunit) {
int partitionId = getNodeEngine().getPartitionService().getPartitionId(key);
MapOperation operation = operationProvider.createPutOperation(name, key, value, getTimeInMillis(ttl, timeunit));
operation.setThreadId(ThreadUtil.getThreadId());
try {
long startTime = System.currentTimeMillis();
InternalCompletableFuture<Data> future = operationService.invokeOnPartition(SERVICE_NAME, operation, partitionId);
if (statisticsEnabled) {
future.andThen(new IncrementStatsExecutionCallback<Data>(operation, startTime));
}
return future;
} catch (Throwable t) {
throw rethrow(t);
}
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class NearCachedMapProxyImpl method executeOnEntriesInternal.
@Override
public void executeOnEntriesInternal(EntryProcessor entryProcessor, Predicate predicate, List<Data> resultingKeyValuePairs) {
super.executeOnEntriesInternal(entryProcessor, predicate, resultingKeyValuePairs);
for (int i = 0; i < resultingKeyValuePairs.size(); i += 2) {
Data key = resultingKeyValuePairs.get(i);
invalidateCache(key);
}
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class NearCachedMapProxyImpl method getCachedValues.
private void getCachedValues(List<Data> keys, List<Object> resultingKeyValuePairs) {
Iterator<Data> iterator = keys.iterator();
while (iterator.hasNext()) {
Data key = iterator.next();
Object value = getCachedValue(key, true);
if (value == null || value == NOT_CACHED) {
continue;
}
resultingKeyValuePairs.add(toObject(key));
resultingKeyValuePairs.add(toObject(value));
iterator.remove();
}
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class NearCachedMapProxyImpl method removeInternal.
@Override
protected Data removeInternal(Data key) {
Data data = super.removeInternal(key);
invalidateCache(key);
return data;
}
Aggregations