use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method size.
@Override
public int size() {
ClientMessage request = MapSizeCodec.encodeRequest(name);
ClientMessage response = invoke(request);
MapSizeCodec.ResponseParameters resultParameters = MapSizeCodec.decodeResponse(response);
return resultParameters.response;
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method entrySet.
@Override
public Set<Entry<K, V>> entrySet() {
ClientMessage request = MapEntrySetCodec.encodeRequest(name);
ClientMessage response = invoke(request);
MapEntrySetCodec.ResponseParameters resultParameters = MapEntrySetCodec.decodeResponse(response);
InflatableSet.Builder<Entry<K, V>> setBuilder = InflatableSet.newBuilder(resultParameters.response.size());
InternalSerializationService serializationService = ((InternalSerializationService) getContext().getSerializationService());
for (Entry<Data, Data> row : resultParameters.response) {
LazyMapEntry entry = new LazyMapEntry(row.getKey(), row.getValue(), serializationService);
setBuilder.add(entry);
}
return setBuilder.build();
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method keySet.
@Override
@SuppressWarnings("unchecked")
public Set<K> keySet(Predicate predicate) {
checkNotNull(predicate, NULL_PREDICATE_IS_NOT_ALLOWED);
if (predicate instanceof PagingPredicate) {
return keySetWithPagingPredicate((PagingPredicate) predicate);
}
ClientMessage request = MapKeySetWithPredicateCodec.encodeRequest(name, toData(predicate));
ClientMessage response = invoke(request);
MapKeySetWithPredicateCodec.ResponseParameters resultParameters = MapKeySetWithPredicateCodec.decodeResponse(response);
InflatableSet.Builder<K> setBuilder = InflatableSet.newBuilder(resultParameters.response.size());
for (Data data : resultParameters.response) {
K key = toObject(data);
setBuilder.add(key);
}
return setBuilder.build();
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method evictInternal.
protected boolean evictInternal(Data keyData) {
ClientMessage request = MapEvictCodec.encodeRequest(name, keyData, getThreadId());
ClientMessage response = invoke(request, keyData);
MapEvictCodec.ResponseParameters resultParameters = MapEvictCodec.decodeResponse(response);
return resultParameters.response;
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method putInternal.
protected V putInternal(long ttl, TimeUnit timeunit, Data keyData, Data valueData) {
ClientMessage request = MapPutCodec.encodeRequest(name, keyData, valueData, getThreadId(), getTimeInMillis(ttl, timeunit));
ClientMessage response = invoke(request, keyData);
MapPutCodec.ResponseParameters resultParameters = MapPutCodec.decodeResponse(response);
return toObject(resultParameters.response);
}
Aggregations