code:     public static String nodeMode() {
          Builder builder = ImmutableSettings.builder();
          if (Strings.isEmpty(System.getProperty("es.node.mode")) && Strings.isEmpty(System.getProperty("es.node.local"))) {
              return "local"; // default if nothing is specified
          }
          if (Strings.hasLength(System.getProperty("es.node.mode"))) {
              builder.put("node.mode", System.getProperty("es.node.mode"));
          }
          if (Strings.hasLength(System.getProperty("es.node.local"))) {
              builder.put("node.local", System.getProperty("es.node.local"));
          }
          if (DiscoveryNode.localNode(builder.build())) {
              return "local";
          } else {
              return "network";
          }
      }
  
      @Override
  