com.netflix.fenzo.plugins.HostAttrValueConstraint Java Examples

The following examples show how to use com.netflix.fenzo.plugins.HostAttrValueConstraint. 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: MesosTaskManagerParameters.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static void addHostAttrValueConstraint(List<ConstraintEvaluator> constraints, String constraintKey, final String constraintValue) {
	constraints.add(new HostAttrValueConstraint(constraintKey, new Func1<String, String>() {
		@Override
		public String call(String s) {
			return constraintValue;
		}
	}));
}
 
Example #2
Source File: MesosTaskManagerParametersTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void givenOneConstraintInConfigShouldBeParsed() throws Exception {

	MesosTaskManagerParameters mesosTaskManagerParameters = MesosTaskManagerParameters.create(withHardHostAttrConstraintConfiguration("cluster:foo"));
	assertThat(mesosTaskManagerParameters.constraints().size(), is(1));
	ConstraintEvaluator firstConstraintEvaluator = new HostAttrValueConstraint("cluster", new Func1<String, String>() {
		@Override
		public String call(String s) {
			return "foo";
		}
	});
	assertThat(mesosTaskManagerParameters.constraints().get(0).getName(), is(firstConstraintEvaluator.getName()));
}
 
Example #3
Source File: MesosTaskManagerParameters.java    From flink with Apache License 2.0 5 votes vote down vote up
private static void addHostAttrValueConstraint(List<ConstraintEvaluator> constraints, String constraintKey, final String constraintValue) {
	constraints.add(new HostAttrValueConstraint(constraintKey, new Func1<String, String>() {
		@Override
		public String call(String s) {
			return constraintValue;
		}
	}));
}
 
Example #4
Source File: MesosTaskManagerParametersTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void givenOneConstraintInConfigShouldBeParsed() throws Exception {

	MesosTaskManagerParameters mesosTaskManagerParameters = MesosTaskManagerParameters.create(withHardHostAttrConstraintConfiguration("cluster:foo"));
	assertThat(mesosTaskManagerParameters.constraints().size(), is(1));
	ConstraintEvaluator firstConstraintEvaluator = new HostAttrValueConstraint("cluster", new Func1<String, String>() {
		@Override
		public String call(String s) {
			return "foo";
		}
	});
	assertThat(mesosTaskManagerParameters.constraints().get(0).getName(), is(firstConstraintEvaluator.getName()));
}
 
Example #5
Source File: MesosTaskManagerParameters.java    From flink with Apache License 2.0 5 votes vote down vote up
private static void addHostAttrValueConstraint(List<ConstraintEvaluator> constraints, String constraintKey, final String constraintValue) {
	constraints.add(new HostAttrValueConstraint(constraintKey, new Func1<String, String>() {
		@Override
		public String call(String s) {
			return constraintValue;
		}
	}));
}
 
Example #6
Source File: MesosTaskManagerParametersTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void givenOneConstraintInConfigShouldBeParsed() throws Exception {

	MesosTaskManagerParameters mesosTaskManagerParameters = MesosTaskManagerParameters.create(withHardHostAttrConstraintConfiguration("cluster:foo"));
	assertThat(mesosTaskManagerParameters.constraints().size(), is(1));
	ConstraintEvaluator firstConstraintEvaluator = new HostAttrValueConstraint("cluster", new Func1<String, String>() {
		@Override
		public String call(String s) {
			return "foo";
		}
	});
	assertThat(mesosTaskManagerParameters.constraints().get(0).getName(), is(firstConstraintEvaluator.getName()));
}