Examples of HardwareDescription


Examples of eu.stratosphere.nephele.instance.HardwareDescription

      LOG.error(StringUtils.stringifyException(ioe));
      throw new Exception("Failed to instantiate Byte-buffered channel manager. " + ioe.getMessage(), ioe);
    }

    {
      HardwareDescription resources = HardwareDescriptionFactory.extractFromSystem();

      // Check whether the memory size has been explicitly configured. if so that overrides the default mechanism
      // of taking as much as is mentioned in the hardware description
      long memorySize = GlobalConfiguration.getInteger(ConfigConstants.TASK_MANAGER_MEMORY_SIZE_KEY, -1);

      if (memorySize > 0) {
        // manually configured memory size. override the value in the hardware config
        resources = HardwareDescriptionFactory.construct(resources.getNumberOfCPUCores(),
          resources.getSizeOfPhysicalMemory(), memorySize * 1024L * 1024L);
      }
      this.hardwareDescription = resources;

      // Initialize the memory manager
      LOG.info("Initializing memory manager with " + (resources.getSizeOfFreeMemory() >>> 20) + " megabytes of memory. " +
          "Page size is " + pageSize + " bytes.");
     
      try {
        @SuppressWarnings("unused")
        final boolean lazyAllocation = GlobalConfiguration.getBoolean(ConfigConstants.TASK_MANAGER_MEMORY_LAZY_ALLOCATION_KEY,
          ConfigConstants.DEFAULT_TASK_MANAGER_MEMORY_LAZY_ALLOCATION);
       
        this.memoryManager = new DefaultMemoryManager(resources.getSizeOfFreeMemory(), pageSize);
      } catch (Throwable t) {
        LOG.fatal("Unable to initialize memory manager with " + (resources.getSizeOfFreeMemory() >>> 20)
          + " megabytes of memory.", t);
        throw new Exception("Unable to initialize memory manager.", t);
      }
    }

View Full Code Here

Examples of eu.stratosphere.nephele.instance.HardwareDescription

      final Iterator<ClusterInstance> it = this.registeredHosts.values().iterator();
      while (it.hasNext()) {
        final ClusterInstance clusterInstance = it.next();
        if (clusterInstance.getType().equals(currentInstanceType)) {
          ++numberOfMatchingInstances;
          final HardwareDescription hardwareDescription = clusterInstance.getHardwareDescription();
          minNumberOfCPUCores = Math.min(minNumberOfCPUCores, hardwareDescription.getNumberOfCPUCores());
          minSizeOfPhysicalMemory = Math.min(minSizeOfPhysicalMemory,
            hardwareDescription.getSizeOfPhysicalMemory());
          minSizeOfFreeMemory = Math.min(minSizeOfFreeMemory, hardwareDescription.getSizeOfFreeMemory());
        }
      }

      // Update number of instances
      int highestAccommodationNumber = -1;
      int highestAccommodationIndex = -1;
      for (int j = 0; j < this.availableInstanceTypes.length; j++) {
        final int accommodationNumber = canBeAccommodated(j, i);
        // LOG.debug(this.availableInstanceTypes[j].getIdentifier() + " fits into "
        // + this.availableInstanceTypes[i].getIdentifier() + " " + accommodationNumber + " times");
        if (accommodationNumber > 0) {
          numberOfInstances[j] += numberOfMatchingInstances * accommodationNumber;
          if (accommodationNumber > highestAccommodationNumber) {
            highestAccommodationNumber = accommodationNumber;
            highestAccommodationIndex = j;
          }
        }
      }

      // Calculate hardware description
      HardwareDescription pessimisticHardwareDescription = null;
      if (minNumberOfCPUCores < Integer.MAX_VALUE && minSizeOfPhysicalMemory < Long.MAX_VALUE
        && minSizeOfFreeMemory < Long.MAX_VALUE) {

        pessimisticHardwareDescription = HardwareDescriptionFactory.construct(minNumberOfCPUCores,
          minSizeOfPhysicalMemory, minSizeOfFreeMemory);

      } else {

        if (highestAccommodationIndex < i) { // Since highestAccommodationIndex smaller than my index, the
                            // target instance must be more powerful

          final InstanceTypeDescription descriptionOfLargerInstanceType = instanceTypeDescriptionList
            .get(highestAccommodationIndex);
          if (descriptionOfLargerInstanceType.getHardwareDescription() != null) {
            final HardwareDescription hardwareDescriptionOfLargerInstanceType = descriptionOfLargerInstanceType
              .getHardwareDescription();

            final int numCores = hardwareDescriptionOfLargerInstanceType.getNumberOfCPUCores()
              / highestAccommodationNumber;
            final long physMem = hardwareDescriptionOfLargerInstanceType.getSizeOfPhysicalMemory()
              / highestAccommodationNumber;
            final long freeMem = hardwareDescriptionOfLargerInstanceType.getSizeOfFreeMemory()
              / highestAccommodationNumber;

            pessimisticHardwareDescription = HardwareDescriptionFactory.construct(numCores, physMem,
              freeMem);
          }
View Full Code Here

Examples of eu.stratosphere.nephele.instance.HardwareDescription

   * is calculated from the free space in the directory for temporary files.
   *
   * @return the default instance type used for the local machine
   */
  public static final InstanceType createDefaultInstanceType() {
    final HardwareDescription hardwareDescription = HardwareDescriptionFactory.extractFromSystem();

    int diskCapacityInGB = 0;
    final String[] tempDirs = GlobalConfiguration.getString(ConfigConstants.TASK_MANAGER_TMP_DIR_KEY,
      ConfigConstants.DEFAULT_TASK_MANAGER_TMP_PATH).split(File.pathSeparator);
   
    for (final String tempDir : tempDirs) {
      if (tempDir != null) {
        File f = new File(tempDir);
        diskCapacityInGB = Math.max(diskCapacityInGB, (int) (f.getFreeSpace() / (1024L * 1024L * 1024L)));
      }
    }

    final int physicalMemory = (int) (hardwareDescription.getSizeOfPhysicalMemory() / (1024L * 1024L));

    return InstanceTypeFactory.construct("default", hardwareDescription.getNumberOfCPUCores(),
      hardwareDescription.getNumberOfCPUCores(), physicalMemory, diskCapacityInGB, 0);
  }
View Full Code Here

Examples of eu.stratosphere.nephele.instance.HardwareDescription

    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

Examples of eu.stratosphere.nephele.instance.HardwareDescription

      diskCapacity,
      pricePerHour);

    final InstanceConnectionInfo instanceConnectionInfo = new InstanceConnectionInfo(inetAddress, ipcPort, dataPort);

    final HardwareDescription hardwareDescription = HardwareDescriptionFactory.construct(numCores,
      memorySize * 1024L * 1024L, memorySize * 1024L * 1024L);

    final NetworkTopology topology = NetworkTopology.createEmptyTopology();
    ClusterInstance host = new ClusterInstance(instanceConnectionInfo, capacity, topology.getRootNode(), topology,
      hardwareDescription);
View Full Code Here

Examples of eu.stratosphere.nephele.instance.HardwareDescription

     
     
      int ipcPort = ConfigConstants.DEFAULT_TASK_MANAGER_IPC_PORT;
      int dataPort = ConfigConstants.DEFAULT_TASK_MANAGER_DATA_PORT;

      HardwareDescription hardwareDescription = HardwareDescriptionFactory.construct(2, 2L * 1024L * 1024L * 1024L,
                                        2L * 1024L * 1024L * 1024L);

      String hostname = "192.168.198.1";
      InetAddress address = InetAddress.getByName("192.168.198.1");
     
View Full Code Here

Examples of eu.stratosphere.nephele.instance.HardwareDescription

  /**
   * Constructs a new test instance manager
   */
  public TestInstanceManager() {

    final HardwareDescription hd = HardwareDescriptionFactory.construct(1, 1L, 1L);
    final InstanceTypeDescription itd = InstanceTypeDescriptionFactory.construct(INSTANCE_TYPE, hd, 1);
    instanceMap.put(INSTANCE_TYPE, itd);

    this.allocatedResources = new ArrayList<AllocatedResource>();
    try {
View Full Code Here

Examples of eu.stratosphere.nephele.instance.HardwareDescription

     
     
      int ipcPort = ConfigConstants.DEFAULT_TASK_MANAGER_IPC_PORT;
      int dataPort = ConfigConstants.DEFAULT_TASK_MANAGER_DATA_PORT;

      HardwareDescription hardwareDescription = HardwareDescriptionFactory.construct(2, 2L * 1024L * 1024L * 1024L,
                                        2L * 1024L * 1024L * 1024L);

      String hostname = "192.168.198.1";
      InetAddress address = InetAddress.getByName("192.168.198.1");
     
View Full Code Here

Examples of eu.stratosphere.nephele.instance.HardwareDescription

     
     
      int ipcPort = ConfigConstants.DEFAULT_TASK_MANAGER_IPC_PORT;
      int dataPort = ConfigConstants.DEFAULT_TASK_MANAGER_DATA_PORT;

      HardwareDescription hardwareDescription = HardwareDescriptionFactory.construct(2, 2L * 1024L * 1024L * 1024L,
                                        2L * 1024L * 1024L * 1024L);

      String hostname = "192.168.198.1";
      InetAddress address = InetAddress.getByName("192.168.198.1");
     
View Full Code Here

Examples of eu.stratosphere.nephele.instance.HardwareDescription

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