HADOOP-15551. Avoid use of Arrays.stream in Configuration.addTags

This commit is contained in:
Todd Lipcon 2018-06-20 12:38:59 -07:00
parent 32f867a6a9
commit 43541a1890
1 changed files with 4 additions and 4 deletions

View File

@ -3189,25 +3189,25 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
if (prop.containsKey(CommonConfigurationKeys.HADOOP_TAGS_SYSTEM)) { if (prop.containsKey(CommonConfigurationKeys.HADOOP_TAGS_SYSTEM)) {
String systemTags = prop.getProperty(CommonConfigurationKeys String systemTags = prop.getProperty(CommonConfigurationKeys
.HADOOP_TAGS_SYSTEM); .HADOOP_TAGS_SYSTEM);
Arrays.stream(systemTags.split(",")).forEach(tag -> TAGS.add(tag)); TAGS.addAll(Arrays.asList(systemTags.split(",")));
} }
// Get all custom tags // Get all custom tags
if (prop.containsKey(CommonConfigurationKeys.HADOOP_TAGS_CUSTOM)) { if (prop.containsKey(CommonConfigurationKeys.HADOOP_TAGS_CUSTOM)) {
String customTags = prop.getProperty(CommonConfigurationKeys String customTags = prop.getProperty(CommonConfigurationKeys
.HADOOP_TAGS_CUSTOM); .HADOOP_TAGS_CUSTOM);
Arrays.stream(customTags.split(",")).forEach(tag -> TAGS.add(tag)); TAGS.addAll(Arrays.asList(customTags.split(",")));
} }
if (prop.containsKey(CommonConfigurationKeys.HADOOP_SYSTEM_TAGS)) { if (prop.containsKey(CommonConfigurationKeys.HADOOP_SYSTEM_TAGS)) {
String systemTags = prop.getProperty(CommonConfigurationKeys String systemTags = prop.getProperty(CommonConfigurationKeys
.HADOOP_SYSTEM_TAGS); .HADOOP_SYSTEM_TAGS);
Arrays.stream(systemTags.split(",")).forEach(tag -> TAGS.add(tag)); TAGS.addAll(Arrays.asList(systemTags.split(",")));
} }
// Get all custom tags // Get all custom tags
if (prop.containsKey(CommonConfigurationKeys.HADOOP_CUSTOM_TAGS)) { if (prop.containsKey(CommonConfigurationKeys.HADOOP_CUSTOM_TAGS)) {
String customTags = prop.getProperty(CommonConfigurationKeys String customTags = prop.getProperty(CommonConfigurationKeys
.HADOOP_CUSTOM_TAGS); .HADOOP_CUSTOM_TAGS);
Arrays.stream(customTags.split(",")).forEach(tag -> TAGS.add(tag)); TAGS.addAll(Arrays.asList(customTags.split(",")));
} }
} catch (Exception ex) { } catch (Exception ex) {