Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-22943 Various procedures should not cache log trace level #557

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
public class SplitTableRegionProcedure
extends AbstractStateMachineRegionProcedure<SplitTableRegionState> {
private static final Logger LOG = LoggerFactory.getLogger(SplitTableRegionProcedure.class);
private Boolean traceEnabled = null;
private RegionInfo daughterOneRI;
private RegionInfo daughterTwoRI;
private byte[] bestSplitRow;
Expand Down Expand Up @@ -341,9 +340,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) {
Expand Down Expand Up @@ -887,18 +884,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public class CloneSnapshotProcedure
// Monitor
private MonitoredTask monitorStatus = null;

private Boolean traceEnabled = null;

/**
* Constructor (for failover)
*/
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public class EnableTableProcedure

private TableName tableName;

private Boolean traceEnabled = null;

public EnableTableProcedure() {
}

Expand All @@ -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) {
Expand Down Expand Up @@ -389,18 +385,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ public class RestoreSnapshotProcedure
// Monitor
private MonitoredTask monitorStatus = null;

private Boolean traceEnabled = null;

/**
* Constructor (for failover)
*/
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -549,16 +545,4 @@ private void restoreSnapshotAcl(final MasterProcedureEnv env) throws IOException
env.getMasterServices().getConfiguration());
}
}

/**
* 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;
}
}