Java Code Examples for org.apache.hadoop.yarn.api.records.LocalResourceVisibility#valueOf()

The following examples show how to use org.apache.hadoop.yarn.api.records.LocalResourceVisibility#valueOf() . 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: YarnLocalResourceDescriptor.java    From flink with Apache License 2.0 5 votes vote down vote up
static YarnLocalResourceDescriptor fromString(String desc) throws Exception {
	Matcher m = LOCAL_RESOURCE_DESC_FORMAT.matcher(desc);
	boolean mat = m.find();
	if (mat) {
		return new YarnLocalResourceDescriptor(
			m.group(1),
			new Path(m.group(2)),
			Long.parseLong(m.group(3)),
			Long.parseLong(m.group(4)),
			LocalResourceVisibility.valueOf(m.group(5)));
	} else {
		throw new FlinkException("Error to parse YarnLocalResourceDescriptor from " + desc);
	}
}
 
Example 2
Source File: ProtoUtils.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public static LocalResourceVisibility convertFromProtoFormat(LocalResourceVisibilityProto e) {
  return LocalResourceVisibility.valueOf(e.name());
}
 
Example 3
Source File: ProtoUtils.java    From big-c with Apache License 2.0 4 votes vote down vote up
public static LocalResourceVisibility convertFromProtoFormat(LocalResourceVisibilityProto e) {
  return LocalResourceVisibility.valueOf(e.name());
}
 
Example 4
Source File: LocalizerResourceConfig.java    From samza with Apache License 2.0 4 votes vote down vote up
public LocalResourceVisibility getResourceLocalVisibility(final String resourceName) {
  String visibilityStr = config.get(String.format(RESOURCE_LOCAL_VISIBILITY, resourceName), DEFAULT_RESOURCE_LOCAL_VISIBILITY);
  return LocalResourceVisibility.valueOf(StringUtils.upperCase(visibilityStr));
}