Package org.apache.flink.runtime.instance

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


  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

    }
    if (dataPort == -1) {
      dataPort = getAvailablePort();
    }
   
    this.localInstanceConnectionInfo = new InstanceConnectionInfo(taskManagerBindAddress, ipcPort, dataPort);
    LOG.info("TaskManager connection information:" + this.localInstanceConnectionInfo);

    // Start local RPC server, give it the number of threads as we have slots
    try {
      // some magic number for the handler threads
View Full Code Here

    }
   
    int ipcPort = port.getAndIncrement();
    int dataPort = port.getAndIncrement();
   
    InstanceConnectionInfo ci = new InstanceConnectionInfo(address, ipcPort, dataPort);
   
    final long GB = 1024L*1024*1024;
    HardwareDescription resources = new HardwareDescription(4, 4*GB, 3*GB, 2*GB);
   
    return new Instance(ci, new InstanceID(), resources, numSlots);
View Full Code Here

  }
 
  public static Instance getInstance(final TaskOperationProtocol top, int numSlots) throws Exception {
    HardwareDescription hardwareDescription = new HardwareDescription(4, 2L*1024*1024*1024, 1024*1024*1024, 512*1024*1024);
    InetAddress address = InetAddress.getByName("127.0.0.1");
    InstanceConnectionInfo connection = new InstanceConnectionInfo(address, 10000, 10001);
   
    return new Instance(connection, new InstanceID(), hardwareDescription, numSlots) {
      @Override
      public TaskOperationProtocol getTaskManagerProxy() {
        return top;
View Full Code Here

TOP

Related Classes of org.apache.flink.runtime.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.