Examples of InstanceType


Examples of com.google.gxp.compiler.base.InstanceType

  protected ContentType contentType(SourcePosition pos, Schema schema) {
    return new ContentType(pos, "ContentType", schema);
  }

  protected InstanceType instanceType(SourcePosition pos, String dottedName) {
    return new InstanceType(pos, "InstanceType", fqTemplateName(dottedName));
  }
View Full Code Here

Examples of com.linkedin.helix.InstanceType

    {
      LOG.error("missing attributes in changeContext. requires HelixManager");
      return;
    }

    InstanceType type = manager.getInstanceType();
    if (type != InstanceType.CONTROLLER && type != InstanceType.CONTROLLER_PARTICIPANT)
    {
      LOG.error("fail to become controller because incorrect instanceType (was "
          + type.toString() + ", requires CONTROLLER | CONTROLLER_PARTICIPANT)");
      return;
    }

    try
    {
View Full Code Here

Examples of com.linkedin.helix.InstanceType

  private Map<InstanceType, List<Message>> generateMessage(final Criteria recipientCriteria,
                                                           final Message message)
  {
    Map<InstanceType, List<Message>> messagesToSendMap =
        new HashMap<InstanceType, List<Message>>();
    InstanceType instanceType = recipientCriteria.getRecipientInstanceType();

    if (instanceType == InstanceType.CONTROLLER)
    {
      List<Message> messages = generateMessagesForController(message);
      messagesToSendMap.put(InstanceType.CONTROLLER, messages);
View Full Code Here

Examples of com.vmware.bdd.apitypes.InstanceType

   private static final Logger logger = Logger.getLogger(CommonClusterExpandPolicy.class);

   public static void expandGroupInstanceType(NodeGroupEntity ngEntity, NodeGroupCreate group,
         Set<String> sharedPattern, Set<String> localPattern, SoftwareManager softwareManager) {
      logger.debug("Expand instance type config for group " + ngEntity.getName());
      InstanceType instanceType = ngEntity.getNodeType();
      int memory = ngEntity.getMemorySize();
      int cpu = ngEntity.getCpuNum();
      if (instanceType == null && (cpu == 0 || memory == 0)) {
         throw ClusterConfigException.INSTANCE_SIZE_NOT_SET(group.getName());
      }
      if (instanceType == null) {
         logger.debug("instance type is not set.");
         if (softwareManager.hasMgmtRole(group.getRoles())) {
            instanceType = InstanceType.MEDIUM;
         } else {
            instanceType = InstanceType.SMALL;
         }
         ngEntity.setNodeType(instanceType);
      } else {
         logger.debug("instance type is " + instanceType.toString());
      }
      if (group.getStorage().getSizeGB() <= 0) {
         GroupType groupType = null;
         if (softwareManager.hasMgmtRole(group.getRoles())) {
            groupType = GroupType.MANAGEMENTGROUP;
         } else {
            groupType = GroupType.WORKGROUP;
         }
         ngEntity.setStorageSize(ExpandUtils.getStorage(instanceType, groupType));
         logger.debug("CommonClusterExpandPolicy::expandGroupInstanceType:storage size is setting to default value: "
               + ngEntity.getStorageSize());
      } else {
         ngEntity.setStorageSize(group.getStorage().getSizeGB());
      }
      if (memory == 0) {
         ngEntity.setMemorySize(instanceType.getMemoryMB());
      }
      if (cpu == 0) {
         ngEntity.setCpuNum(instanceType.getCpuNum());
      }

      // storage
      logger.debug("storage size is set to : " + ngEntity.getStorageSize());
      if (ngEntity.getStorageType() == null) {
View Full Code Here

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

Examples of eu.stratosphere.nephele.instance.InstanceType

  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

Examples of eu.stratosphere.nephele.instance.InstanceType

    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

Examples of eu.stratosphere.nephele.instance.InstanceType

   */
  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

Examples of eu.stratosphere.nephele.instance.InstanceType

  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

Examples of eu.stratosphere.nephele.instance.InstanceType

      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
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.