Package eu.stratosphere.nephele.execution

Examples of eu.stratosphere.nephele.execution.Environment


   *
   * @param vertexId the ID of the task to be unregistered
   * @param task the task to be unregistered
   */
  public void unregister(ExecutionVertexID vertexId, Task task) {
    final Environment environment = task.getEnvironment();

    // destroy and remove OUTPUT channels from registered channels and cache
    for (ChannelID id : environment.getOutputChannelIDs()) {
      Channel channel = this.channels.remove(id);
      if (channel != null) {
        channel.destroy();
      }

      this.receiverCache.remove(channel);
    }

    // destroy and remove INPUT channels from registered channels and cache
    for (ChannelID id : environment.getInputChannelIDs()) {
      Channel channel = this.channels.remove(id);
      if (channel != null) {
        channel.destroy();
      }

      this.receiverCache.remove(channel);
    }

    // clear and remove INPUT side buffer pools
    for (GateID id : environment.getInputGateIDs()) {
      LocalBufferPoolOwner bufferPool = this.localBuffersPools.remove(id);
      if (bufferPool != null) {
        bufferPool.clearLocalBufferPool();
      }
    }
View Full Code Here


   *
   * @param task task to be executed
   * @throws InsufficientResourcesException thrown if not enough buffers available to execute the task
   */
  private void ensureBufferAvailability(Task task) throws InsufficientResourcesException {
    Environment env = task.getEnvironment();

    int numBuffers = this.globalBufferPool.numBuffers();
    // existing channels + channels of the task
    int numChannels = this.channels.size() + env.getNumberOfOutputChannels() + env.getNumberOfInputChannels();

    // need at least one buffer per channel
    if (numBuffers / numChannels < 1) {
      String msg = String.format("%s has not enough buffers to safely execute %s (%d buffers missing)",
          this.connectionInfo.hostname(), env.getTaskName(), numChannels - numBuffers);

      throw new InsufficientResourcesException(msg);
    }
  }
View Full Code Here

    this.eventualOutputs = new ArrayList<BufferWriter>();
    this.output = initOutputs(this, this.userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs);
  }

  public RuntimeUDFContext createRuntimeContext(String taskName) {
    Environment env = getEnvironment();
    return new RuntimeUDFContext(taskName, env.getCurrentNumberOfSubtasks(), env.getIndexInSubtaskGroup(), env.getCopyTask());
  }
View Full Code Here

    // Collect profiling information of the threads
    synchronized (this.monitoredThreads) {

      final Iterator<Environment> iterator = this.monitoredThreads.keySet().iterator();
      while (iterator.hasNext()) {
        final Environment environment = iterator.next();
        final EnvironmentThreadSet environmentThreadSet = this.monitoredThreads.get(environment);
        final InternalExecutionVertexThreadProfilingData threadProfilingData = environmentThreadSet
          .captureCPUUtilization(environment.getJobID(), this.tmx, timestamp);
        if (threadProfilingData != null) {
          this.profilingDataContainer.addProfilingData(threadProfilingData);
        }
      }
View Full Code Here

    }
  }

  @Override
  public RuntimeUDFContext createRuntimeContext(String taskName) {
    Environment env = getEnvironment();
    return new IterativeRuntimeUdfContext(taskName, env.getCurrentNumberOfSubtasks(), env.getIndexInSubtaskGroup());
  }
View Full Code Here

    this.userCodeClassLoader = userCodeClassLoader;
   
    if (parent instanceof RegularPactTask) {
      this.udfContext = ((RegularPactTask<?, ?>) parent).createRuntimeContext(taskName);
    } else {
      Environment env = parent.getEnvironment();
      this.udfContext = new RuntimeUDFContext(taskName, env.getCurrentNumberOfSubtasks(), env.getIndexInSubtaskGroup(), env.getCopyTask());
    }

    setup(parent);
  }
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.execution.Environment

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.