use of com.hazelcast.ringbuffer.impl.RingbufferWaitNotifyKey in project hazelcast by hazelcast.
the class AbstractRingBufferOperation method getRingbufferWaitNotifyKey.
/**
* Returns {@link WaitNotifyKey} of the ringbuffer.
*
* If the RingbufferContainer exists it reuses it's {@link RingbufferContainer#getRingEmptyWaitNotifyKey()}.
* If the RingbufferContainer doesn't exist it creates new RingbufferWaitNotifyKey and doesn't recreate
* the ringbuffer container.
*
* @return WaitNotifyKey of the ringbuffer
*/
WaitNotifyKey getRingbufferWaitNotifyKey() {
final RingbufferService service = getService();
final ObjectNamespace ns = RingbufferService.getRingbufferNamespace(name);
RingbufferContainer ringbuffer = service.getContainerOrNull(getPartitionId(), ns);
if (ringbuffer != null) {
return ringbuffer.getRingEmptyWaitNotifyKey();
} else {
return new RingbufferWaitNotifyKey(ns, getPartitionId());
}
}
Aggregations