diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java index bdf6503b0a6..a6980e232b1 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/HddsDatanodeService.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; @@ -97,7 +98,7 @@ hidden = true, description = "Start the datanode for ozone", versionProvider = HddsVersionProvider.class, mixinStandardHelpOptions = true) -public class HddsDatanodeService extends GenericCli implements Runnable, ServicePlugin { +public class HddsDatanodeService extends GenericCli implements Callable, ServicePlugin { private static final Logger LOG = LoggerFactory.getLogger( HddsDatanodeService.class); @@ -171,7 +172,7 @@ public static Logger getLogger() { } @Override - public void run() { + public Void call() throws Exception { OzoneConfiguration configuration = getOzoneConf(); if (printBanner) { HddsServerUtil.startupShutdownMessage(HddsVersionInfo.HDDS_VERSION_INFO, @@ -186,6 +187,7 @@ public void run() { LOG.error("Error during stop Ozone Datanode.", e); } }, DEFAULT_SHUTDOWN_HOOK_PRIORITY); + return null; } public void setConfiguration(OzoneConfiguration configuration) { diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconServer.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconServer.java index 8ae7e7675b5..fc0dc18cce9 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconServer.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconServer.java @@ -56,6 +56,7 @@ import java.io.IOException; import java.net.InetSocketAddress; +import java.util.concurrent.Callable; import java.util.concurrent.atomic.AtomicBoolean; import static org.apache.hadoop.hdds.ratis.RatisHelper.newJvmPauseMonitor; @@ -70,7 +71,7 @@ /** * Recon server main class that stops and starts recon services. */ -public class ReconServer extends GenericCli implements Runnable { +public class ReconServer extends GenericCli implements Callable { private static final Logger LOG = LoggerFactory.getLogger(ReconServer.class); private Injector injector; @@ -97,7 +98,7 @@ public static void main(String[] args) { } @Override - public void run() { + public Void call() throws Exception { String[] originalArgs = getCmd().getParseResult().originalArgs() .toArray(new String[0]); @@ -194,6 +195,7 @@ public void run() { LOG.error("Error during stop Recon server", e); } }, DEFAULT_SHUTDOWN_HOOK_PRIORITY); + return null; } /** diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/checknative/CheckNative.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/checknative/CheckNative.java index 147216df970..b6b5cc989b9 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/checknative/CheckNative.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/checknative/CheckNative.java @@ -25,6 +25,7 @@ import picocli.CommandLine; import java.util.Collections; +import java.util.concurrent.Callable; import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_LIBRARY_NAME; @@ -33,14 +34,14 @@ */ @CommandLine.Command(name = "ozone checknative", description = "Checks if native libraries are loaded") -public class CheckNative extends GenericCli implements Runnable { +public class CheckNative extends GenericCli implements Callable { public static void main(String[] argv) { new CheckNative().run(argv); } @Override - public void run() { + public Void call() throws Exception { boolean nativeHadoopLoaded = org.apache.hadoop.util.NativeCodeLoader.isNativeCodeLoaded(); String hadoopLibraryName = ""; String isalDetail = ""; @@ -70,5 +71,6 @@ public void run() { rocksToolsDetail = NativeLibraryLoader.getJniLibraryFileName(); } System.out.printf("rocks-tools: %b %s%n", nativeRocksToolsLoaded, rocksToolsDetail); + return null; } }