Skip to content

Commit

Permalink
TEZ-4473: Remove pointless MDC_LOGGING message from logs if there is …
Browse files Browse the repository at this point in the history
…no custom MDC key. (#294) (Ayush Saxena reviewed by Laszlo Bodor)
  • Loading branch information
ayushtkn committed Jun 23, 2023
1 parent 9aeb17b commit 7e0448d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ public TezConfiguration(boolean loadDefaults) {
@ConfigurationScope(Scope.AM)
@ConfigurationProperty
public static final String TEZ_MDC_CUSTOM_KEYS = TEZ_PREFIX + "mdc.custom.keys";
public static final String TEZ_MDC_CUSTOM_KEYS_DEFAULT = "";

/**
* Comma separated list of Configuration keys. Tez will try to fill MDC with key value pairs in a
Expand All @@ -305,7 +304,6 @@ public TezConfiguration(boolean loadDefaults) {
@ConfigurationScope(Scope.AM)
@ConfigurationProperty
public static final String TEZ_MDC_CUSTOM_KEYS_CONF_PROPS = TEZ_MDC_CUSTOM_KEYS + ".conf.props";
public static final String TEZ_MDC_CUSTOM_KEYS_CONF_PROPS_DEFAULT = "";

/**
* double value. Represents ratio of unique failed outputs / number of consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ public static void initLoggingContext(ThreadLocalMap threadLocalMap, Configurati
data.put("dagId", dagId == null ? "" : dagId);
data.put("taskAttemptId", taskAttemptId == null ? "" : taskAttemptId);

String[] mdcKeys = conf.getStrings(TezConfiguration.TEZ_MDC_CUSTOM_KEYS,
TezConfiguration.TEZ_MDC_CUSTOM_KEYS_DEFAULT);
String[] mdcKeys = conf.getStrings(TezConfiguration.TEZ_MDC_CUSTOM_KEYS);

if (mdcKeys == null || mdcKeys.length == 0) {
return;
}

String[] mdcKeysValuesFrom = conf.getStrings(TezConfiguration.TEZ_MDC_CUSTOM_KEYS_CONF_PROPS,
TezConfiguration.TEZ_MDC_CUSTOM_KEYS_CONF_PROPS_DEFAULT);
String[] mdcKeysValuesFrom = conf.getStrings(TezConfiguration.TEZ_MDC_CUSTOM_KEYS_CONF_PROPS);
LOG.info("MDC_LOGGING: setting up MDC keys: keys: {} / conf: {}", Arrays.asList(mdcKeys),
Arrays.asList(mdcKeysValuesFrom));

Expand Down

0 comments on commit 7e0448d

Please sign in to comment.