org.apache.flink.runtime.webmonitor.testutils.ParameterProgram Java Examples

The following examples show how to use org.apache.flink.runtime.webmonitor.testutils.ParameterProgram. 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: JarRunHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Override
JarRunMessageParameters getJarMessageParameters(ProgramArgsParType programArgsParType) {
	final JarRunMessageParameters parameters = getUnresolvedJarMessageParameters();
	parameters.allowNonRestoredStateQueryParameter.resolve(Collections.singletonList(ALLOW_NON_RESTORED_STATE_QUERY));
	parameters.savepointPathQueryParameter.resolve(Collections.singletonList(RESTORE_PATH));
	parameters.entryClassQueryParameter.resolve(Collections.singletonList(ParameterProgram.class.getCanonicalName()));
	parameters.parallelismQueryParameter.resolve(Collections.singletonList(PARALLELISM));
	if (programArgsParType == ProgramArgsParType.String ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgsQueryParameter.resolve(Collections.singletonList(String.join(" ", PROG_ARGS)));
	}
	if (programArgsParType == ProgramArgsParType.List ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgQueryParameter.resolve(Arrays.asList(PROG_ARGS));
	}
	return parameters;
}
 
Example #2
Source File: JarRunHandlerParameterTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
JarRunMessageParameters getJarMessageParameters(ProgramArgsParType programArgsParType) {
	final JarRunMessageParameters parameters = getUnresolvedJarMessageParameters();
	parameters.allowNonRestoredStateQueryParameter.resolve(Collections.singletonList(ALLOW_NON_RESTORED_STATE_QUERY));
	parameters.savepointPathQueryParameter.resolve(Collections.singletonList(RESTORE_PATH));
	parameters.entryClassQueryParameter.resolve(Collections.singletonList(ParameterProgram.class.getCanonicalName()));
	parameters.parallelismQueryParameter.resolve(Collections.singletonList(PARALLELISM));
	if (programArgsParType == ProgramArgsParType.String ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgsQueryParameter.resolve(Collections.singletonList(String.join(" ", PROG_ARGS)));
	}
	if (programArgsParType == ProgramArgsParType.List ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgQueryParameter.resolve(Arrays.asList(PROG_ARGS));
	}
	return parameters;
}
 
Example #3
Source File: JarRunHandlerParameterTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Override
JarRunMessageParameters getJarMessageParameters(ProgramArgsParType programArgsParType) {
	final JarRunMessageParameters parameters = getUnresolvedJarMessageParameters();
	parameters.allowNonRestoredStateQueryParameter.resolve(Collections.singletonList(ALLOW_NON_RESTORED_STATE_QUERY));
	parameters.savepointPathQueryParameter.resolve(Collections.singletonList(RESTORE_PATH));
	parameters.entryClassQueryParameter.resolve(Collections.singletonList(ParameterProgram.class.getCanonicalName()));
	parameters.parallelismQueryParameter.resolve(Collections.singletonList(PARALLELISM));
	if (programArgsParType == ProgramArgsParType.String ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgsQueryParameter.resolve(Collections.singletonList(String.join(" ", PROG_ARGS)));
	}
	if (programArgsParType == ProgramArgsParType.List ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgQueryParameter.resolve(Arrays.asList(PROG_ARGS));
	}
	return parameters;
}
 
Example #4
Source File: JarPlanHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
JarPlanRequestBody getJarRequestBody(ProgramArgsParType programArgsParType) {
	return new JarPlanRequestBody(
		ParameterProgram.class.getCanonicalName(),
		getProgramArgsString(programArgsParType),
		getProgramArgsList(programArgsParType),
		PARALLELISM,
		null);
}
 
Example #5
Source File: JarHandlerParameterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static ExecutionConfig getExecutionConfig(JobGraph jobGraph) {
	ExecutionConfig executionConfig;
	try {
		executionConfig = jobGraph.getSerializedExecutionConfig().deserializeValue(ParameterProgram.class.getClassLoader());
	} catch (Exception e) {
		throw new AssertionError("Exception while deserializing ExecutionConfig.", e);
	}
	return executionConfig;
}
 
Example #6
Source File: JarRunHandlerParameterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
JarRunRequestBody getJarRequestBody(ProgramArgsParType programArgsParType) {
	return new JarRunRequestBody(
		ParameterProgram.class.getCanonicalName(),
		getProgramArgsString(programArgsParType),
		getProgramArgsList(programArgsParType),
		PARALLELISM,
		null,
		ALLOW_NON_RESTORED_STATE_QUERY,
		RESTORE_PATH
	);
}
 
Example #7
Source File: JarPlanHandlerParameterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
JarPlanRequestBody getJarRequestBody(ProgramArgsParType programArgsParType) {
	return new JarPlanRequestBody(
		ParameterProgram.class.getCanonicalName(),
		getProgramArgsString(programArgsParType),
		getProgramArgsList(programArgsParType),
		PARALLELISM,
		null);
}
 
Example #8
Source File: JarPlanHandlerParameterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
JarPlanMessageParameters getJarMessageParameters(ProgramArgsParType programArgsParType) {
	final JarPlanMessageParameters parameters = getUnresolvedJarMessageParameters();
	parameters.entryClassQueryParameter.resolve(Collections.singletonList(ParameterProgram.class.getCanonicalName()));
	parameters.parallelismQueryParameter.resolve(Collections.singletonList(PARALLELISM));
	if (programArgsParType == ProgramArgsParType.String ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgsQueryParameter.resolve(Collections.singletonList(String.join(" ", PROG_ARGS)));
	}
	if (programArgsParType == ProgramArgsParType.List ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgQueryParameter.resolve(Arrays.asList(PROG_ARGS));
	}
	return parameters;
}
 
Example #9
Source File: JarHandlerParameterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
private static ExecutionConfig getExecutionConfig(JobGraph jobGraph) {
	ExecutionConfig executionConfig;
	try {
		executionConfig = jobGraph.getSerializedExecutionConfig().deserializeValue(ParameterProgram.class.getClassLoader());
	} catch (Exception e) {
		throw new AssertionError("Exception while deserializing ExecutionConfig.", e);
	}
	return executionConfig;
}
 
Example #10
Source File: JarRunHandlerParameterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
JarRunRequestBody getJarRequestBody(ProgramArgsParType programArgsParType) {
	return new JarRunRequestBody(
		ParameterProgram.class.getCanonicalName(),
		getProgramArgsString(programArgsParType),
		getProgramArgsList(programArgsParType),
		PARALLELISM,
		null,
		ALLOW_NON_RESTORED_STATE_QUERY,
		RESTORE_PATH
	);
}
 
Example #11
Source File: JarPlanHandlerParameterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
JarPlanRequestBody getJarRequestBody(ProgramArgsParType programArgsParType) {
	return new JarPlanRequestBody(
		ParameterProgram.class.getCanonicalName(),
		getProgramArgsString(programArgsParType),
		getProgramArgsList(programArgsParType),
		PARALLELISM,
		null);
}
 
Example #12
Source File: JarPlanHandlerParameterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
JarPlanMessageParameters getJarMessageParameters(ProgramArgsParType programArgsParType) {
	final JarPlanMessageParameters parameters = getUnresolvedJarMessageParameters();
	parameters.entryClassQueryParameter.resolve(Collections.singletonList(ParameterProgram.class.getCanonicalName()));
	parameters.parallelismQueryParameter.resolve(Collections.singletonList(PARALLELISM));
	if (programArgsParType == ProgramArgsParType.String ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgsQueryParameter.resolve(Collections.singletonList(String.join(" ", PROG_ARGS)));
	}
	if (programArgsParType == ProgramArgsParType.List ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgQueryParameter.resolve(Arrays.asList(PROG_ARGS));
	}
	return parameters;
}
 
Example #13
Source File: JarHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private static ExecutionConfig getExecutionConfig(JobGraph jobGraph) {
	ExecutionConfig executionConfig;
	try {
		executionConfig = jobGraph.getSerializedExecutionConfig().deserializeValue(ParameterProgram.class.getClassLoader());
	} catch (Exception e) {
		throw new AssertionError("Exception while deserializing ExecutionConfig.", e);
	}
	return executionConfig;
}
 
Example #14
Source File: JarRunHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
JarRunRequestBody getJarRequestBody(ProgramArgsParType programArgsParType) {
	return new JarRunRequestBody(
		ParameterProgram.class.getCanonicalName(),
		getProgramArgsString(programArgsParType),
		getProgramArgsList(programArgsParType),
		PARALLELISM,
		null,
		ALLOW_NON_RESTORED_STATE_QUERY,
		RESTORE_PATH
	);
}
 
Example #15
Source File: JarPlanHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
JarPlanMessageParameters getJarMessageParameters(ProgramArgsParType programArgsParType) {
	final JarPlanMessageParameters parameters = getUnresolvedJarMessageParameters();
	parameters.entryClassQueryParameter.resolve(Collections.singletonList(ParameterProgram.class.getCanonicalName()));
	parameters.parallelismQueryParameter.resolve(Collections.singletonList(PARALLELISM));
	if (programArgsParType == ProgramArgsParType.String ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgsQueryParameter.resolve(Collections.singletonList(String.join(" ", PROG_ARGS)));
	}
	if (programArgsParType == ProgramArgsParType.List ||
		programArgsParType == ProgramArgsParType.Both) {
		parameters.programArgQueryParameter.resolve(Arrays.asList(PROG_ARGS));
	}
	return parameters;
}
 
Example #16
Source File: JarHandlerParameterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Before
public void reset() {
	ParameterProgram.actualArguments = null;
}
 
Example #17
Source File: JarHandlerParameterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
JobGraph validateDefaultGraph() {
	JobGraph jobGraph = LAST_SUBMITTED_JOB_GRAPH_REFERENCE.getAndSet(null);
	Assert.assertEquals(0, ParameterProgram.actualArguments.length);
	Assert.assertEquals(ExecutionConfig.PARALLELISM_DEFAULT, getExecutionConfig(jobGraph).getParallelism());
	return jobGraph;
}
 
Example #18
Source File: JarHandlerParameterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
JobGraph validateGraph() {
	JobGraph jobGraph = LAST_SUBMITTED_JOB_GRAPH_REFERENCE.getAndSet(null);
	Assert.assertArrayEquals(PROG_ARGS, ParameterProgram.actualArguments);
	Assert.assertEquals(PARALLELISM, getExecutionConfig(jobGraph).getParallelism());
	return jobGraph;
}
 
Example #19
Source File: JarHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
JobGraph validateGraph() {
	JobGraph jobGraph = LAST_SUBMITTED_JOB_GRAPH_REFERENCE.getAndSet(null);
	Assert.assertArrayEquals(PROG_ARGS, ParameterProgram.actualArguments);
	Assert.assertEquals(PARALLELISM, getExecutionConfig(jobGraph).getParallelism());
	return jobGraph;
}
 
Example #20
Source File: JarHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
JobGraph validateDefaultGraph() {
	JobGraph jobGraph = LAST_SUBMITTED_JOB_GRAPH_REFERENCE.getAndSet(null);
	Assert.assertEquals(0, ParameterProgram.actualArguments.length);
	Assert.assertEquals(ExecutionConfig.PARALLELISM_DEFAULT, getExecutionConfig(jobGraph).getParallelism());
	return jobGraph;
}
 
Example #21
Source File: JarHandlerParameterTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Before
public void reset() {
	ParameterProgram.actualArguments = null;
}
 
Example #22
Source File: JarHandlerParameterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Before
public void reset() {
	ParameterProgram.actualArguments = null;
}
 
Example #23
Source File: JarHandlerParameterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
JobGraph validateDefaultGraph() {
	JobGraph jobGraph = LAST_SUBMITTED_JOB_GRAPH_REFERENCE.getAndSet(null);
	Assert.assertEquals(0, ParameterProgram.actualArguments.length);
	Assert.assertEquals(CoreOptions.DEFAULT_PARALLELISM.defaultValue().intValue(), getExecutionConfig(jobGraph).getParallelism());
	return jobGraph;
}
 
Example #24
Source File: JarHandlerParameterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
JobGraph validateGraph() {
	JobGraph jobGraph = LAST_SUBMITTED_JOB_GRAPH_REFERENCE.getAndSet(null);
	Assert.assertArrayEquals(PROG_ARGS, ParameterProgram.actualArguments);
	Assert.assertEquals(PARALLELISM, getExecutionConfig(jobGraph).getParallelism());
	return jobGraph;
}