/** * * @return Whether the cursor responded to the notification */ void notifyEntriesAvailable() { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received ml notification", ledger.getName(), name); } OpReadEntry opReadEntry = WAITING_READ_OP_UPDATER.getAndSet(this, null); if (opReadEntry != null) { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received notification of new messages persisted, reading at {} -- last: {}", ledger.getName(), name, opReadEntry.readPosition, ledger.lastConfirmedEntry); log.debug("[{}] Consumer {} cursor notification: other counters: consumed {} mdPos {} rdPos {}", ledger.getName(), name, messagesConsumedCounter, markDeletePosition, readPosition); } PENDING_READ_OPS_UPDATER.incrementAndGet(this); opReadEntry.readPosition = (PositionImpl) getReadPosition(); ledger.asyncReadEntries(opReadEntry); } else { // No one is waiting to be notified. Ignore if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received notification but had no pending read operation", ledger.getName(), name); } } }
@Override public void operationComplete() { assertEquals(cursor.getMarkDeletedPosition(), lastPosition); assertEquals(cursor.getReadPosition(), nextPosition); assertEquals(cursor.getNumberOfEntries(), 0L); }
/** * * @return Whether the cursor responded to the notification */ void notifyEntriesAvailable() { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received ml notification", ledger.getName(), name); } OpReadEntry opReadEntry = WAITING_READ_OP_UPDATER.getAndSet(this, null); if (opReadEntry != null) { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received notification of new messages persisted, reading at {} -- last: {}", ledger.getName(), name, opReadEntry.readPosition, ledger.lastConfirmedEntry); log.debug("[{}] Consumer {} cursor notification: other counters: consumed {} mdPos {} rdPos {}", ledger.getName(), name, messagesConsumedCounter, markDeletePosition, readPosition); } PENDING_READ_OPS_UPDATER.incrementAndGet(this); opReadEntry.readPosition = (PositionImpl) getReadPosition(); ledger.asyncReadEntries(opReadEntry); } else { // No one is waiting to be notified. Ignore if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received notification but had no pending read operation", ledger.getName(), name); } } }
/** * * @return Whether the cursor responded to the notification */ void notifyEntriesAvailable() { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received ml notification", ledger.getName(), name); } OpReadEntry opReadEntry = WAITING_READ_OP_UPDATER.getAndSet(this, null); if (opReadEntry != null) { if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received notification of new messages persisted, reading at {} -- last: {}", ledger.getName(), name, opReadEntry.readPosition, ledger.lastConfirmedEntry); log.debug("[{}] Consumer {} cursor notification: other counters: consumed {} mdPos {} rdPos {}", ledger.getName(), name, messagesConsumedCounter, markDeletePosition, readPosition); } PENDING_READ_OPS_UPDATER.incrementAndGet(this); opReadEntry.readPosition = (PositionImpl) getReadPosition(); ledger.asyncReadEntries(opReadEntry); } else { // No one is waiting to be notified. Ignore if (log.isDebugEnabled()) { log.debug("[{}] [{}] Received notification but had no pending read operation", ledger.getName(), name); } } }
CursorStats cs = new CursorStats(); cs.markDeletePosition = cursor.getMarkDeletedPosition().toString(); cs.readPosition = cursor.getReadPosition().toString(); cs.waitingReadOp = cursor.hasPendingReadRequest(); cs.pendingReadOps = cursor.getPendingReadOpsCount();
CursorStats cs = new CursorStats(); cs.markDeletePosition = cursor.getMarkDeletedPosition().toString(); cs.readPosition = cursor.getReadPosition().toString(); cs.waitingReadOp = cursor.hasPendingReadRequest(); cs.pendingReadOps = cursor.getPendingReadOpsCount();