use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class ClientQueryCacheEndToEndConstructor method createPublishAccumulatorWithIncludeValue.
private void createPublishAccumulatorWithIncludeValue(AccumulatorInfo info) {
Data data = context.getSerializationService().toData(info.getPredicate());
ClientMessage request = ContinuousQueryPublisherCreateWithValueCodec.encodeRequest(info.getMapName(), info.getCacheName(), data, info.getBatchSize(), info.getBufferSize(), info.getDelaySeconds(), info.isPopulate(), info.isCoalesce());
InvokerWrapper invokerWrapper = context.getInvokerWrapper();
ClientMessage response = (ClientMessage) invokerWrapper.invoke(request);
Collection<Map.Entry<Data, Data>> result = ContinuousQueryPublisherCreateWithValueCodec.decodeResponse(response).response;
populateWithValues(queryCache, result);
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class ClientExecutorServiceProxy method retrieveResultFromMessage.
private Object retrieveResultFromMessage(ClientInvocationFuture f) {
Object response;
try {
SerializationService serializationService = getClient().getSerializationService();
Data data = ExecutorServiceSubmitToAddressCodec.decodeResponse(f.get()).response;
response = serializationService.toObject(data);
} catch (Exception e) {
response = e;
}
return response;
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class ClientListProxy method addAll.
@Override
public boolean addAll(int index, Collection<? extends E> c) {
Preconditions.checkNotNull(c);
Collection<Data> dataCollection = CollectionUtil.objectToDataCollection(c, getSerializationService());
ClientMessage request = ListAddAllWithIndexCodec.encodeRequest(name, index, dataCollection);
ClientMessage response = invokeOnPartition(request);
ListAddAllWithIndexCodec.ResponseParameters resultParameters = ListAddAllWithIndexCodec.decodeResponse(response);
return resultParameters.response;
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class ClientListProxy method addAll.
@Override
public boolean addAll(Collection<? extends E> c) {
Preconditions.checkNotNull(c);
Collection<Data> dataCollection = CollectionUtil.objectToDataCollection(c, getSerializationService());
ClientMessage request = ListAddAllCodec.encodeRequest(name, dataCollection);
ClientMessage response = invokeOnPartition(request);
ListAddAllCodec.ResponseParameters resultParameters = ListAddAllCodec.decodeResponse(response);
return resultParameters.response;
}
use of com.hazelcast.nio.serialization.Data in project hazelcast by hazelcast.
the class AbstractMapPartitionIterator method remove.
public void remove() {
if (result == null || currentIndex < 0) {
throw new IllegalStateException("Iterator.next() must be called before remove()!");
}
Data keyData = getKey(currentIndex);
map.remove(keyData);
currentIndex = -1;
}
Aggregations