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);
}
Aggregations