Package eu.stratosphere.nephele.executiongraph

Examples of eu.stratosphere.nephele.executiongraph.ExecutionVertex


      if (inputSplits.length == 0) {
        continue;
      }

      for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); ++i) {
        final ExecutionVertex vertex = groupVertex.getGroupMember(i);
        if (this.splitMap.put(vertex.getID(), new ArrayList<InputSplit>()) != null) {
          LOG.error("InputSplitTracker must keep track of two vertices with ID " + vertex.getID());
        }
      }
    }
  }
View Full Code Here


    // Set state of each vertex for scheduled
    final ExecutionGraphIterator it2 = new ExecutionGraphIterator(executionGraph, true);
    while (it2.hasNext()) {

      final ExecutionVertex vertex = it2.next();
      vertex.registerExecutionListener(new LocalExecutionListener(this, vertex));
    }

    // Register the scheduler as an execution stage listener
    executionGraph.registerExecutionStageListener(this);
View Full Code Here

      }

      // Find another vertex in the group which is still in SCHEDULED state and get its pipeline.
      final ExecutionGroupVertex groupVertex = this.executionVertex.getGroupVertex();
      for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); ++i) {
        final ExecutionVertex groupMember = groupVertex.getGroupMember(i);
        if (groupMember.compareAndUpdateExecutionState(ExecutionState.SCHEDULED, ExecutionState.ASSIGNED)) {

          final ExecutionPipeline pipelineToBeDeployed = groupMember.getExecutionPipeline();
          pipelineToBeDeployed.setAllocatedResource(this.executionVertex.getAllocatedResource());
          pipelineToBeDeployed.updateExecutionState(ExecutionState.ASSIGNED);

          this.scheduler.deployAssignedPipeline(pipelineToBeDeployed);
          return;
View Full Code Here

    // Register execution listener for each vertex
    final ExecutionGraphIterator it2 = new ExecutionGraphIterator(executionGraph, true);
    while (it2.hasNext()) {

      final ExecutionVertex vertex = it2.next();
      vertex.registerExecutionListener(new QueueExecutionListener(this, vertex));
    }

    // Register the scheduler as an execution stage listener
    executionGraph.registerExecutionStageListener(this);
View Full Code Here

      if (deployTarget) {

        final int numberOfOutputChannels = outputGate.getNumberOfEdges();
        for (int j = 0; j < numberOfOutputChannels; ++j) {
          final ExecutionEdge outputChannel = outputGate.getEdge(j);
          final ExecutionVertex connectedVertex = outputChannel.getInputGate().getVertex();
          findVerticesToBeDeployed(connectedVertex, verticesToBeDeployed, alreadyVisited);
        }
      }
    }
  }
View Full Code Here

      if (!startVertex.isInputVertex()) {
        continue;
      }

      for (int j = 0; j < startVertex.getCurrentNumberOfGroupMembers(); ++j) {
        final ExecutionVertex vertex = startVertex.getGroupMember(j);
        findVerticesToBeDeployed(vertex, verticesToBeDeployed, alreadyVisited);
      }
    }

    if (!verticesToBeDeployed.isEmpty()) {
View Full Code Here

            while (groupIterator.hasNext()) {

              final ExecutionGroupVertex groupVertex = groupIterator.next();
              for (int i = 0; i < groupVertex.getCurrentNumberOfGroupMembers(); ++i) {

                final ExecutionVertex vertex = groupVertex.getGroupMember(i);

                if (vertex.getExecutionState() == ExecutionState.SCHEDULED
                  && vertex.getAllocatedResource() != null) {
                  // In local mode, we do not consider any topology, only the instance type
                  if (vertex.getAllocatedResource().getInstanceType().equals(
                    allocatedResource.getInstanceType())) {
                    resourceToBeReplaced = vertex.getAllocatedResource();
                    break;
                  }
                }
              }

              if (resourceToBeReplaced != null) {
                break;
              }
            }

            // For some reason, we don't need this instance
            if (resourceToBeReplaced == null) {
              LOG.error("Instance " + allocatedResource.getInstance() + " is not required for job"
                + eg.getJobID());
              try {
                getInstanceManager().releaseAllocatedResource(jobID, eg.getJobConfiguration(),
                  allocatedResource);
              } catch (InstanceException e) {
                LOG.error(e);
              }
              return;
            }

            // Replace the selected instance
            final Iterator<ExecutionVertex> it = resourceToBeReplaced.assignedVertices();
            while (it.hasNext()) {
              final ExecutionVertex vertex = it.next();
              vertex.setAllocatedResource(allocatedResource);
              vertex.updateExecutionState(ExecutionState.ASSIGNED);
            }
          }
        }

        // Deploy the assigned vertices
View Full Code Here

    }

    boolean resourceCanBeReleased = true;
    final Iterator<ExecutionVertex> it = allocatedResource.assignedVertices();
    while (it.hasNext()) {
      final ExecutionVertex vertex = it.next();
      final ExecutionState state = vertex.getExecutionState();

      if (state != ExecutionState.CREATED && state != ExecutionState.FINISHED
        && state != ExecutionState.FAILED && state != ExecutionState.CANCELED) {

        resourceCanBeReleased = false;
View Full Code Here

    final List<ExecutionVertex> verticesToBeReplayed = new ArrayList<ExecutionVertex>();

    for (int i = 0; i < previousStage.getNumberOfOutputExecutionVertices(); ++i) {

      final ExecutionVertex vertex = previousStage.getOutputExecutionVertex(i);
      vertex.updateExecutionState(ExecutionState.ASSIGNED);
      verticesToBeReplayed.add(vertex);
    }

    deployAssignedVertices(verticesToBeReplayed);
  }
View Full Code Here

              .getType());
            final AllocatedResource dummyResource = new AllocatedResource(dummyInstance,
              allocatedResource.getInstanceType(), new AllocationID());

            while (vertexIter.hasNext()) {
              final ExecutionVertex vertex = vertexIter.next();
              vertex.setAllocatedResource(dummyResource);
            }

            final String failureMessage = allocatedResource.getInstance().getName() + " died";

            vertexIter = allocatedResource.assignedVertices();

            while (vertexIter.hasNext()) {
              final ExecutionVertex vertex = vertexIter.next();
              final ExecutionState state = vertex.getExecutionState();

              switch (state) {
              case ASSIGNED:
              case READY:
              case STARTING:
              case RUNNING:
              case FINISHING:

              vertex.updateExecutionState(ExecutionState.FAILED, failureMessage);

              break;
            default:
              }
          }
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.executiongraph.ExecutionVertex

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.