Search in sources :

Example 6 with Counter

use of org.apache.bookkeeper.stats.Counter in project distributedlog by twitter.

the class BKExceptionStatsLogger method getExceptionCounter.

public Counter getExceptionCounter(int rc) {
    Counter counter = exceptionCounters.get(rc);
    if (null != counter) {
        return counter;
    }
    // TODO: it would be better to have BKException.Code.get(rc)
    synchronized (exceptionCounters) {
        counter = exceptionCounters.get(rc);
        if (null != counter) {
            return counter;
        }
        counter = parentLogger.getCounter(getMessage(rc));
        exceptionCounters.put(rc, counter);
    }
    return counter;
}
Also used : Counter(org.apache.bookkeeper.stats.Counter)

Aggregations

Counter (org.apache.bookkeeper.stats.Counter)6 Stopwatch (com.google.common.base.Stopwatch)3 DistributedLogManager (com.twitter.distributedlog.DistributedLogManager)3 IOException (java.io.IOException)3 OpStatsLogger (org.apache.bookkeeper.stats.OpStatsLogger)2 AsyncLogReader (com.twitter.distributedlog.AsyncLogReader)1 DLSN (com.twitter.distributedlog.DLSN)1 LogReader (com.twitter.distributedlog.LogReader)1 LogRecord (com.twitter.distributedlog.LogRecord)1 LogRecordWithDLSN (com.twitter.distributedlog.LogRecordWithDLSN)1 LogSegmentMetadata (com.twitter.distributedlog.LogSegmentMetadata)1 ZooKeeperClient (com.twitter.distributedlog.ZooKeeperClient)1 BKDLConfig (com.twitter.distributedlog.metadata.BKDLConfig)1 BookKeeper (org.apache.bookkeeper.client.BookKeeper)1 LedgerEntry (org.apache.bookkeeper.client.LedgerEntry)1 LedgerHandle (org.apache.bookkeeper.client.LedgerHandle)1