Search in sources :

Example 1 with SlotManagerConfiguration

use of org.apache.flink.runtime.resourcemanager.slotmanager.SlotManagerConfiguration in project flink by apache.

the class ResourceManagerRuntimeServicesConfiguration method fromConfiguration.

// ---------------------------- Static methods ----------------------------------
public static ResourceManagerRuntimeServicesConfiguration fromConfiguration(Configuration configuration, WorkerResourceSpecFactory defaultWorkerResourceSpecFactory) throws ConfigurationException {
    final String strJobTimeout = configuration.getString(ResourceManagerOptions.JOB_TIMEOUT);
    final Time jobTimeout;
    try {
        jobTimeout = Time.milliseconds(TimeUtils.parseDuration(strJobTimeout).toMillis());
    } catch (IllegalArgumentException e) {
        throw new ConfigurationException("Could not parse the resource manager's job timeout " + "value " + ResourceManagerOptions.JOB_TIMEOUT + '.', e);
    }
    final WorkerResourceSpec defaultWorkerResourceSpec = defaultWorkerResourceSpecFactory.createDefaultWorkerResourceSpec(configuration);
    final SlotManagerConfiguration slotManagerConfiguration = SlotManagerConfiguration.fromConfiguration(configuration, defaultWorkerResourceSpec);
    final boolean enableFineGrainedResourceManagement = ClusterOptions.isFineGrainedResourceManagementEnabled(configuration);
    return new ResourceManagerRuntimeServicesConfiguration(jobTimeout, slotManagerConfiguration, enableFineGrainedResourceManagement);
}
Also used : ConfigurationException(org.apache.flink.util.ConfigurationException) Time(org.apache.flink.api.common.time.Time) SlotManagerConfiguration(org.apache.flink.runtime.resourcemanager.slotmanager.SlotManagerConfiguration)

Aggregations

Time (org.apache.flink.api.common.time.Time)1 SlotManagerConfiguration (org.apache.flink.runtime.resourcemanager.slotmanager.SlotManagerConfiguration)1 ConfigurationException (org.apache.flink.util.ConfigurationException)1