@Override public void onEntryComplete(int rc, LedgerHandle lh, LedgerEntry entry, Object ctx) { readCounter.inc(); } }, readConcurrency);
@Override public void onEntryComplete(int rc, LedgerHandle lh, LedgerEntry entry, Object ctx) { readCounter.inc(); } }, readConcurrency);
@Override public Future<WriteResponse> write(final String stream, ByteBuffer data) { receivedRecordCounter.inc(); return doWrite(stream, data, null /* checksum */, false); }
/** * Handling already closed exception. */ private void handleAlreadyClosedException(AlreadyClosedException ace) { unexpectedExceptions.inc(); logger.error("Encountered unexpected exception when writing data into stream {} : ", name, ace); fatalErrorHandler.notifyFatalError(); }
@Override public boolean acquire() { permitsMetric.registerSuccessfulEvent(permits.get()); if (permits.incrementAndGet() <= permitsMax || isDarkmode()) { return true; } else { acquireFailureCounter.inc(); permits.decrementAndGet(); return false; } }
@Override public void run(Timeout timeout) throws Exception { if (!timeout.isCancelled()) { serviceTimeout.inc(); handleServiceTimeout("Operation " + op.getClass().getName() + " timeout"); } } }, serviceTimeoutMs, TimeUnit.MILLISECONDS);
private void complete() { if (cacheFull) { LOG.trace("Cache for {} is full. Backoff reading until notified", fullyQualifiedName); readAheadCacheFullCounter.inc(); resumeStopWatch.reset().start(); stopPromise = null; readAheadCache.setReadAheadCallback(ReadAheadWorker.this); } else { run(); } }
@Override public void preExecute() throws DLException { if (!accessControlManager.allowWrite(stream)) { deniedBulkWriteCounter.inc(); throw new RequestDeniedException(stream, "bulkWrite"); } super.preExecute(); }
@Override public void preExecute() throws DLException { if (!accessControlManager.allowRelease(stream)) { deniedReleaseCounter.inc(); throw new RequestDeniedException(stream, "release"); } super.preExecute(); } }
@Override public void preExecute() throws DLException { if (!accessControlManager.allowTruncate(stream)) { deniedDeleteCounter.inc(); throw new RequestDeniedException(stream, "delete"); } super.preExecute(); } }
@Override public void preExecute() throws DLException { if (!accessControlManager.allowWrite(stream)) { deniedWriteCounter.inc(); throw new RequestDeniedException(stream, "write"); } super.preExecute(); }
@Override public WriteResponse apply(DLSN value) { successRecordCounter.inc(); return ResponseUtils.writeSuccess().setDlsn(value.serialize(dlsnVersion)); } });
@Override public void preExecute() throws DLException { if (!accessControlManager.allowAcquire(stream)) { deniedHeartbeatCounter.inc(); throw new RequestDeniedException(stream, "heartbeat"); } super.preExecute(); } }
@Override public void preExecute() throws DLException { if (!accessControlManager.allowTruncate(stream)) { deniedTruncateCounter.inc(); throw new RequestDeniedException(stream, "truncate"); } super.preExecute(); } }
@Override public void apply(Request request) throws OverCapacityException { int permits = costFunction.apply(request); if (!limiter.acquire(permits)) { overlimitCounter.inc(); overlimitFunction.apply(request); } } }
@Override public void onSuccess(ResponseHeader header) { if (header.getLocation() != null || header.getCode() == StatusCode.FOUND) { redirects.inc(); } countStatusCode(header.getCode()); } @Override
@Override public void apply(StreamOp op) throws OverCapacityException { String streamName = op.streamName(); if (serviceRpsLimit > -1 && serviceRps.get() > serviceRpsLimit && !streamManager.isAcquired(streamName)) { overlimitCounter.inc(); throw new TooManyStreamsException("Request rate is too high to accept new stream " + streamName + "."); } } }
private void handleException(ReadAheadPhase phase, int returnCode) { readAheadExceptionsLogger.getBKExceptionStatsLogger(phase.name()).getExceptionCounter(returnCode).inc(); exceptionHandler.process(returnCode); }