@Override public void registerFailedValue(long l) { firstLogger.registerFailedValue(l); secondLogger.registerFailedValue(l); }
@Override public void registerFailedValue(long l) { firstLogger.registerFailedValue(l); secondLogger.registerFailedValue(l); }
@Override public void registerFailedValue(long l) { statsLogger.registerFailedValue(l); }
@Override public void handleBookiesThatLeft(Set<BookieSocketAddress> leftBookies) { for (BookieSocketAddress addr : leftBookies) { try { BookieNode node = knownBookies.remove(addr); if (null != node) { topology.remove(node); if (this.isWeighted) { this.bookieInfoMap.remove(node); } bookiesLeftCounter.registerSuccessfulValue(1L); if (LOG.isDebugEnabled()) { LOG.debug("Cluster changed : bookie {} left from cluster.", addr); } } } catch (Throwable t) { LOG.error("Unexpected exception while handling leaving bookie {}", addr, t); if (bookiesLeftCounter != null) { bookiesLeftCounter.registerFailedValue(1L); } // no need to re-throw; we want to process the rest of the bookies // exception anyways will be caught/logged/suppressed in the ZK's event handler } } }
private void submitCallback(int rc) { if (BKException.Code.OK == rc) { clientCtx.getClientStats().getRecoverAddCountLogger().registerSuccessfulValue(writeCount.get()); clientCtx.getClientStats().getRecoverReadCountLogger().registerSuccessfulValue(readCount.get()); promise.complete(lh); } else { clientCtx.getClientStats().getRecoverAddCountLogger().registerFailedValue(writeCount.get()); clientCtx.getClientStats().getRecoverReadCountLogger().registerFailedValue(readCount.get()); promise.completeExceptionally(BKException.create(rc)); } }
@Override public void handleBookiesThatJoined(Set<BookieSocketAddress> joinedBookies) { // node joined for (BookieSocketAddress addr : joinedBookies) { try { BookieNode node = createBookieNode(addr); topology.add(node); knownBookies.put(addr, node); if (this.isWeighted) { this.bookieInfoMap.putIfAbsent(node, new BookieInfo()); } bookiesJoinedCounter.registerSuccessfulValue(1L); if (LOG.isDebugEnabled()) { LOG.debug("Cluster changed : bookie {} joined the cluster.", addr); } } catch (Throwable t) { // topology.add() throws unchecked exception LOG.error("Unexpected exception while handling joining bookie {}", addr, t); bookiesJoinedCounter.registerFailedValue(1L); // no need to re-throw; we want to process the rest of the bookies // exception anyways will be caught/logged/suppressed in the ZK's event handler } } }
public ByteBuf readEntry(long ledgerId, long entryId) throws IOException, NoLedgerException { long requestNanos = MathUtils.nowInNano(); boolean success = false; int entrySize = 0; try { LedgerDescriptor handle = handles.getReadOnlyHandle(ledgerId); if (LOG.isTraceEnabled()) { LOG.trace("Reading {}@{}", entryId, ledgerId); } ByteBuf entry = handle.readEntry(entryId); bookieStats.getReadBytes().add(entry.readableBytes()); success = true; return entry; } finally { long elapsedNanos = MathUtils.elapsedNanos(requestNanos); if (success) { bookieStats.getReadEntryStats().registerSuccessfulEvent(elapsedNanos, TimeUnit.NANOSECONDS); bookieStats.getReadBytesStats().registerSuccessfulValue(entrySize); } else { bookieStats.getReadEntryStats().registerFailedEvent(elapsedNanos, TimeUnit.NANOSECONDS); bookieStats.getReadEntryStats().registerFailedValue(entrySize); } } }
} else { bookieStats.getRecoveryAddEntryStats().registerFailedEvent(elapsedNanos, TimeUnit.NANOSECONDS); bookieStats.getAddBytesStats().registerFailedValue(entrySize);
} else { bookieStats.getAddEntryStats().registerFailedEvent(elapsedNanos, TimeUnit.NANOSECONDS); bookieStats.getAddBytesStats().registerFailedValue(entrySize);