Locates the internal address of the node on which a deployment is deployed.
509186
private void findDeploymentAddress(final String deploymentID, Handler<AsyncResult<String>> resultHandler) {
    context.execute(new Action<String>() {
      @Override
      public String perform() {
        synchronized (deployments) {
          JsonObject locatedInfo = null;
          Collection<String> sdeploymentsInfo = deployments.get(cluster);
          for (String sdeploymentInfo : sdeploymentsInfo) {
            JsonObject deploymentInfo = new JsonObject(sdeploymentInfo);
            if (deploymentInfo.getString("id").equals(deploymentID)) {
              locatedInfo = deploymentInfo;
              break;
            }
          }
          if (locatedInfo != null) {
            return locatedInfo.getString("address");
          }
          return null;
        }
      }
    }, resultHandler);
  }
1373672
private ModelNode baseAddress() {
        ModelNode address = new ModelNode();
        if (!bootstrap.isStandalone()) {
            address.add("host", serverStore.getSelectedServer().getHostName());
            address.add("server", serverStore.getSelectedServer().getServerName());
        }
        address.add("subsystem", "logging");
        return address;
    }
124884
@SuppressWarnings("unchecked")
	public Address getClusterNodeAddress(ClusteredCacheData cacheData) {
		return (Address) cacheData.getNode().get(CLUSTER_NODE_ADDRESS_NODE_KEY);
	}
266121
function allNodesAtLocation(location) {
        var nodes = [];
        exports.root.each(function each(n) {
            if (n.type === DOMNode.TYPE_ELEMENT && n.isAtLocation(location)) {
                nodes.push(n);
            }
        });
        return nodes;
    }
1359169
def location(self):
        """"""
        location, _, revision = self.expression.partition('#')
        return location if location and revision else None
161933
function findSurroundASTNode(ast, expn, types) {
        var foundNode = ASTWalker.findNodeAround(ast, expn.start, function (nodeType, node) {
            if (expn.end) {
                return types.includes(nodeType) && node.end >= expn.end;
            } else {
                return types.includes(nodeType);
            }
        });
        return foundNode && _.clone(foundNode.node);
    }
12668
private void deployModule(final Node node, final InstanceContext instance, final CountingCompletionHandler<Void> counter) {
    log.debug(String.format("%s - Deploying %s to %s", NetworkManager.this, instance.component().asModule().module(), node.address()));
    node.deployModule(instance.component().asModule().module(), Components.buildConfig(instance, cluster), 1, new Handler<AsyncResult<String>>() {
      @Override
      public void handle(AsyncResult<String> result) {
        if (result.failed()) {
          counter.fail(result.cause());
        } else {
          deploymentIDs.put(instance.address(), result.result(), new Handler<AsyncResult<String>>() {
            @Override
            public void handle(AsyncResult<String> result) {
              counter.succeed();
            }
          });
        }
      }
    });
  }
577836
function locateNode (vnode: VNode): VNodeWithData {
  return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
    ? locateNode(vnode.componentInstance._vnode)
    : vnode
}
127820
private void locateNode(final String address, final Iterator<String> nodes, final Handler<AsyncResult<String>> doneHandler) {
    if (nodes.hasNext()) {
      final String node = nodes.next();
      vertx.eventBus().sendWithTimeout(node, new JsonObject().putString("action", "ping"), 1000, new Handler<AsyncResult<Message<JsonObject>>>() {
        @Override
        public void handle(AsyncResult<Message<JsonObject>> result) {
          if (result.failed() || result.result().body().getString("status", "ok").equals("error")) {
            removeNode(address, node);
            locateNode(address, nodes, doneHandler);
          } else {
            new DefaultFutureResult<String>(node).setHandler(doneHandler);
          }
        }
      });
    } else {
      new DefaultFutureResult<String>(new IllegalStateException("No local nodes found")).setHandler(doneHandler);
    }
  }
398641
function getLocalIPAddress () {
  const ifaces = os.networkInterfaces()

  let address = null
  let addresses = null
  let size = null
  let flag = false

  for (let ifname in ifaces) {
    addresses = ifaces[ifname]
    size = addresses.length

    while (size--) {
      let iface = addresses[size]
      if (iface.family === 'IPv4' && iface.internal === false) {
        address = iface.address
        flag = true
        break
      }
    }

    if (flag) break
  }
  return address
}
773801
static InetSocketAddress getNameNodeAddress(Configuration conf,
                                                      String cname, String rpcKey, String cname2) {
    String fs = conf.get(cname);
    String fs1 = conf.get(rpcKey);
    String fs2 = conf.get(cname2);
    Configuration newconf = new Configuration(conf);
    newconf.set("fs.default.name", fs);
    if (fs1 != null) {
      newconf.set(DFS_NAMENODE_RPC_ADDRESS_KEY, fs1);
    }
    if (fs2 != null) {
      newconf.set("dfs.namenode.dn-address", fs2);
    }
    return DataNode.getNameNodeAddress(newconf);
  }
1362577
public String getHostAddress() {
        if( addr instanceof NbtAddress ) {
            return ((NbtAddress)addr).getHostAddress();
        }
        return ((InetAddress)addr).getHostAddress();
    }
1172243
public static void redeployDeployments(OperationContext context, PathAddress deploymentsRootAddress, Set<String> deploymentNames) throws OperationFailedException {
        for (String deploymentName : deploymentNames) {
            PathAddress address = deploymentsRootAddress.append(DEPLOYMENT, deploymentName);
            OperationStepHandler handler = context.getRootResourceRegistration().getOperationHandler(address, REDEPLOY);
            ModelNode operation = addRedeployStep(address);
            ServerLogger.AS_ROOT_LOGGER.debugf("Redeploying %s at address %s with handler %s", deploymentName, address, handler);
            assert handler != null;
            assert operation.isDefined();
            context.addStep(operation, handler, OperationContext.Stage.MODEL);
        }
    }
198418
function nodeAtLocation(location) {
        return exports.root.find(function each(n) {
            return n.isAtLocation(location, false);
        });
    }
520555
function _lookupByNodeIdentifier(nodeIdentifier, timeoutMs) {
        // if the address is cached, return that
        if (cachedNodes[nodeIdentifier]) {
            return rx.of({ destination64: cachedNodes[nodeIdentifier]});
        }

        if (debug) {
            console.log("Looking up", nodeIdentifier);
        }

        return _localCommand("DN", timeoutMs, nodeIdentifier).pipe(
            rx.operators.catchError(function() {
                return rx.throwError(new Error("Node not found"));
            }),
            rx.operators.map(_extractDestination64),
            rx.operators.tap(function(address64) {
                cachedNodes[nodeIdentifier] = address64;
            }),
            rx.operators.map(function(address64) {
                return { destination64: address64 };
            })
        );
    }
874599
function _parseNetworkLocation(networkLocation, obj) {
	var pos = networkLocation.indexOf(':');
	if (pos === -1) {
		obj.host = networkLocation;
	} else {
		obj.host = networkLocation.substring(0, pos);
		if (pos < (networkLocation.length - 1)) {
			obj.port = networkLocation.substring(pos + 1);
		}
	}
}
125718
def __locate(self):
        """"""
        if self.ns[1] != self.schema.tns[1]:
            return self.schema.locate(self.ns)