use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method containsValue.
@Override
public boolean containsValue(Object value) {
checkNotNull(value, NULL_VALUE_IS_NOT_ALLOWED);
Data valueData = toData(value);
ClientMessage request = MapContainsValueCodec.encodeRequest(name, valueData);
ClientMessage response = invoke(request);
MapContainsValueCodec.ResponseParameters resultParameters = MapContainsValueCodec.decodeResponse(response);
return resultParameters.response;
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method entrySet.
@Override
@SuppressWarnings("unchecked")
public Set<Entry<K, V>> entrySet(Predicate predicate) {
if (predicate instanceof PagingPredicate) {
return entrySetWithPagingPredicate((PagingPredicate) predicate);
}
ClientMessage request = MapEntriesWithPredicateCodec.encodeRequest(name, toData(predicate));
ClientMessage response = invoke(request);
MapEntriesWithPredicateCodec.ResponseParameters resultParameters = MapEntriesWithPredicateCodec.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 valuesForPagingPredicate.
private Collection<V> valuesForPagingPredicate(PagingPredicate pagingPredicate) {
pagingPredicate.setIterationType(IterationType.VALUE);
ClientMessage request = MapValuesWithPagingPredicateCodec.encodeRequest(name, toData(pagingPredicate));
ClientMessage response = invoke(request);
MapValuesWithPagingPredicateCodec.ResponseParameters resultParameters = MapValuesWithPagingPredicateCodec.decodeResponse(response);
List<Entry> resultList = new ArrayList<Entry>(resultParameters.response.size());
for (Entry<Data, Data> entry : resultParameters.response) {
K key = toObject(entry.getKey());
V value = toObject(entry.getValue());
resultList.add(new AbstractMap.SimpleImmutableEntry<K, V>(key, value));
}
return (Collection) getSortedQueryResultSet(resultList, pagingPredicate, IterationType.VALUE);
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method putTransientInternal.
protected void putTransientInternal(long ttl, TimeUnit timeunit, Data keyData, Data valueData) {
ClientMessage request = MapPutTransientCodec.encodeRequest(name, keyData, valueData, getThreadId(), getTimeInMillis(ttl, timeunit));
invoke(request, keyData);
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientMapProxy method values.
@Override
public Collection<V> values() {
ClientMessage request = MapValuesCodec.encodeRequest(name);
ClientMessage response = invoke(request);
MapValuesCodec.ResponseParameters resultParameters = MapValuesCodec.decodeResponse(response);
return new UnmodifiableLazyList<V>(resultParameters.response, getSerializationService());
}
Aggregations