Package org.apache.flink.runtime.instance

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


      Runnable deployaction = new Runnable() {
 
        @Override
        public void run() {
          try {
            Instance instance = slot.getInstance();

            TaskOperationResult result = instance.getTaskManagerProxy().submitTask(deployment);
            if (result == null) {
              markFailed(new Exception("Failed to deploy the task to slot " + slot + ": TaskOperationResult was null"));
            }
            else if (!result.getExecutionId().equals(attemptId)) {
              markFailed(new Exception("Answer execution id does not match the request execution id."));
View Full Code Here


  public void testRestartManually() {
    final int NUM_TASKS = 31;
   
    try {
      TaskOperationProtocol tm = getSimpleAcknowledgingTaskmanager();
      Instance instance = getInstance(tm);
     
      Scheduler scheduler = new Scheduler();
      scheduler.newInstanceAvailable(instance);
     
      // The job:
View Full Code Here

  public void testRestartSelf() {
    final int NUM_TASKS = 31;
   
    try {
      TaskOperationProtocol tm = getSimpleAcknowledgingTaskmanager();
      Instance instance = getInstance(tm);
     
      Scheduler scheduler = new Scheduler();
      scheduler.newInstanceAvailable(instance);
     
      // The job:
View Full Code Here

  public void testTasksFailWhenTaskManagerLost() {
    try {
      TaskOperationProtocol tm1 = getSimpleAcknowledgingTaskmanager();
      TaskOperationProtocol tm2 = getSimpleAcknowledgingTaskmanager();
     
      Instance instance1 = getInstance(tm1, 10);
      Instance instance2 = getInstance(tm2, 10);
     
      Scheduler scheduler = new Scheduler();
      scheduler.newInstanceAvailable(instance1);
      scheduler.newInstanceAvailable(instance2);
     
View Full Code Here

  public void testSlotReleasedWhenScheduledImmediately() {
   
    try {
      // a slot than cannot be deployed to
      final TaskOperationProtocol taskManager = mock(TaskOperationProtocol.class);
      final Instance instance = getInstance(taskManager);
      final AllocatedSlot slot = instance.allocateSlot(new JobID());
      slot.cancel();
      assertFalse(slot.isReleased());
     
      final ExecutionJobVertex ejv = getJobVertexNotExecuting(new JobVertexID());
      final ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
View Full Code Here

  public void testSlotReleasedWhenScheduledQueued() {

    try {
      // a slot than cannot be deployed to
      final TaskOperationProtocol taskManager = mock(TaskOperationProtocol.class);
      final Instance instance = getInstance(taskManager);
      final AllocatedSlot slot = instance.allocateSlot(new JobID());
      slot.cancel();
      assertFalse(slot.isReleased());
     
      final SlotAllocationFuture future = new SlotAllocationFuture();
     
View Full Code Here

  @Test
  public void testScheduleToDeploy() {
    try {
      // a slot than cannot be deployed to
      final TaskOperationProtocol taskManager = mock(TaskOperationProtocol.class);
      final Instance instance = getInstance(taskManager);
      final AllocatedSlot slot = instance.allocateSlot(new JobID());
     
      final ExecutionJobVertex ejv = getJobVertexNotExecuting(new JobVertexID());
      final ExecutionVertex vertex = new ExecutionVertex(ejv, 0, new IntermediateResult[0]);
     
      Scheduler scheduler = mock(Scheduler.class);
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.Instance

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.