org.apache.flink.runtime.jobgraph.jsonplan.JsonPlanGenerator Java Examples

The following examples show how to use org.apache.flink.runtime.jobgraph.jsonplan.JsonPlanGenerator. 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: JsonJobGraphGenerationTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
public JobExecutionResult execute(String jobName) throws Exception {
	Plan plan = createProgramPlan(jobName);

	Optimizer pc = new Optimizer(new Configuration());
	OptimizedPlan op = pc.compile(plan);

	JobGraphGenerator jgg = new JobGraphGenerator();
	JobGraph jobGraph = jgg.compileJobGraph(op);

	String jsonPlan = JsonPlanGenerator.generatePlan(jobGraph);

	// first check that the JSON is valid
	JsonParser parser = new JsonFactory().createJsonParser(jsonPlan);
	while (parser.nextToken() != null) {}

	validator.validateJson(jsonPlan);

	throw new AbortError();
}
 
Example #2
Source File: JarPlanHandler.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
public JarPlanHandler(
		final GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		final Time timeout,
		final Map<String, String> responseHeaders,
		final MessageHeaders<JarPlanRequestBody, JobPlanInfo, JarPlanMessageParameters> messageHeaders,
		final Path jarDir,
		final Configuration configuration,
		final Executor executor) {
	this(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		jarDir,
		configuration,
		executor,
		jobGraph -> new JobPlanInfo(JsonPlanGenerator.generatePlan(jobGraph)));
}
 
Example #3
Source File: JarPlanHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public static void setup() throws Exception {
	init();
	handler = new JarPlanHandler(
		gatewayRetriever,
		timeout,
		responseHeaders,
		JarPlanHeaders.getInstance(),
		jarDir,
		new Configuration(),
		executor,
		jobGraph -> {
			LAST_SUBMITTED_JOB_GRAPH_REFERENCE.set(jobGraph);
			return new JobPlanInfo(JsonPlanGenerator.generatePlan(jobGraph));
		});
}
 
Example #4
Source File: JsonJobGraphGenerationTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public JobExecutionResult execute(String jobName) throws Exception {
	Plan plan = createProgramPlan(jobName);

	Optimizer pc = new Optimizer(new Configuration());
	OptimizedPlan op = pc.compile(plan);

	JobGraphGenerator jgg = new JobGraphGenerator();
	JobGraph jobGraph = jgg.compileJobGraph(op);

	String jsonPlan = JsonPlanGenerator.generatePlan(jobGraph);

	// first check that the JSON is valid
	JsonParser parser = new JsonFactory().createJsonParser(jsonPlan);
	while (parser.nextToken() != null) {}

	validator.validateJson(jsonPlan);

	throw new AbortError();
}
 
Example #5
Source File: JarPlanHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JarPlanHandler(
		final GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		final Time timeout,
		final Map<String, String> responseHeaders,
		final MessageHeaders<JarPlanRequestBody, JobPlanInfo, JarPlanMessageParameters> messageHeaders,
		final Path jarDir,
		final Configuration configuration,
		final Executor executor) {
	this(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		jarDir,
		configuration,
		executor,
		jobGraph -> new JobPlanInfo(JsonPlanGenerator.generatePlan(jobGraph)));
}
 
Example #6
Source File: JarPlanHandlerParameterTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public static void setup() throws Exception {
	init();
	handler = new JarPlanHandler(
		gatewayRetriever,
		timeout,
		responseHeaders,
		JarPlanGetHeaders.getInstance(),
		jarDir,
		new Configuration(),
		executor,
		jobGraph -> {
			LAST_SUBMITTED_JOB_GRAPH_REFERENCE.set(jobGraph);
			return new JobPlanInfo(JsonPlanGenerator.generatePlan(jobGraph));
		});
}
 
Example #7
Source File: JsonJobGraphGenerationTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
public JobExecutionResult execute(String jobName) throws Exception {
	Plan plan = createProgramPlan(jobName);

	Optimizer pc = new Optimizer(new Configuration());
	OptimizedPlan op = pc.compile(plan);

	JobGraphGenerator jgg = new JobGraphGenerator();
	JobGraph jobGraph = jgg.compileJobGraph(op);

	String jsonPlan = JsonPlanGenerator.generatePlan(jobGraph);

	// first check that the JSON is valid
	JsonParser parser = new JsonFactory().createJsonParser(jsonPlan);
	while (parser.nextToken() != null) {}

	validator.validateJson(jsonPlan);

	throw new AbortError();
}
 
Example #8
Source File: JarPlanHandler.java    From flink with Apache License 2.0 6 votes vote down vote up
public JarPlanHandler(
		final GatewayRetriever<? extends RestfulGateway> leaderRetriever,
		final Time timeout,
		final Map<String, String> responseHeaders,
		final MessageHeaders<JarPlanRequestBody, JobPlanInfo, JarPlanMessageParameters> messageHeaders,
		final Path jarDir,
		final Configuration configuration,
		final Executor executor) {
	this(
		leaderRetriever,
		timeout,
		responseHeaders,
		messageHeaders,
		jarDir,
		configuration,
		executor,
		jobGraph -> new JobPlanInfo(JsonPlanGenerator.generatePlan(jobGraph)));
}
 
Example #9
Source File: JarPlanHandlerParameterTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@BeforeClass
public static void setup() throws Exception {
	init();
	handler = new JarPlanHandler(
		gatewayRetriever,
		timeout,
		responseHeaders,
		JarPlanGetHeaders.getInstance(),
		jarDir,
		new Configuration(),
		executor,
		jobGraph -> {
			LAST_SUBMITTED_JOB_GRAPH_REFERENCE.set(jobGraph);
			return new JobPlanInfo(JsonPlanGenerator.generatePlan(jobGraph));
		});
}
 
Example #10
Source File: JobPlanInfoTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected JobPlanInfo getTestResponseInstance() {
	JobGraph jg = new JobGraph("job_007");
	return new JobPlanInfo(JsonPlanGenerator.generatePlan(jg));
}
 
Example #11
Source File: JobPlanInfoTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected JobPlanInfo getTestResponseInstance() {
	JobGraph jg = new JobGraph("job_007");
	return new JobPlanInfo(JsonPlanGenerator.generatePlan(jg));
}
 
Example #12
Source File: JobPlanInfoTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected JobPlanInfo getTestResponseInstance() {
	JobGraph jg = new JobGraph("job_007");
	return new JobPlanInfo(JsonPlanGenerator.generatePlan(jg));
}