Examples of InstanceConnectionInfo


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

Examples of eu.stratosphere.nephele.instance.InstanceConnectionInfo

      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

Examples of eu.stratosphere.nephele.instance.InstanceConnectionInfo

  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

Examples of eu.stratosphere.nephele.instance.InstanceConnectionInfo

    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

Examples of eu.stratosphere.nephele.instance.InstanceConnectionInfo

    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

Examples of eu.stratosphere.nephele.instance.InstanceConnectionInfo

                                        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

Examples of eu.stratosphere.nephele.instance.InstanceConnectionInfo

                                        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

Examples of eu.stratosphere.nephele.instance.InstanceConnectionInfo

                                        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

Examples of org.apache.flink.runtime.instance.InstanceConnectionInfo

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

          int connectionIdx = edge.getSource().getIntermediateResult().getConnectionIndex();
          return ConnectionInfoLookupResponse.createReceiverFoundAndReady(new RemoteReceiver(isa, connectionIdx));
        }
      }
      else if (executionState == ExecutionState.FINISHED) {
        // that should not happen. if there is data pending, the sender cannot yet be done
        // we need to fail the whole affair
        LOG.error("Receiver " + targetVertex + " set to FINISHED even though data is pending");
        fail(new Exception("Channels are not correctly registered"));
        return ConnectionInfoLookupResponse.createReceiverNotFound();
      }
      else if (executionState == ExecutionState.FAILED || executionState == ExecutionState.CANCELED ||
          executionState == ExecutionState.CANCELING)
      {
        return ConnectionInfoLookupResponse.createJobIsAborting();
      }
      else {
        // all other states should not be, because the sender cannot be in CREATED, SCHEDULED, or DEPLOYING
        // state when the receiver is already running
        LOG.error("Channel lookup (backwards) - sender " + targetVertex + " found in inconsistent state " + executionState);
        fail(new Exception("Channels are not correctly registered"));
        return ConnectionInfoLookupResponse.createReceiverNotFound();
      }
    }
   
    //  ----- Request was sent from an output channel (sender side), requesting the input channel (receiver side) ------
    //  -----                                 This is the case for forward data                                   ------
   
    final ExecutionVertex targetVertex = edge.getTarget();
    final ExecutionState executionState = targetVertex.getExecutionState();

    if (executionState == ExecutionState.RUNNING) {
     
      // already online
      Instance location = targetVertex.getCurrentAssignedResource().getInstance();
     
      if (location.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 = location.getInstanceConnectionInfo();
        final InetSocketAddress isa = new InetSocketAddress(ici.address(), ici.dataPort());

        final int connectionIdx = edge.getSource().getIntermediateResult().getConnectionIndex();
        return ConnectionInfoLookupResponse.createReceiverFoundAndReady(new RemoteReceiver(isa, connectionIdx));
      }
    }
View Full Code Here

Examples of org.apache.flink.runtime.instance.InstanceConnectionInfo

  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
TOP
Copyright © 2018 www.massapi.com. 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.