diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java index aad6a87..71b3f06 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java @@ -265,6 +265,8 @@ public abstract class AbstractFSWAL implements WAL { */ private final ConcurrentMap syncFuturesByHandler; + protected final String className; + public long getFilenum() { return this.filenum.get(); } @@ -405,6 +407,7 @@ public abstract class AbstractFSWAL implements WAL { int maxHandlersCount = conf.getInt(HConstants.REGION_SERVER_HANDLER_COUNT, 200); // Presize our map of SyncFutures by handler objects. this.syncFuturesByHandler = new ConcurrentHashMap(maxHandlersCount); + this.className = getClass().getSimpleName(); } @Override @@ -744,7 +747,7 @@ public abstract class AbstractFSWAL implements WAL { newPath = replaceWriter(oldPath, newPath, nextWriter); tellListenersAboutPostLogRoll(oldPath, newPath); if (LOG.isDebugEnabled()) { - LOG.debug("Create new " + getClass().getSimpleName() + " writer with pipeline: " + LOG.debug("Create new " + className + " writer with pipeline: " + Arrays.toString(getPipeline())); } // Can we delete any of the old log files? @@ -950,7 +953,7 @@ public abstract class AbstractFSWAL implements WAL { if (this.closed) { throw new IOException("Cannot append; log is closed, regionName = " + hri.getRegionNameAsString()); } - TraceScope scope = Trace.startSpan(getClass().getSimpleName() + ".append"); + TraceScope scope = Trace.startSpan(className + ".append"); MutableLong txidHolder = new MutableLong(); MultiVersionConcurrencyControl.WriteEntry we = key.getMvcc().begin(() -> { txidHolder.setValue(ringBuffer.next()); @@ -968,7 +971,7 @@ public abstract class AbstractFSWAL implements WAL { @Override public String toString() { - return getClass().getSimpleName() + " " + walFilePrefix + ":" + walFileSuffix + "(num " + return className + " " + walFilePrefix + ":" + walFileSuffix + "(num " + filenum + ")"; }