dlmarion commented on code in PR #5073:
URL: https://github.com/apache/accumulo/pull/5073#discussion_r1849040819
##########
server/base/src/main/java/org/apache/accumulo/server/conf/CheckServerConfig.java:
##########
@@ -18,17 +18,45 @@
*/
package org.apache.accumulo.server.conf;
+import java.io.IOException;
+
import org.apache.accumulo.core.conf.SiteConfiguration;
import org.apache.accumulo.server.ServerContext;
+import org.apache.accumulo.server.ServerDirs;
+import org.apache.accumulo.server.fs.VolumeManager;
+import org.apache.accumulo.server.fs.VolumeManagerImpl;
import org.apache.accumulo.start.spi.KeywordExecutable;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
import com.google.auto.service.AutoService;
@AutoService(KeywordExecutable.class)
public class CheckServerConfig implements KeywordExecutable {
public static void main(String[] args) {
- try (var context = new ServerContext(SiteConfiguration.auto())) {
+ var siteConfig = SiteConfiguration.auto();
+ var hadoopConfig = new Configuration();
+ VolumeManager volumeManager;
+ try {
+ volumeManager = VolumeManagerImpl.get(siteConfig, hadoopConfig);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ var serverDirs = new ServerDirs(siteConfig, hadoopConfig);
+ Path instanceIdPath =
serverDirs.getInstanceIdLocation(volumeManager.getFirst());
+ // Check if an instance exists. If it doesn't, we have performed all the
checks we can.
+ // If it does, we can perform further checks.
+ try {
+ VolumeManager.getInstanceIDFromHdfs(instanceIdPath, hadoopConfig);
+ } catch (Exception e) {
+ System.out.println("WARNING : Performed only a subset of checks (which
passed). There is a "
Review Comment:
@ctubbsii - Do you have thoughts on this and the discussion around it on the
conversation tab?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]