azkaban-aplcache

Fix compiler warnings in AzkabanExecutorServer (#1196) Also

6/10/2017 8:27:00 PM

Details

diff --git a/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java b/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java
index b65a69f..0b25874 100644
--- a/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java
+++ b/azkaban-exec-server/src/main/java/azkaban/execapp/AzkabanExecutorServer.java
@@ -44,13 +44,11 @@ import azkaban.server.AzkabanServer;
 import azkaban.utils.Props;
 import azkaban.utils.StdOutErrRedirect;
 import azkaban.utils.Utils;
-import com.google.common.base.Throwables;
 import com.google.inject.Guice;
 import com.google.inject.Inject;
 import com.google.inject.Injector;
 import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -279,7 +277,7 @@ public class AzkabanExecutorServer {
     MetricsManager.INSTANCE.startReporting("AZ-EXEC", this.props);
   }
 
-  private void insertExecutorEntryIntoDB() {
+  private void insertExecutorEntryIntoDB() throws ExecutorManagerException {
     try {
       final String host = requireNonNull(getHost());
       final int port = getPort();
@@ -291,19 +289,19 @@ public class AzkabanExecutorServer {
       // If executor already exists, ignore it
     } catch (final ExecutorManagerException e) {
       logger.error("Error inserting executor entry into DB", e);
-      Throwables.propagate(e);
+      throw e;
     }
   }
 
-  private void dumpPortToFile() {
+  private void dumpPortToFile() throws IOException {
     // By default this should write to the working directory
     try (BufferedWriter writer = Files
         .newBufferedWriter(Paths.get(AZKABAN_EXECUTOR_PORT_FILENAME), StandardCharsets.UTF_8)) {
       writer.write(String.valueOf(getPort()));
       writer.write("\n");
     } catch (final IOException e) {
-      logger.error(e);
-      Throwables.propagate(e);
+      logger.error("Failed to write the port number to a file", e);
+      throw e;
     }
   }