From ab551af21b0197f07087c4db3c655960d06f162a Mon Sep 17 00:00:00 2001 From: Runhang Li Date: Wed, 3 Aug 2016 17:08:27 -0700 Subject: [PATCH] Improve logging for TMasterUtils. --- .../com/twitter/heron/spi/utils/TMasterUtils.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/heron/spi/src/java/com/twitter/heron/spi/utils/TMasterUtils.java b/heron/spi/src/java/com/twitter/heron/spi/utils/TMasterUtils.java index e9dd32925f5..d7ee7423ffe 100644 --- a/heron/spi/src/java/com/twitter/heron/spi/utils/TMasterUtils.java +++ b/heron/spi/src/java/com/twitter/heron/spi/utils/TMasterUtils.java @@ -40,19 +40,19 @@ private TMasterUtils() { public static boolean sendToTMaster(String command, String topologyName, SchedulerStateManagerAdaptor stateManager) { // fetch the TMasterLocation for the topology - LOG.info("Fetching TMaster location for topology: " + topologyName); + LOG.fine("Fetching TMaster location for topology: " + topologyName); TopologyMaster.TMasterLocation location = stateManager.getTMasterLocation(topologyName); if (location == null) { LOG.severe("Failed to fetch TMaster Location for topology: " + topologyName); return false; } - LOG.info("Fetched TMaster location for topology: " + topologyName); + LOG.fine("Fetched TMaster location for topology: " + topologyName); // for the url request to be sent to TMaster String endpoint = String.format("http://%s:%d/%s?topologyid=%s", location.getHost(), location.getControllerPort(), command, location.getTopologyId()); - LOG.info("HTTP URL for TMaster: " + endpoint); + LOG.fine("HTTP URL for TMaster: " + endpoint); // create a URL connection HttpURLConnection connection = null; @@ -62,21 +62,21 @@ public static boolean sendToTMaster(String command, String topologyName, LOG.log(Level.SEVERE, "Failed to get a HTTP connection to TMaster: ", e); return false; } - LOG.info("Successfully opened HTTP connection to TMaster"); + LOG.fine("Successfully opened HTTP connection to TMaster"); // now sent the http request NetworkUtils.sendHttpGetRequest(connection); - LOG.info("Sent the HTTP payload to TMaster"); + LOG.fine("Sent the HTTP payload to TMaster"); boolean success = false; // get the response and check if it is successful try { int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { - LOG.info("Successfully got a HTTP response from TMaster for " + command); + LOG.fine("Successfully got a HTTP response from TMaster for " + command); success = true; } else { - LOG.info(String.format("Non OK HTTP response %d from TMaster for command %s", + LOG.fine(String.format("Non OK HTTP response %d from TMaster for command %s", responseCode, command)); } } catch (IOException e) {