org.apache.flink.runtime.resourcemanager.slotmanager.SlotManagerConfiguration Java Examples

The following examples show how to use org.apache.flink.runtime.resourcemanager.slotmanager.SlotManagerConfiguration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ResourceManagerRuntimeServicesConfiguration.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public static ResourceManagerRuntimeServicesConfiguration fromConfiguration(Configuration configuration) throws ConfigurationException {

		final String strJobTimeout = configuration.getString(ResourceManagerOptions.JOB_TIMEOUT);
		final Time jobTimeout;

		try {
			jobTimeout = Time.milliseconds(Duration.apply(strJobTimeout).toMillis());
		} catch (NumberFormatException e) {
			throw new ConfigurationException("Could not parse the resource manager's job timeout " +
				"value " + ResourceManagerOptions.JOB_TIMEOUT + '.', e);
		}

		final SlotManagerConfiguration slotManagerConfiguration = SlotManagerConfiguration.fromConfiguration(configuration);

		return new ResourceManagerRuntimeServicesConfiguration(jobTimeout, slotManagerConfiguration);
	}
 
Example #2
Source File: ResourceManagerRuntimeServices.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public static ResourceManagerRuntimeServices fromConfiguration(
		ResourceManagerRuntimeServicesConfiguration configuration,
		HighAvailabilityServices highAvailabilityServices,
		ScheduledExecutor scheduledExecutor) throws Exception {

	final SlotManagerConfiguration slotManagerConfiguration = configuration.getSlotManagerConfiguration();

	final SlotManager slotManager = new SlotManager(
		scheduledExecutor,
		slotManagerConfiguration.getTaskManagerRequestTimeout(),
		slotManagerConfiguration.getSlotRequestTimeout(),
		slotManagerConfiguration.getTaskManagerTimeout(),
		slotManagerConfiguration.isWaitResultConsumedBeforeRelease());

	final JobLeaderIdService jobLeaderIdService = new JobLeaderIdService(
		highAvailabilityServices,
		scheduledExecutor,
		configuration.getJobTimeout());

	return new ResourceManagerRuntimeServices(slotManager, jobLeaderIdService);
}
 
Example #3
Source File: ResourceManagerRuntimeServicesConfiguration.java    From flink with Apache License 2.0 6 votes vote down vote up
public static ResourceManagerRuntimeServicesConfiguration fromConfiguration(Configuration configuration) throws ConfigurationException {

		final String strJobTimeout = configuration.getString(ResourceManagerOptions.JOB_TIMEOUT);
		final Time jobTimeout;

		try {
			jobTimeout = Time.milliseconds(Duration.apply(strJobTimeout).toMillis());
		} catch (NumberFormatException e) {
			throw new ConfigurationException("Could not parse the resource manager's job timeout " +
				"value " + ResourceManagerOptions.JOB_TIMEOUT + '.', e);
		}

		final SlotManagerConfiguration slotManagerConfiguration = SlotManagerConfiguration.fromConfiguration(configuration);

		return new ResourceManagerRuntimeServicesConfiguration(jobTimeout, slotManagerConfiguration);
	}
 
Example #4
Source File: ResourceManagerRuntimeServices.java    From flink with Apache License 2.0 6 votes vote down vote up
public static ResourceManagerRuntimeServices fromConfiguration(
		ResourceManagerRuntimeServicesConfiguration configuration,
		HighAvailabilityServices highAvailabilityServices,
		ScheduledExecutor scheduledExecutor) throws Exception {

	final SlotManagerConfiguration slotManagerConfiguration = configuration.getSlotManagerConfiguration();

	final SlotManager slotManager = new SlotManagerImpl(
		scheduledExecutor,
		slotManagerConfiguration.getTaskManagerRequestTimeout(),
		slotManagerConfiguration.getSlotRequestTimeout(),
		slotManagerConfiguration.getTaskManagerTimeout(),
		slotManagerConfiguration.isWaitResultConsumedBeforeRelease());

	final JobLeaderIdService jobLeaderIdService = new JobLeaderIdService(
		highAvailabilityServices,
		scheduledExecutor,
		configuration.getJobTimeout());

	return new ResourceManagerRuntimeServices(slotManager, jobLeaderIdService);
}
 
Example #5
Source File: ResourceManagerRuntimeServicesConfiguration.java    From flink with Apache License 2.0 6 votes vote down vote up
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);

	return new ResourceManagerRuntimeServicesConfiguration(jobTimeout, slotManagerConfiguration);
}
 
Example #6
Source File: ResourceManagerRuntimeServicesConfiguration.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public ResourceManagerRuntimeServicesConfiguration(Time jobTimeout, SlotManagerConfiguration slotManagerConfiguration) {
	this.jobTimeout = Preconditions.checkNotNull(jobTimeout);
	this.slotManagerConfiguration = Preconditions.checkNotNull(slotManagerConfiguration);
}
 
Example #7
Source File: ResourceManagerRuntimeServicesConfiguration.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public SlotManagerConfiguration getSlotManagerConfiguration() {
	return slotManagerConfiguration;
}
 
Example #8
Source File: ResourceManagerRuntimeServicesConfiguration.java    From flink with Apache License 2.0 4 votes vote down vote up
public ResourceManagerRuntimeServicesConfiguration(Time jobTimeout, SlotManagerConfiguration slotManagerConfiguration) {
	this.jobTimeout = Preconditions.checkNotNull(jobTimeout);
	this.slotManagerConfiguration = Preconditions.checkNotNull(slotManagerConfiguration);
}
 
Example #9
Source File: ResourceManagerRuntimeServicesConfiguration.java    From flink with Apache License 2.0 4 votes vote down vote up
public SlotManagerConfiguration getSlotManagerConfiguration() {
	return slotManagerConfiguration;
}
 
Example #10
Source File: ResourceManagerRuntimeServicesConfiguration.java    From flink with Apache License 2.0 4 votes vote down vote up
public ResourceManagerRuntimeServicesConfiguration(Time jobTimeout, SlotManagerConfiguration slotManagerConfiguration) {
	this.jobTimeout = Preconditions.checkNotNull(jobTimeout);
	this.slotManagerConfiguration = Preconditions.checkNotNull(slotManagerConfiguration);
}
 
Example #11
Source File: ResourceManagerRuntimeServicesConfiguration.java    From flink with Apache License 2.0 4 votes vote down vote up
public SlotManagerConfiguration getSlotManagerConfiguration() {
	return slotManagerConfiguration;
}