org.apache.flink.runtime.rest.messages.ConversionException Java Examples

The following examples show how to use org.apache.flink.runtime.rest.messages.ConversionException. 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: JarIdPathParameter.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertFromString(final String value) throws ConversionException {
	final Path path = Paths.get(value);
	if (path.getParent() != null) {
		throw new ConversionException(String.format("%s must be a filename only (%s)", KEY, path));
	}
	return value;
}
 
Example #2
Source File: JobsFilterQueryParameter.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public JobID convertStringToValue(String value) throws ConversionException {
	try {
		return JobID.fromHexString(value);
	} catch (IllegalArgumentException iae) {
		throw new ConversionException("Not a valid job ID: " + value, iae);
	}
}
 
Example #3
Source File: MetricsAggregationParameter.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public AggregationMode convertStringToValue(String value) throws ConversionException {
	try {
		return AggregationMode.valueOf(value.toUpperCase(Locale.ROOT));
	} catch (IllegalArgumentException iae) {
		throw new ConversionException("Not a valid aggregation: " + value, iae);
	}
}
 
Example #4
Source File: SubtaskAttemptPathParameter.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected Integer convertFromString(String value) throws ConversionException {
	try {
		return Integer.parseInt(value);
	} catch (NumberFormatException e) {
		throw new ConversionException("Invalid attempt num " + value);
	}
}
 
Example #5
Source File: CheckpointIdPathParameter.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
protected Long convertFromString(String value) throws ConversionException {
	try {
		return Long.parseLong(value);
	} catch (NumberFormatException nfe) {
		throw new ConversionException("Could not parse long from " + value + '.', nfe);
	}
}
 
Example #6
Source File: CheckpointIdPathParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected Long convertFromString(String value) throws ConversionException {
	try {
		return Long.parseLong(value);
	} catch (NumberFormatException nfe) {
		throw new ConversionException("Could not parse long from " + value + '.', nfe);
	}
}
 
Example #7
Source File: JarIdPathParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertFromString(final String value) throws ConversionException {
	final Path path = Paths.get(value);
	if (path.getParent() != null) {
		throw new ConversionException(String.format("%s must be a filename only (%s)", KEY, path));
	}
	return value;
}
 
Example #8
Source File: SubtaskAttemptPathParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected Integer convertFromString(String value) throws ConversionException {
	try {
		return Integer.parseInt(value);
	} catch (NumberFormatException e) {
		throw new ConversionException("Invalid attempt num " + value);
	}
}
 
Example #9
Source File: JobsFilterQueryParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public JobID convertStringToValue(String value) throws ConversionException {
	try {
		return JobID.fromHexString(value);
	} catch (IllegalArgumentException iae) {
		throw new ConversionException("Not a valid job ID: " + value, iae);
	}
}
 
Example #10
Source File: MetricsAggregationParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public AggregationMode convertStringToValue(String value) throws ConversionException {
	try {
		return AggregationMode.valueOf(value.toUpperCase(Locale.ROOT));
	} catch (IllegalArgumentException iae) {
		throw new ConversionException("Not a valid aggregation: " + value, iae);
	}
}
 
Example #11
Source File: SubtaskAttemptPathParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected Integer convertFromString(String value) throws ConversionException {
	try {
		return Integer.parseInt(value);
	} catch (NumberFormatException e) {
		throw new ConversionException("Invalid attempt num " + value);
	}
}
 
Example #12
Source File: CheckpointIdPathParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected Long convertFromString(String value) throws ConversionException {
	try {
		return Long.parseLong(value);
	} catch (NumberFormatException nfe) {
		throw new ConversionException("Could not parse long from " + value + '.', nfe);
	}
}
 
Example #13
Source File: MetricsAggregationParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public AggregationMode convertStringToValue(String value) throws ConversionException {
	try {
		return AggregationMode.valueOf(value.toUpperCase(Locale.ROOT));
	} catch (IllegalArgumentException iae) {
		throw new ConversionException("Not a valid aggregation: " + value, iae);
	}
}
 
Example #14
Source File: JarIdPathParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
protected String convertFromString(final String value) throws ConversionException {
	final Path path = Paths.get(value);
	if (path.getParent() != null) {
		throw new ConversionException(String.format("%s must be a filename only (%s)", KEY, path));
	}
	return value;
}
 
Example #15
Source File: JobsFilterQueryParameter.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public JobID convertStringToValue(String value) throws ConversionException {
	try {
		return JobID.fromHexString(value);
	} catch (IllegalArgumentException iae) {
		throw new ConversionException("Not a valid job ID: " + value, iae);
	}
}
 
Example #16
Source File: RestServerEndpointITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected JobID convertFromString(String value) throws ConversionException {
	return JobID.fromHexString(value);
}
 
Example #17
Source File: JarIdPathParameterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test(expected = ConversionException.class)
public void testJarIdWithParentDir() throws Exception {
	jarIdPathParameter.convertFromString("../../test.jar");
}
 
Example #18
Source File: RestServerEndpointITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
protected JobID convertFromString(String value) throws ConversionException {
	return JobID.fromHexString(value);
}
 
Example #19
Source File: JarIdPathParameterTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test(expected = ConversionException.class)
public void testJarIdWithParentDir() throws Exception {
	jarIdPathParameter.convertFromString("../../test.jar");
}
 
Example #20
Source File: RestServerEndpointITCase.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Override
protected JobID convertFromString(String value) throws ConversionException {
	return JobID.fromHexString(value);
}
 
Example #21
Source File: JarIdPathParameterTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Test(expected = ConversionException.class)
public void testJarIdWithParentDir() throws Exception {
	jarIdPathParameter.convertFromString("../../test.jar");
}