Package eu.stratosphere.nephele.topology

Examples of eu.stratosphere.nephele.topology.NetworkNode


      }
    }

    // Try to match new host with a stub host from the existing topology
    String instanceName = instanceConnectionInfo.hostname();
    NetworkNode parentNode = this.networkTopology.getRootNode();
    NetworkNode currentStubNode = null;

    // Try to match new host using the host name
    while (true) {

      currentStubNode = this.networkTopology.getNodeByName(instanceName);
      if (currentStubNode != null) {
        break;
      }

      final int pos = instanceName.lastIndexOf('.');
      if (pos == -1) {
        break;
      }

      /*
       * If host name is reported as FQDN, iterative remove parts
       * of the domain name until a match occurs or no more dots
       * can be found in the host name.
       */
      instanceName = instanceName.substring(0, pos);
    }

    // Try to match the new host using the IP address
    if (currentStubNode == null) {
      instanceName = instanceConnectionInfo.address().toString();
      instanceName = instanceName.replaceAll("/", ""); // Remove any / characters
      currentStubNode = this.networkTopology.getNodeByName(instanceName);
    }

    if (currentStubNode != null) {
      /*
       * The instance name will be the same as the one of the stub node. That way
       * the stub now will be removed from the network topology and replaced be
       * the new node.
       */
      if (currentStubNode.getParentNode() != null) {
        parentNode = currentStubNode.getParentNode();
      }
      // Remove the stub node from the tree
      currentStubNode.remove();
    }

    LOG.info("Creating instance of type " + instanceType + " for " + instanceConnectionInfo + ", parent is "
      + parentNode.getName());
    final ClusterInstance host = new ClusterInstance(instanceConnectionInfo, instanceType, parentNode,
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.topology.NetworkNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.