Package eu.stratosphere.nephele.instance

Examples of eu.stratosphere.nephele.instance.InstanceConnectionInfo


      }
      catch (Exception e) {
        throw new RuntimeException("The TaskManager failed to determine its own network address.", e);
      }
     
      this.localInstanceConnectionInfo = new InstanceConnectionInfo(taskManagerAddress, ipcPort, dataPort);
      LOG.info("TaskManager connection information:" + this.localInstanceConnectionInfo);

      // Start local RPC server
      try {
        this.taskManagerServer = RPC.getServer(this, taskManagerAddress.getHostAddress(), ipcPort, IPC_HANDLER_COUNT);
View Full Code Here


      if (assignedInstance.getInstanceConnectionInfo().equals(caller)) {
        // Receiver runs on the same task manager
        return ConnectionInfoLookupResponse.createReceiverFoundAndReady(edge.getOutputChannelID());
      } else {
        // Receiver runs on a different task manager
        final InstanceConnectionInfo ici = assignedInstance.getInstanceConnectionInfo();
        final InetSocketAddress isa = new InetSocketAddress(ici.address(), ici.dataPort());

        return ConnectionInfoLookupResponse.createReceiverFoundAndReady(new RemoteReceiver(isa, edge.getConnectionID()));
      }
    }
    // else, the request is for an output channel
    // Find vertex of connected input channel
    final ExecutionVertex targetVertex = edge.getInputGate().getVertex();

    // Check execution state
    final ExecutionState executionState = targetVertex.getExecutionState();

    // check whether the task needs to be deployed
    if (executionState != ExecutionState.RUNNING && executionState != ExecutionState.FINISHING && executionState != ExecutionState.FINISHED) {

      if (executionState == ExecutionState.ASSIGNED) {
        final Runnable command = new Runnable() {
          @Override
          public void run() {
            scheduler.deployAssignedVertices(targetVertex);
          }
        };
        eg.executeCommand(command);
      }

      // LOG.info("Created receiverNotReady for " + targetVertex + " in state " + executionState + " 3");
      return ConnectionInfoLookupResponse.createReceiverNotReady();
    }

    final AbstractInstance assignedInstance = targetVertex.getAllocatedResource().getInstance();
    if (assignedInstance == null) {
      LOG.error("Cannot resolve lookup: vertex found for channel ID " + edge.getInputChannelID() + " but no instance assigned");
      // LOG.info("Created receiverNotReady for " + targetVertex + " in state " + executionState + " 4");
      return ConnectionInfoLookupResponse.createReceiverNotReady();
    }

    if (assignedInstance.getInstanceConnectionInfo().equals(caller)) {
      // Receiver runs on the same task manager
      return ConnectionInfoLookupResponse.createReceiverFoundAndReady(edge.getInputChannelID());
    } else {
      // Receiver runs on a different task manager
      final InstanceConnectionInfo ici = assignedInstance.getInstanceConnectionInfo();
      final InetSocketAddress isa = new InetSocketAddress(ici.address(), ici.dataPort());

      return ConnectionInfoLookupResponse.createReceiverFoundAndReady(new RemoteReceiver(isa, edge.getConnectionID()));
    }
  }
View Full Code Here

  public InternalInstanceProfilingData() {
    this.freeMemory = -1;
    this.ioWaitCPU = -1;
    this.idleCPU = -1;
    this.instanceConnectionInfo = new InstanceConnectionInfo();
    this.profilingInterval = -1;
    this.systemCPU = -1;
    this.totalMemory = -1;
    this.bufferedMemory = -1;
    this.cachedMemory = -1;
View Full Code Here

    final InstanceType capacity = InstanceTypeFactory.construct(identifier, numComputeUnits, numCores, memorySize,
      diskCapacity,
      pricePerHour);

    final InstanceConnectionInfo instanceConnectionInfo = new InstanceConnectionInfo(inetAddress, ipcPort, dataPort);

    final HardwareDescription hardwareDescription = HardwareDescriptionFactory.construct(numCores,
      memorySize * 1024L * 1024L, memorySize * 1024L * 1024L);

    final NetworkTopology topology = NetworkTopology.createEmptyTopology();
View Full Code Here

    final InstanceTypeDescription itd = InstanceTypeDescriptionFactory.construct(INSTANCE_TYPE, hd, 1);
    instanceMap.put(INSTANCE_TYPE, itd);

    this.allocatedResources = new ArrayList<AllocatedResource>();
    try {
      final InstanceConnectionInfo ici = new InstanceConnectionInfo(Inet4Address.getLocalHost(), 1, 1);
      final NetworkTopology nt = new NetworkTopology();
      final TestInstance ti = new TestInstance(INSTANCE_TYPE, ici, nt.getRootNode(), nt, hd);
      this.allocatedResources.add(new AllocatedResource(ti, INSTANCE_TYPE, new AllocationID()));
    } catch (UnknownHostException e) {
      throw new RuntimeException(StringUtils.stringifyException(e));
View Full Code Here

                                        2L * 1024L * 1024L * 1024L);

      String hostname = "192.168.198.1";
      InetAddress address = InetAddress.getByName("192.168.198.1");
     
      InstanceConnectionInfo ici1 = new InstanceConnectionInfo(address, hostname, null, ipcPort + 0, dataPort + 0);
      InstanceConnectionInfo ici2 = new InstanceConnectionInfo(address, hostname, null, ipcPort + 15, dataPort + 15);
      InstanceConnectionInfo ici3 = new InstanceConnectionInfo(address, hostname, null, ipcPort + 30, dataPort + 30);
     
      // register three instances
      cm.reportHeartBeat(ici1, hardwareDescription);
      cm.reportHeartBeat(ici2, hardwareDescription);
      cm.reportHeartBeat(ici3, hardwareDescription);
View Full Code Here

                                        2L * 1024L * 1024L * 1024L);

      String hostname = "192.168.198.1";
      InetAddress address = InetAddress.getByName("192.168.198.1");
     
      InstanceConnectionInfo ici1 = new InstanceConnectionInfo(address, hostname, null, ipcPort + 0, dataPort + 0);
      InstanceConnectionInfo ici2 = new InstanceConnectionInfo(address, hostname, null, ipcPort + 15, dataPort + 15);
     
      // register three instances
      cm.reportHeartBeat(ici1, hardwareDescription);
      cm.reportHeartBeat(ici2, hardwareDescription);
     
View Full Code Here

                                        2L * 1024L * 1024L * 1024L);

      String hostname = "192.168.198.1";
      InetAddress address = InetAddress.getByName("192.168.198.1");
     
      InstanceConnectionInfo ici1 = new InstanceConnectionInfo(address, hostname, null, ipcPort + 0, dataPort + 0);
      InstanceConnectionInfo ici2 = new InstanceConnectionInfo(address, hostname, null, ipcPort + 15, dataPort + 15);
      InstanceConnectionInfo ici3 = new InstanceConnectionInfo(address, hostname, null, ipcPort + 30, dataPort + 30);
     
      // register three instances
      cm.reportHeartBeat(ici1, hardwareDescription);
      cm.reportHeartBeat(ici2, hardwareDescription);
      cm.reportHeartBeat(ici3, hardwareDescription);
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.instance.InstanceConnectionInfo

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.