Search in sources :

Example 1 with ResponseParameters

use of com.hazelcast.client.impl.protocol.codec.FlakeIdGeneratorNewIdBatchCodec.ResponseParameters in project hazelcast by hazelcast.

the class ClientFlakeIdGeneratorProxy method newIdBatch.

private IdBatch newIdBatch(int batchSize) {
    ClientMessage requestMsg = FlakeIdGeneratorNewIdBatchCodec.encodeRequest(name, batchSize);
    ClientMessage responseMsg = new ClientInvocation(getClient(), requestMsg, getName()).invoke().joinInternal();
    ResponseParameters response = FlakeIdGeneratorNewIdBatchCodec.decodeResponse(responseMsg);
    return new IdBatch(response.base, response.increment, response.batchSize);
}
Also used : IdBatch(com.hazelcast.flakeidgen.impl.IdBatch) ResponseParameters(com.hazelcast.client.impl.protocol.codec.FlakeIdGeneratorNewIdBatchCodec.ResponseParameters) ClientInvocation(com.hazelcast.client.impl.spi.impl.ClientInvocation) ClientMessage(com.hazelcast.client.impl.protocol.ClientMessage)

Aggregations

ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)1 ResponseParameters (com.hazelcast.client.impl.protocol.codec.FlakeIdGeneratorNewIdBatchCodec.ResponseParameters)1 ClientInvocation (com.hazelcast.client.impl.spi.impl.ClientInvocation)1 IdBatch (com.hazelcast.flakeidgen.impl.IdBatch)1