Package eu.stratosphere.nephele.instance

Examples of eu.stratosphere.nephele.instance.InstanceType


            collectedInstances.add(instance);
          }

          if (instance instanceof DummyInstance) {

            final InstanceType instanceType = instance.getType();
            int num = instanceRequestMap.getMaximumNumberOfInstances(instanceType);
            ++num;
            instanceRequestMap.setMaximumNumberOfInstances(instanceType, num);
            if (groupVertex.isInputVertex()) {
              num = instanceRequestMap.getMinimumNumberOfInstances(instanceType);
View Full Code Here


  private ExecutionVertex createVertex(final AbstractJobVertex jobVertex, final InstanceManager instanceManager,
      final ExecutionStage initialExecutionStage, final Configuration jobConfiguration)
      throws GraphConversionException {

    // If the user has requested instance type, check if the type is known by the current instance manager
    InstanceType instanceType = null;
    boolean userDefinedInstanceType = false;
    if (jobVertex.getInstanceType() != null) {

      userDefinedInstanceType = true;
      instanceType = instanceManager.getInstanceTypeByName(jobVertex.getInstanceType());
View Full Code Here

    if (this.availableInstanceTypes.length < 2) {
      return;
    }

    for (int i = 1; i < this.availableInstanceTypes.length; i++) {
      final InstanceType it = this.availableInstanceTypes[i];
      int j = i;
      while (j > 0 && this.availableInstanceTypes[j - 1].getNumberOfCores() < it.getNumberOfCores()) {
        this.availableInstanceTypes[j] = this.availableInstanceTypes[j - 1];
        --j;
      }
      this.availableInstanceTypes[j] = it;
    }
View Full Code Here

   */
  private ClusterInstance createNewHost(final InstanceConnectionInfo instanceConnectionInfo,
      final HardwareDescription hardwareDescription) {

    // Check if there is a user-defined instance type for this IP address
    InstanceType instanceType = this.ipToInstanceTypeMapping.get(instanceConnectionInfo.address());
    if (instanceType != null) {
      LOG.info("Found user-defined instance type for cluster instance with IP "
        + instanceConnectionInfo.address() + ": " + instanceType);
    } else {
      instanceType = matchHardwareDescriptionWithInstanceType(hardwareDescription);
View Full Code Here

  private InstanceType matchHardwareDescriptionWithInstanceType(final HardwareDescription hardwareDescription) {

    // Assumes that the available instance types are ordered by number of CPU cores in descending order
    for (int i = 0; i < this.availableInstanceTypes.length; i++) {

      final InstanceType candidateInstanceType = this.availableInstanceTypes[i];
      // Check if number of CPU cores match
      if (candidateInstanceType.getNumberOfCores() > hardwareDescription.getNumberOfCPUCores()) {
        continue;
      }

      // Check if size of physical memory matches
      final int memoryInMB = (int) (hardwareDescription.getSizeOfPhysicalMemory() / (1024L * 1024L));
      if (candidateInstanceType.getMemorySize() > memoryInMB) {
        continue;
      }

      return candidateInstanceType;
    }
View Full Code Here

      final PendingRequestsMap pendingRequestsMap = entry.getValue();
      final Iterator<Map.Entry<InstanceType, Integer>> it2 = pendingRequestsMap.iterator();
      while (it2.hasNext()) {

        final Map.Entry<InstanceType, Integer> entry2 = it2.next();
        final InstanceType requestedInstanceType = entry2.getKey();
        int numberOfPendingInstances = entry2.getValue().intValue();

        // Consistency check
        if (numberOfPendingInstances <= 0) {
          LOG.error("Inconsistency: Job " + jobID + " has " + numberOfPendingInstances
            + " requests for instance type " + requestedInstanceType.getIdentifier());
          continue;
        }

        while (numberOfPendingInstances > 0) {

          if (LOG.isDebugEnabled()) {
            LOG.debug("Trying to allocate instance of type " + requestedInstanceType.getIdentifier());
          }

          // TODO: Introduce topology awareness here
          final AllocatedSlice slice = getSliceOfType(jobID, requestedInstanceType);
          if (slice == null) {
            break;
          } else {

            LOG.info("Allocated instance of type " + requestedInstanceType.getIdentifier()
              + " as a result of pending request for job " + jobID);

            // Decrease number of pending instances
            --numberOfPendingInstances;
            pendingRequestsMap.decreaseNumberOfPendingInstances(requestedInstanceType);
View Full Code Here

    }

    // Shuffle through instance types
    for (int i = 0; i < this.availableInstanceTypes.length; i++) {

      final InstanceType currentInstanceType = this.availableInstanceTypes[i];
      int numberOfMatchingInstances = 0;
      int minNumberOfCPUCores = Integer.MAX_VALUE;
      long minSizeOfPhysicalMemory = Long.MAX_VALUE;
      long minSizeOfFreeMemory = Long.MAX_VALUE;
      final Iterator<ClusterInstance> it = this.registeredHosts.values().iterator();
View Full Code Here

        if (i == j) {
          am[i][j] = 1;
        } else {

          final InstanceType sourceType = this.availableInstanceTypes[i];
          InstanceType targetType = this.availableInstanceTypes[j];

          // How many times can we accommodate source type into target type?
          final int cores = targetType.getNumberOfCores() / sourceType.getNumberOfCores();
          final int cu = targetType.getNumberOfComputeUnits() / sourceType.getNumberOfComputeUnits();
          final int mem = targetType.getMemorySize() / sourceType.getMemorySize();
          final int disk = targetType.getDiskCapacity() / sourceType.getDiskCapacity();

          am[i][j] = Math.min(cores, Math.min(cu, Math.min(mem, disk)));
        }
      }
    }
View Full Code Here

  public LocalInstanceManager() throws Exception {

    final Configuration config = GlobalConfiguration.getConfiguration();

    // get the default instance type
    InstanceType type = null;
    final String descr = config.getString(LOCALINSTANCE_TYPE_KEY, null);
    if (descr != null) {
      LOG.info("Attempting to parse default instance type from string " + descr);
      type = InstanceTypeFactory.constructFromDescription(descr);
      if (type == null) {
View Full Code Here

   
    this.noStatsCompiler = new PactCompiler(null, new DefaultCostEstimator(), dummyAddr);
    this.noStatsCompiler.setDefaultDegreeOfParallelism(DEFAULT_PARALLELISM);
   
    // create the instance type description
    InstanceType iType = InstanceTypeFactory.construct("standard", 6, 2, 4096, 100, 0);
    HardwareDescription hDesc = HardwareDescriptionFactory.construct(2, 4096 * 1024 * 1024, 2000 * 1024 * 1024);
    this.instanceType = InstanceTypeDescriptionFactory.construct(iType, hDesc, DEFAULT_PARALLELISM * 2);
  }
 
View Full Code Here

TOP

Related Classes of eu.stratosphere.nephele.instance.InstanceType

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.