Search in sources :

Example 1 with StorageProperties

use of org.apache.asterix.common.config.StorageProperties in project asterixdb by apache.

the class NCApplication method getCapacity.

@Override
public NodeCapacity getCapacity() {
    StorageProperties storageProperties = runtimeContext.getStorageProperties();
    // Deducts the reserved buffer cache size and memory component size from the maxium heap size,
    // and deducts one core for processing heartbeats.
    long memorySize = Runtime.getRuntime().maxMemory() - storageProperties.getBufferCacheSize() - storageProperties.getMemoryComponentGlobalBudget();
    int allCores = Runtime.getRuntime().availableProcessors();
    int maximumCoresForComputation = allCores > 1 ? allCores - 1 : allCores;
    return new NodeCapacity(memorySize, maximumCoresForComputation);
}
Also used : StorageProperties(org.apache.asterix.common.config.StorageProperties) NodeCapacity(org.apache.hyracks.api.job.resource.NodeCapacity)

Aggregations

StorageProperties (org.apache.asterix.common.config.StorageProperties)1 NodeCapacity (org.apache.hyracks.api.job.resource.NodeCapacity)1