IMPALA-13563: Cleanup logging

Cleans up calls to logDebug and a few other locations:
- exit early if producing debug message input is expensive
- use slf4j parameterized logging
- normalize on logDebug handling isDebugEnabled checks

Change-Id: I32e1c62511c292d36aa879c60ae3d91ed4f65697
Reviewed-on: http://gerrit.cloudera.org:8080/22090
Reviewed-by: Michael Smith <michael.smith@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Michael Smith
2024-10-10 15:38:20 -07:00
committed by Impala Public Jenkins
parent 6b6f7e614d
commit d09940b5dd
10 changed files with 23 additions and 23 deletions

View File

@@ -199,9 +199,7 @@ public class CalciteJniFrontend extends JniFrontend {
QueryContext queryCtx, String stepMessage) {
LOG.info(stepMessage);
queryCtx.getTimeline().markEvent(stepMessage);
if (LOG.isDebugEnabled()) {
compilerStep.logDebug(stepResult);
}
compilerStep.logDebug(stepResult);
}
private static void loadCalciteImpalaFunctions() {

View File

@@ -354,9 +354,10 @@ public class CalciteMetadataHandler implements CompilerStep {
@Override
public void logDebug(Object resultObject) {
LOG.debug("Loaded tables: " + stmtTableCache_.tables.values().stream()
if (!LOG.isDebugEnabled()) return;
String allTables = stmtTableCache_.tables.values().stream()
.map(feTable -> feTable.getName().toString())
.collect(Collectors.joining( ", " )));
.collect(Collectors.joining( ", " ));
LOG.debug("Loaded tables: {}", allTables);
}
}

View File

@@ -88,9 +88,9 @@ public class CalcitePhysPlanCreator implements CompilerStep {
@Override
public void logDebug(Object resultObject) {
if (!(resultObject instanceof NodeWithExprs)) {
LOG.debug("Finished physical plan step, but unknown result: " + resultObject);
LOG.debug("Finished physical plan step, but unknown result: {}", resultObject);
return;
}
LOG.debug("Physical Plan: " + resultObject);
LOG.debug("Physical Plan: {}", resultObject);
}
}

View File

@@ -65,9 +65,9 @@ public class CalciteQueryParser implements CompilerStep {
public void logDebug(Object resultObject) {
if (!(resultObject instanceof SqlNode)) {
LOG.debug("Parser produced an unknown output: " + resultObject);
LOG.debug("Parser produced an unknown output: {}", resultObject);
return;
}
LOG.debug("Parsed node: " + resultObject);
LOG.debug("Parsed node: {}", resultObject);
}
}

View File

@@ -93,9 +93,9 @@ public class CalciteValidator implements CompilerStep {
@Override
public void logDebug(Object resultObject) {
if (!(resultObject instanceof SqlNode)) {
LOG.debug("Finished validator step, but unknown result: " + resultObject);
LOG.debug("Finished validator step, but unknown result: {}", resultObject);
return;
}
LOG.debug("Validated node: " + resultObject);
LOG.debug("Validated node: {}", resultObject);
}
}

View File

@@ -427,8 +427,8 @@ public class ExecRequestCreator implements CompilerStep {
@Override
public void logDebug(Object resultObject) {
if (!(resultObject instanceof TExecRequest)) {
LOG.debug("Finished create exec request step, but unknown result: " + resultObject);
LOG.debug("Finished exec request step, but unknown result: {}", resultObject);
}
LOG.debug("Exec request: " + resultObject);
LOG.debug("Exec request: {}", resultObject);
}
}