org.apache.flink.mesos.scheduler.TaskSchedulerBuilder Java Examples

The following examples show how to use org.apache.flink.mesos.scheduler.TaskSchedulerBuilder. 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: MesosResourceManager.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the Fenzo optimizer (builder).
 * The builder is an indirection to facilitate unit testing of the Launch Coordinator.
 */
private static TaskSchedulerBuilder createOptimizer() {
	return new TaskSchedulerBuilder() {
		TaskScheduler.Builder builder = new TaskScheduler.Builder();

		@Override
		public TaskSchedulerBuilder withLeaseRejectAction(Action1<VirtualMachineLease> action) {
			builder.withLeaseRejectAction(action);
			return this;
		}

		@Override
		public TaskScheduler build() {
			return builder.build();
		}
	};
}
 
Example #2
Source File: MesosResourceManager.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the Fenzo optimizer (builder).
 * The builder is an indirection to facilitate unit testing of the Launch Coordinator.
 */
private static TaskSchedulerBuilder createOptimizer() {
	return new TaskSchedulerBuilder() {
		TaskScheduler.Builder builder = new TaskScheduler.Builder();

		@Override
		public TaskSchedulerBuilder withLeaseRejectAction(Action1<VirtualMachineLease> action) {
			builder.withLeaseRejectAction(action);
			return this;
		}

		@Override
		public TaskScheduler build() {
			return builder.build();
		}
	};
}
 
Example #3
Source File: MesosResourceManager.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the Fenzo optimizer (builder).
 * The builder is an indirection to facilitate unit testing of the Launch Coordinator.
 */
private static TaskSchedulerBuilder createOptimizer() {
	return new TaskSchedulerBuilder() {
		TaskScheduler.Builder builder = new TaskScheduler.Builder();

		@Override
		public TaskSchedulerBuilder withLeaseRejectAction(Action1<VirtualMachineLease> action) {
			builder.withLeaseRejectAction(action);
			return this;
		}

		@Override
		public TaskSchedulerBuilder withRejectAllExpiredOffers() {
			builder.withRejectAllExpiredOffers();
			return this;
		}

		@Override
		public TaskSchedulerBuilder withLeaseOfferExpirySecs(long leaseOfferExpirySecs) {
			builder.withLeaseOfferExpirySecs(leaseOfferExpirySecs);
			return this;
		}

		@Override
		public TaskScheduler build() {
			return builder.build();
		}
	};
}