HADOOP-15551. Avoid use of Arrays.stream in Configuration.addTags
This commit is contained in:
parent
32f867a6a9
commit
43541a1890
@ -3189,25 +3189,25 @@ public void addTags(Properties prop) {
|
|||||||
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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user