mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
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:
committed by
Impala Public Jenkins
parent
6b6f7e614d
commit
d09940b5dd
@@ -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() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user