Search in sources :

Example 1 with ResponseParameters

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

the class ClientCacheProxy method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    eventJournalReadResponseDecoder = message -> {
        final CacheEventJournalReadCodec.ResponseParameters params = CacheEventJournalReadCodec.decodeResponse(message);
        final ReadResultSetImpl resultSet = new ReadResultSetImpl<>(params.readCount, params.items, params.itemSeqs, params.nextSeq);
        resultSet.setSerializationService(getSerializationService());
        return resultSet;
    };
    eventJournalSubscribeResponseDecoder = message -> {
        final ResponseParameters resp = CacheEventJournalSubscribeCodec.decodeResponse(message);
        return new EventJournalInitialSubscriberState(resp.oldestSequence, resp.newestSequence);
    };
}
Also used : EventJournalInitialSubscriberState(com.hazelcast.internal.journal.EventJournalInitialSubscriberState) CacheEventJournalReadCodec(com.hazelcast.client.impl.protocol.codec.CacheEventJournalReadCodec) ResponseParameters(com.hazelcast.client.impl.protocol.codec.CacheEventJournalSubscribeCodec.ResponseParameters) ReadResultSetImpl(com.hazelcast.ringbuffer.impl.ReadResultSetImpl)

Aggregations

CacheEventJournalReadCodec (com.hazelcast.client.impl.protocol.codec.CacheEventJournalReadCodec)1 ResponseParameters (com.hazelcast.client.impl.protocol.codec.CacheEventJournalSubscribeCodec.ResponseParameters)1 EventJournalInitialSubscriberState (com.hazelcast.internal.journal.EventJournalInitialSubscriberState)1 ReadResultSetImpl (com.hazelcast.ringbuffer.impl.ReadResultSetImpl)1