HDDS-1833. Moved RefCountedDB stacktrace to log level trace.

Contributed by Siddharth Wagle
This commit is contained in:
Eric Yang 2019-07-29 12:05:24 -04:00
parent 8a59cd1b8a
commit d023663e3e
1 changed files with 8 additions and 8 deletions

View File

@ -19,6 +19,8 @@
package org.apache.hadoop.ozone.container.common.utils;
import com.google.common.base.Preconditions;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.hadoop.utils.MetadataStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -52,20 +54,18 @@ public class ReferenceCountedDB implements Closeable {
public void incrementReference() {
this.referenceCount.incrementAndGet();
if (LOG.isDebugEnabled()) {
LOG.debug("IncRef {} to refCnt {} \n", containerDBPath,
referenceCount.get());
new Exception().printStackTrace();
if (LOG.isTraceEnabled()) {
LOG.trace("IncRef {} to refCnt {}, stackTrace: {}", containerDBPath,
referenceCount.get(), ExceptionUtils.getStackTrace(new Throwable()));
}
}
public void decrementReference() {
int refCount = this.referenceCount.decrementAndGet();
Preconditions.checkArgument(refCount >= 0, "refCount:", refCount);
if (LOG.isDebugEnabled()) {
LOG.debug("DecRef {} to refCnt {} \n", containerDBPath,
referenceCount.get());
new Exception().printStackTrace();
if (LOG.isTraceEnabled()) {
LOG.trace("DecRef {} to refCnt {}, stackTrace: {}", containerDBPath,
referenceCount.get(), ExceptionUtils.getStackTrace(new Throwable()));
}
}