Unnecessary log removal (#2208) master
authorMarcosrico <55266861+Marcosrico@users.noreply.github.com>
Thu, 29 Sep 2022 19:29:44 +0000 (15:29 -0400)
committerGitHub <noreply@github.com>
Thu, 29 Sep 2022 19:29:44 +0000 (12:29 -0700)
Remove unnecessary logs to clean up code in Helix.

helix-core/src/main/java/org/apache/helix/manager/zk/CallbackEventThreadPoolFactory.java
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
helix-core/src/main/java/org/apache/helix/tools/commandtools/JmxDumper.java
helix-core/src/main/java/org/apache/helix/tools/commandtools/TaskAdmin.java
helix-rest/src/main/java/org/apache/helix/rest/client/CustomRestClientImpl.java
helix-rest/src/main/java/org/apache/helix/rest/server/HelixRestServer.java
helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/InstancesAccessor.java
helix-view-aggregator/src/main/java/org/apache/helix/view/statemodel/DistViewAggregatorStateModel.java
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java

index 73cbf85994bb96e4a7ec7b946c13a12e73cac148..1a79f88d132fb3f385055dd7d33854e276a04efb 100644 (file)
@@ -82,10 +82,6 @@ public class CallbackEventThreadPoolFactory {
         result.allowCoreThreadTimeOut(true);
         _managerToCallBackThreadPoolMap.put(hash, result);
         _callBackEventProcessorCountPerThreadPool.put(hash, new AtomicInteger(1));
-      } catch (Exception e) {
-        logger.error(String
-            .format("Error when creating new ThreadPoolExecutor for %s.", hash), e);
-        throw e;
       } finally {
         _lock.writeLock().unlock();
       }
index 1ed87fe503c9722df90e7057e81a5f9cacfc3115..65303b3898ce7b432af7dcd5dfbbb8f9a99b7a10 100644 (file)
@@ -781,9 +781,6 @@ public class ZKHelixManager implements HelixManager, IZkStateListener {
          */
         handleNewSession(ZKUtil.toHexSessionId(sessionId));
         break;
-      } catch (HelixException e) {
-        LOG.error("fail to createClient.", e);
-        throw e;
       } catch (Exception e) {
         retryCount++;
         LOG.error("fail to createClient. retry " + retryCount, e);
index 0c7a94f1b6bbe2e34cb17afa8485ddcf5700a926..e95fe3463e2c4cfd9031257dc85bd22a872c56c3 100644 (file)
@@ -393,9 +393,6 @@ public class ZkBaseDataAccessor<T> implements BaseDataAccessor<T> {
           result._retCode = RetCode.ERROR;
           return result;
         }
-      } catch (ZkBadVersionException e) {
-        LOG.debug("Exception while setting path: " + path, e);
-        throw e;
       } catch (Exception e) {
         LOG.error("Exception while setting path: " + path, e);
         result._retCode = RetCode.ERROR;
index d7d59dd83ee913a8a9d8a021914538835d4c971c..824c7b6d9682f028624fb6a5fb49b700ea89c786 100644 (file)
@@ -197,7 +197,6 @@ public class JmxDumper implements NotificationListener {
   }
 
   void init() throws Exception {
-    try {
       Set<ObjectInstance> existingInstances =
           _mbeanServer.queryMBeans(new ObjectName(_namePattern), null);
       _logger.info("Total " + existingInstances.size() + " mbeans matched " + _namePattern);
@@ -210,10 +209,6 @@ public class JmxDumper implements NotificationListener {
       FileWriter fos = new FileWriter(_outputFileName);
       System.out.println(_outputFileName);
       _outputFile = new PrintWriter(fos);
-    } catch (Exception e) {
-      _logger.error("fail to get all existing mbeans in " + _domain, e);
-      throw e;
-    }
   }
 
   @Override
index f565e0f5249c250098039e87edb089ce9fb92f36..52a2524a1ef7413de19bf9ad4b8e099c43af6dd3 100644 (file)
@@ -92,9 +92,8 @@ public class TaskAdmin {
             zkAddr);
     helixMgr.connect();
     TaskDriver driver = new TaskDriver(helixMgr);
-    try {
-      TaskDriver.DriverCommand cmd = TaskDriver.DriverCommand.valueOf(args[0]);
-      switch (cmd) {
+    TaskDriver.DriverCommand cmd = TaskDriver.DriverCommand.valueOf(args[0]);
+    switch (cmd) {
       case start:
         if (cl.hasOption(WORKFLOW_FILE_OPTION)) {
           driver.start(Workflow.parse(new File(cl.getOptionValue(WORKFLOW_FILE_OPTION))));
@@ -123,11 +122,6 @@ public class TaskAdmin {
       default:
         throw new IllegalArgumentException("Unknown command " + args[0]);
       }
-    } catch (IllegalArgumentException e) {
-      LOG.error("Unknown driver command " + args[0]);
-      throw e;
-    }
-
     helixMgr.disconnect();
   }
 
index 6406f0b119cf687cdb5003a419e3f302f4a4479e..b358b6c756057f253bc3ea4e997c16f034d17f54 100644 (file)
@@ -143,8 +143,6 @@ class CustomRestClientImpl implements CustomRestClient {
 
       return response;
     } catch (IOException e) {
-      LOG.error("Failed to perform customized health check. Is participant endpoint {} available?",
-          url, e);
       // Release connection to be reused and avoid connection leakage.
       postRequest.releaseConnection();
       throw e;
index f8e78ee75423322c728f8c03a98c41295f18bb0b..66413f8897c05bee89427be3c9f0dad05f269862 100644 (file)
@@ -150,7 +150,6 @@ public class HelixRestServer {
         }
       }
     } catch (Exception e) {
-      LOG.error("Failed to initialize helix rest server. Tearing down.");
       cleanupResourceConfigs();
       throw e;
     }
index 076fe6de06adec2317f0baedd281fd4fe3a4c53c..22e03145b37e639043f1b2d609ec47d3d45bedbd 100644 (file)
@@ -274,7 +274,7 @@ public class InstancesAccessor extends AbstractHelixResource {
       return JSONRepresentation(result);
     } catch (HelixException e) {
       _logger
-          .error(String.format("Current cluster %s has issue with health checks!", clusterId), e);
+              .error(String.format("Current cluster %s has issue with health checks!", clusterId), e);
       throw new HelixHealthException(e);
     } catch (Exception e) {
       _logger.error(String.format(
index 7ac20b0da8f2dfe3a3f1cfd3c6691534ab05f35b..e335e0537469a289c821f42f87c8635add375509 100644 (file)
@@ -58,7 +58,7 @@ public class DistViewAggregatorStateModel extends AbstractHelixLeaderStandbyStat
       _aggregator.start();
     } catch (Exception e) {
       logger.error("Aggregator failed to become leader from stand by for view cluster {}",
-          viewClusterName, e);
+              viewClusterName, e);
       reset();
       throw e;
     }
index a24a098dde0fadb635e12610fed08b63f805d432..527e46f905db8297551614434680fd257fd9ea71 100644 (file)
@@ -2066,7 +2066,7 @@ public class ZkClient implements Watcher {
         success = true;
       } catch (ZkNoNodeException e) {
         success = false;
-        LOG.debug("zkclient {}, Failed to delete path {}, znode does not exist!", _uid, path);
+        LOG.debug("zkclient {}, Failed to delete path {}, znode does not exist!", _uid, path, e);
       }
       record(path, null, startT, ZkClientMonitor.AccessType.WRITE);
     } catch (Exception e) {