diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java index 6f32eadd24f3..09c27e2b8a9d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/SplitTableRegionProcedure.java @@ -341,9 +341,7 @@ protected Flow executeFromState(MasterProcedureEnv env, SplitTableRegionState st @Override protected void rollbackState(final MasterProcedureEnv env, final SplitTableRegionState state) throws IOException, InterruptedException { - if (isTraceEnabled()) { - LOG.trace(this + " rollback state=" + state); - } + LOG.trace("{} rollback state={}", this, state); try { switch (state) { @@ -892,18 +890,6 @@ private void writeMaxSequenceIdFile(MasterProcedureEnv env) throws IOException { } } - /** - * The procedure could be restarted from a different machine. If the variable is null, we need to - * retrieve it. - * @return traceEnabled - */ - private boolean isTraceEnabled() { - if (traceEnabled == null) { - traceEnabled = LOG.isTraceEnabled(); - } - return traceEnabled; - } - @Override protected boolean abort(MasterProcedureEnv env) { // Abort means rollback. We can't rollback all steps. HBASE-18018 added abort to all diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java index 537c5ded2a0a..8c9ef2f67436 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CloneSnapshotProcedure.java @@ -78,8 +78,6 @@ public class CloneSnapshotProcedure // Monitor private MonitoredTask monitorStatus = null; - private Boolean traceEnabled = null; - /** * Constructor (for failover) */ @@ -130,9 +128,7 @@ private void restoreSnapshotAcl(MasterProcedureEnv env) throws IOException { @Override protected Flow executeFromState(final MasterProcedureEnv env, final CloneSnapshotState state) throws InterruptedException { - if (isTraceEnabled()) { - LOG.trace(this + " execute state=" + state); - } + LOG.trace("{} execute state={}", this, state); try { switch (state) { case CLONE_SNAPSHOT_PRE_OPERATION: @@ -519,15 +515,4 @@ private void addRegionsToMeta(final MasterProcedureEnv env) throws IOException { metaChanges.updateMetaParentRegions(env.getMasterServices().getConnection(), newRegions); } - /** - * The procedure could be restarted from a different machine. If the variable is null, we need to - * retrieve it. - * @return traceEnabled - */ - private Boolean isTraceEnabled() { - if (traceEnabled == null) { - traceEnabled = LOG.isTraceEnabled(); - } - return traceEnabled; - } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java index daadd793175d..e3626f2938e4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/EnableTableProcedure.java @@ -52,8 +52,6 @@ public class EnableTableProcedure private TableName tableName; - private Boolean traceEnabled = null; - public EnableTableProcedure() { } @@ -80,9 +78,7 @@ public EnableTableProcedure(MasterProcedureEnv env, TableName tableName, @Override protected Flow executeFromState(final MasterProcedureEnv env, final EnableTableState state) throws InterruptedException { - if (isTraceEnabled()) { - LOG.trace(this + " execute state=" + state); - } + LOG.trace("{} execute state={}", this, state); try { switch (state) { @@ -392,18 +388,6 @@ private void postEnable(final MasterProcedureEnv env, final EnableTableState sta runCoprocessorAction(env, state); } - /** - * The procedure could be restarted from a different machine. If the variable is null, we need to - * retrieve it. - * @return traceEnabled - */ - private Boolean isTraceEnabled() { - if (traceEnabled == null) { - traceEnabled = LOG.isTraceEnabled(); - } - return traceEnabled; - } - /** * Coprocessor Action. * @param env MasterProcedureEnv diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java index 71c7ba6e43de..84304b394cce 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/RestoreSnapshotProcedure.java @@ -77,8 +77,6 @@ public class RestoreSnapshotProcedure // Monitor private MonitoredTask monitorStatus = null; - private Boolean traceEnabled = null; - /** * Constructor (for failover) */ @@ -129,9 +127,7 @@ private MonitoredTask getMonitorStatus() { @Override protected Flow executeFromState(final MasterProcedureEnv env, final RestoreSnapshotState state) throws InterruptedException { - if (isTraceEnabled()) { - LOG.trace(this + " execute state=" + state); - } + LOG.trace("{} execute state={}", this, state); // Make sure that the monitor status is set up getMonitorStatus();