org.apache.flink.graph.drivers.parameter.Simplify.Ordering Java Examples

The following examples show how to use org.apache.flink.graph.drivers.parameter.Simplify.Ordering. 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: Simplify.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public void configure(ParameterTool parameterTool) {
	String ordering = parameterTool.get("simplify");

	if (ordering == null) {
		value = Ordering.NONE;
	} else {
		switch (ordering.toLowerCase()) {
			case "directed":
				value = Ordering.DIRECTED;
				break;
			case "undirected":
				value = parameterTool.has("clip_and_flip") ? Ordering.UNDIRECTED_CLIP_AND_FLIP : Ordering.UNDIRECTED;
				break;
			default:
				throw new ProgramParametrizationException(
					"Expected 'directed' or 'undirected' ordering but received '" + ordering + "'");
		}
	}
}
 
Example #2
Source File: Simplify.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void configure(ParameterTool parameterTool) {
	String ordering = parameterTool.get("simplify");

	if (ordering == null) {
		value = Ordering.NONE;
	} else {
		switch (ordering.toLowerCase()) {
			case "directed":
				value = Ordering.DIRECTED;
				break;
			case "undirected":
				value = parameterTool.has("clip_and_flip") ? Ordering.UNDIRECTED_CLIP_AND_FLIP : Ordering.UNDIRECTED;
				break;
			default:
				throw new ProgramParametrizationException(
					"Expected 'directed' or 'undirected' ordering but received '" + ordering + "'");
		}
	}
}
 
Example #3
Source File: Simplify.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public void configure(ParameterTool parameterTool) {
	String ordering = parameterTool.get("simplify");

	if (ordering == null) {
		value = Ordering.NONE;
	} else {
		switch (ordering.toLowerCase()) {
			case "directed":
				value = Ordering.DIRECTED;
				break;
			case "undirected":
				value = parameterTool.has("clip_and_flip") ? Ordering.UNDIRECTED_CLIP_AND_FLIP : Ordering.UNDIRECTED;
				break;
			default:
				throw new ProgramParametrizationException(
					"Expected 'directed' or 'undirected' ordering but received '" + ordering + "'");
		}
	}
}
 
Example #4
Source File: Simplify.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
public Ordering getValue() {
	return value;
}
 
Example #5
Source File: SimplifyTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithDirected() {
	parameter.configure(ParameterTool.fromArgs(new String[]{"--simplify", "directed"}));
	Assert.assertEquals(Ordering.DIRECTED, parameter.getValue());
}
 
Example #6
Source File: SimplifyTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithUndirected() {
	parameter.configure(ParameterTool.fromArgs(new String[]{"--simplify", "undirected"}));
	Assert.assertEquals(Ordering.UNDIRECTED, parameter.getValue());
}
 
Example #7
Source File: SimplifyTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithNoParameter() {
	parameter.configure(ParameterTool.fromArgs(new String[]{}));
	Assert.assertEquals(Ordering.NONE, parameter.getValue());
}
 
Example #8
Source File: Simplify.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Ordering getValue() {
	return value;
}
 
Example #9
Source File: SimplifyTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithDirected() {
	parameter.configure(ParameterTool.fromArgs(new String[]{"--simplify", "directed"}));
	Assert.assertEquals(Ordering.DIRECTED, parameter.getValue());
}
 
Example #10
Source File: SimplifyTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithUndirected() {
	parameter.configure(ParameterTool.fromArgs(new String[]{"--simplify", "undirected"}));
	Assert.assertEquals(Ordering.UNDIRECTED, parameter.getValue());
}
 
Example #11
Source File: SimplifyTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithNoParameter() {
	parameter.configure(ParameterTool.fromArgs(new String[]{}));
	Assert.assertEquals(Ordering.NONE, parameter.getValue());
}
 
Example #12
Source File: Simplify.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Ordering getValue() {
	return value;
}
 
Example #13
Source File: SimplifyTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithDirected() {
	parameter.configure(ParameterTool.fromArgs(new String[]{"--simplify", "directed"}));
	Assert.assertEquals(Ordering.DIRECTED, parameter.getValue());
}
 
Example #14
Source File: SimplifyTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithUndirected() {
	parameter.configure(ParameterTool.fromArgs(new String[]{"--simplify", "undirected"}));
	Assert.assertEquals(Ordering.UNDIRECTED, parameter.getValue());
}
 
Example #15
Source File: SimplifyTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithNoParameter() {
	parameter.configure(ParameterTool.fromArgs(new String[]{}));
	Assert.assertEquals(Ordering.NONE, parameter.getValue());
}