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;
}
Aggregations