use of com.hazelcast.internal.iteration.IterationPointer in project hazelcast by hazelcast.
the class MapFetchKeysMessageTask method prepareOperation.
@Override
protected Operation prepareOperation() {
MapOperationProvider operationProvider = getMapOperationProvider(parameters.name);
IterationPointer[] pointers = decodePointers(parameters.iterationPointers);
return operationProvider.createFetchKeysOperation(parameters.name, pointers, parameters.batch);
}
use of com.hazelcast.internal.iteration.IterationPointer in project hazelcast by hazelcast.
the class MapFetchKeysMessageTask method encodeResponse.
@Override
protected ClientMessage encodeResponse(Object response) {
if (response == null) {
return MapFetchKeysCodec.encodeResponse(Collections.emptyList(), Collections.emptyList());
}
MapKeysWithCursor mapKeysWithCursor = (MapKeysWithCursor) response;
IterationPointer[] pointers = mapKeysWithCursor.getIterationPointers();
return MapFetchKeysCodec.encodeResponse(encodePointers(pointers), mapKeysWithCursor.getBatch());
}
use of com.hazelcast.internal.iteration.IterationPointer in project hazelcast by hazelcast.
the class MapFetchWithQueryMessageTask method encodeResponse.
@Override
protected ClientMessage encodeResponse(Object response) {
ResultSegment resp = (ResultSegment) response;
QueryResult queryResult = (QueryResult) resp.getResult();
List<Data> serialized = new ArrayList<>(queryResult.size());
for (QueryResultRow row : queryResult) {
serialized.add(row.getValue());
}
IterationPointer[] pointers = resp.getPointers();
return MapFetchWithQueryCodec.encodeResponse(serialized, encodePointers(pointers));
}
use of com.hazelcast.internal.iteration.IterationPointer in project hazelcast by hazelcast.
the class MapFetchEntriesMessageTask method encodeResponse.
@Override
protected ClientMessage encodeResponse(Object response) {
if (response == null) {
return MapFetchEntriesCodec.encodeResponse(Collections.emptyList(), Collections.emptyList());
}
MapEntriesWithCursor mapEntriesWithCursor = (MapEntriesWithCursor) response;
IterationPointer[] pointers = mapEntriesWithCursor.getIterationPointers();
return MapFetchEntriesCodec.encodeResponse(encodePointers(pointers), mapEntriesWithCursor.getBatch());
}
use of com.hazelcast.internal.iteration.IterationPointer in project hazelcast by hazelcast.
the class ClientMapPartitionIterator method fetchWithoutPrefetchValues.
private List fetchWithoutPrefetchValues(HazelcastClientInstanceImpl client) {
ClientMessage request = MapFetchKeysCodec.encodeRequest(mapProxy.getName(), encodePointers(pointers), fetchSize);
ClientInvocation clientInvocation = new ClientInvocation(client, request, mapProxy.getName(), partitionId);
try {
ClientInvocationFuture f = clientInvocation.invoke();
MapFetchKeysCodec.ResponseParameters responseParameters = MapFetchKeysCodec.decodeResponse(f.get());
IterationPointer[] pointers = decodePointers(responseParameters.iterationPointers);
setIterationPointers(responseParameters.keys, pointers);
return responseParameters.keys;
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
}
Aggregations