Examples of AllocatedResource


Examples of eu.stratosphere.nephele.instance.AllocatedResource

    if (allocatedResource == null) {
      throw new IllegalArgumentException("Argument allocatedResource must not be null");
    }

    final AllocatedResource previousResource = this.allocatedResource.getAndSet(allocatedResource);
    if (previousResource != null) {
      previousResource.removeVertexFromResource(this);
    }

    allocatedResource.assignVertexToResource(this);

    // Notify all listener objects
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

   *
   * @return the result of the task submission attempt
   */
  public TaskSubmissionResult startTask() {

    final AllocatedResource ar = this.allocatedResource.get();

    if (ar == null) {
      final TaskSubmissionResult result = new TaskSubmissionResult(getID(),
        AbstractTaskResult.ReturnCode.NO_INSTANCE);
      result.setDescription("Assigned instance of vertex " + this.toString() + " is null!");
      return result;
    }

    final List<TaskDeploymentDescriptor> tasks = new SerializableArrayList<TaskDeploymentDescriptor>();
    tasks.add(constructDeploymentDescriptor());

    try {
      final List<TaskSubmissionResult> results = ar.getInstance().submitTasks(tasks);

      return results.get(0);

    } catch (IOException e) {
      final TaskSubmissionResult result = new TaskSubmissionResult(getID(),
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

      final TaskKillResult result = new TaskKillResult(getID(), AbstractTaskResult.ReturnCode.ILLEGAL_STATE);
      result.setDescription("Vertex " + this.toString() + " is in state " + state);
      return result;
    }

    final AllocatedResource ar = this.allocatedResource.get();

    if (ar == null) {
      final TaskKillResult result = new TaskKillResult(getID(), AbstractTaskResult.ReturnCode.NO_INSTANCE);
      result.setDescription("Assigned instance of vertex " + this.toString() + " is null!");
      return result;
    }

    try {
      return ar.getInstance().killTask(this.vertexID);
    } catch (IOException e) {
      final TaskKillResult result = new TaskKillResult(getID(), AbstractTaskResult.ReturnCode.IPC_ERROR);
      result.setDescription(StringUtils.stringifyException(e));
      return result;
    }
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

          // Set to canceled directly
          updateExecutionState(ExecutionState.CANCELED, null);
          return new TaskCancelResult(getID(), AbstractTaskResult.ReturnCode.SUCCESS);
        }

        final AllocatedResource ar = this.allocatedResource.get();

        if (ar == null) {
          final TaskCancelResult result = new TaskCancelResult(getID(),
            AbstractTaskResult.ReturnCode.NO_INSTANCE);
          result.setDescription("Assigned instance of vertex " + this.toString() + " is null!");
          return result;
        }

        try {
          return ar.getInstance().cancelTask(this.vertexID);

        } catch (IOException e) {
          final TaskCancelResult result = new TaskCancelResult(getID(),
            AbstractTaskResult.ReturnCode.IPC_ERROR);
          result.setDescription(StringUtils.stringifyException(e));
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

    int currentNumberOfExecutionVertices = this.getCurrentNumberOfGroupMembers();

    while (currentNumberOfExecutionVertices++ < initalNumberOfVertices) {

      final ExecutionVertex vertex = originalVertex.splitVertex();
      vertex.setAllocatedResource(new AllocatedResource(DummyInstance
        .createDummyInstance(this.instanceType), this.instanceType, null));
      this.groupMembers.add(vertex);
    }

    // Update the index and size information attached to the vertices
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

        if (!resourceIt.hasNext()) {
          break;
        }

        final ExecutionVertex vertex = vertexIt.next();
        final AllocatedResource originalResource = vertex.getAllocatedResource();

        if (!replacementMap.containsKey(originalResource)) {

          final AllocatedResource replacementResource = resourceIt.next();
          replacementMap.put(originalResource, replacementResource);
        }
      }
    }

    // Now replace the instances
    final Iterator<ExecutionVertex> vertexIt = this.groupMembers.iterator();
    while (vertexIt.hasNext()) {

      final ExecutionVertex vertex = vertexIt.next();
      final AllocatedResource originalResource = vertex.getAllocatedResource();
      final AllocatedResource replacementResource = replacementMap.get(originalResource);
      if (replacementResource != null) {
        vertex.setAllocatedResource(replacementResource);
      } else {
        availableResources.add(originalResource);
      }
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

    final ExecutionVertex ev = new ExecutionVertex(this, groupVertex, jobVertex.getNumberOfForwardConnections(),
      jobVertex.getNumberOfBackwardConnections());

    // Assign initial instance to vertex (may be overwritten later on when user settings are applied)
    ev.setAllocatedResource(new AllocatedResource(DummyInstance.createDummyInstance(instanceType), instanceType,
      null));

    return ev;
  }
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

              allocatedSlices = new ArrayList<AllocatedSlice>();
              this.slicesOfJobs.put(jobID, allocatedSlices);
            }
            allocatedSlices.add(slice);

            allocatedResources.add(new AllocatedResource(slice.getHostingInstance(), slice.getType(), slice
              .getAllocationID()));
          }
        }
      }
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

      }
 
      // Finally, create the list of allocated resources for the scheduler
      final List<AllocatedResource> allocatedResources = new ArrayList<AllocatedResource>();
      for (final AllocatedSlice slice : newlyAllocatedSlicesOfJob) {
        allocatedResources.add(new AllocatedResource(slice.getHostingInstance(), slice.getType(), slice
          .getAllocationID()));
      }
 
      if (this.instanceListener != null) {
        final ClusterInstanceNotifier clusterInstanceNotifier = new ClusterInstanceNotifier(
View Full Code Here

Examples of eu.stratosphere.nephele.instance.AllocatedResource

        synchronized (this.synchronizationObject) {
          boolean instanceFound = false;
          for(LocalInstance instance: localInstances.values()){
            if(!allocatedResources.containsKey(instance)){
              AllocatedResource assignedResource = new AllocatedResource(instance, entry.getKey(),
                  new AllocationID());
              allocatedResources.put(instance, assignedResource);
              assignedResources.add(assignedResource);
              instanceFound = true;
              break;
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.