HADOOP-11714. Add more trace log4j messages to SpanReceiverHost (cmccabe)

(cherry picked from commit bf3275dbaa)
This commit is contained in:
Colin Patrick Mccabe 2015-03-16 12:02:10 -07:00
parent fbe811d904
commit eb4eb63de3
2 changed files with 12 additions and 3 deletions

View File

@ -257,6 +257,8 @@ Release 2.7.0 - UNRELEASED
HADOOP-11642. Upgrade azure sdk version from 0.6.0 to 2.0.0. HADOOP-11642. Upgrade azure sdk version from 0.6.0 to 2.0.0.
(Shashank Khandelwal and Ivan Mitic via cnauroth) (Shashank Khandelwal and Ivan Mitic via cnauroth)
HADOOP-11714. Add more trace log4j messages to SpanReceiverHost (cmccabe)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-11323. WritableComparator#compare keeps reference to byte array. HADOOP-11323. WritableComparator#compare keeps reference to byte array.

View File

@ -134,20 +134,27 @@ public class SpanReceiverHost implements TraceAdminProtocol {
String[] receiverNames = String[] receiverNames =
config.getTrimmedStrings(SPAN_RECEIVERS_CONF_KEY); config.getTrimmedStrings(SPAN_RECEIVERS_CONF_KEY);
if (receiverNames == null || receiverNames.length == 0) { if (receiverNames == null || receiverNames.length == 0) {
if (LOG.isTraceEnabled()) {
LOG.trace("No span receiver names found in " +
SPAN_RECEIVERS_CONF_KEY + ".");
}
return; return;
} }
// It's convenient to have each daemon log to a random trace file when // It's convenient to have each daemon log to a random trace file when
// testing. // testing.
if (config.get(LOCAL_FILE_SPAN_RECEIVER_PATH) == null) { if (config.get(LOCAL_FILE_SPAN_RECEIVER_PATH) == null) {
config.set(LOCAL_FILE_SPAN_RECEIVER_PATH, String uniqueFile = getUniqueLocalTraceFileName();
getUniqueLocalTraceFileName()); config.set(LOCAL_FILE_SPAN_RECEIVER_PATH, uniqueFile);
if (LOG.isTraceEnabled()) {
LOG.trace("Set " + LOCAL_FILE_SPAN_RECEIVER_PATH + " to " + uniqueFile);
}
} }
for (String className : receiverNames) { for (String className : receiverNames) {
try { try {
SpanReceiver rcvr = loadInstance(className, EMPTY); SpanReceiver rcvr = loadInstance(className, EMPTY);
Trace.addReceiver(rcvr); Trace.addReceiver(rcvr);
receivers.put(highestId++, rcvr); receivers.put(highestId++, rcvr);
LOG.info("SpanReceiver " + className + " was loaded successfully."); LOG.info("Loaded SpanReceiver " + className + " successfully.");
} catch (IOException e) { } catch (IOException e) {
LOG.error("Failed to load SpanReceiver", e); LOG.error("Failed to load SpanReceiver", e);
} }