http://git-wip-us.apache.org/repos/asf/ambari/blob/edbb5492/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java index fa2082b..54d4fcc 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java @@ -80,7 +80,7 @@ import com.google.common.collect.Maps; public class BlueprintConfigurationProcessorTest { private static final Configuration EMPTY_CONFIG = new Configuration(Collections.<String, Map<String, String>>emptyMap(), Collections.<String, Map<String, Map<String, String>>>emptyMap()); - private final Map<String, Collection<String>> serviceComponents = new HashMap<String, Collection<String>>(); + private final Map<String, Collection<String>> serviceComponents = new HashMap<>(); @Rule public EasyMockRule mocks = new EasyMockRule(this); @@ -112,73 +112,73 @@ public class BlueprintConfigurationProcessorTest { Collections.<String, org.apache.ambari.server.state.PropertyInfo>emptyMap()).anyTimes(); expect(serviceInfo.getRequiredServices()).andReturn(Collections.<String>emptyList()).anyTimes(); - Collection<String> hdfsComponents = new HashSet<String>(); + Collection<String> hdfsComponents = new HashSet<>(); hdfsComponents.add("NAMENODE"); hdfsComponents.add("SECONDARY_NAMENODE"); hdfsComponents.add("DATANODE"); hdfsComponents.add("HDFS_CLIENT"); serviceComponents.put("HDFS", hdfsComponents); - Collection<String> yarnComponents = new HashSet<String>(); + Collection<String> yarnComponents = new HashSet<>(); yarnComponents.add("RESOURCEMANAGER"); yarnComponents.add("NODEMANAGER"); yarnComponents.add("YARN_CLIENT"); yarnComponents.add("APP_TIMELINE_SERVER"); serviceComponents.put("YARN", yarnComponents); - Collection<String> mrComponents = new HashSet<String>(); + Collection<String> mrComponents = new HashSet<>(); mrComponents.add("MAPREDUCE2_CLIENT"); mrComponents.add("HISTORY_SERVER"); serviceComponents.put("MAPREDUCE2", mrComponents); - Collection<String> zkComponents = new HashSet<String>(); + Collection<String> zkComponents = new HashSet<>(); zkComponents.add("ZOOKEEPER_SERVER"); zkComponents.add("ZOOKEEPER_CLIENT"); serviceComponents.put("ZOOKEEPER", zkComponents); - Collection<String> hiveComponents = new HashSet<String>(); + Collection<String> hiveComponents = new HashSet<>(); hiveComponents.add("MYSQL_SERVER"); hiveComponents.add("HIVE_METASTORE"); hiveComponents.add("HIVE_SERVER"); serviceComponents.put("HIVE", hiveComponents); - Collection<String> falconComponents = new HashSet<String>(); + Collection<String> falconComponents = new HashSet<>(); falconComponents.add("FALCON_SERVER"); falconComponents.add("FALCON_CLIENT"); serviceComponents.put("FALCON", falconComponents); - Collection<String> gangliaComponents = new HashSet<String>(); + Collection<String> gangliaComponents = new HashSet<>(); gangliaComponents.add("GANGLIA_SERVER"); gangliaComponents.add("GANGLIA_CLIENT"); serviceComponents.put("GANGLIA", gangliaComponents); - Collection<String> kafkaComponents = new HashSet<String>(); + Collection<String> kafkaComponents = new HashSet<>(); kafkaComponents.add("KAFKA_BROKER"); serviceComponents.put("KAFKA", kafkaComponents); - Collection<String> knoxComponents = new HashSet<String>(); + Collection<String> knoxComponents = new HashSet<>(); knoxComponents.add("KNOX_GATEWAY"); serviceComponents.put("KNOX", knoxComponents); - Collection<String> oozieComponents = new HashSet<String>(); + Collection<String> oozieComponents = new HashSet<>(); oozieComponents.add("OOZIE_SERVER"); oozieComponents.add("OOZIE_CLIENT"); serviceComponents.put("OOZIE", oozieComponents); - Collection<String> hbaseComponents = new HashSet<String>(); + Collection<String> hbaseComponents = new HashSet<>(); hbaseComponents.add("HBASE_MASTER"); serviceComponents.put("HBASE", hbaseComponents); - Collection<String> atlasComponents = new HashSet<String>(); + Collection<String> atlasComponents = new HashSet<>(); atlasComponents.add("ATLAS_SERVER"); atlasComponents.add("ATLAS_CLIENT"); serviceComponents.put("ATLAS", atlasComponents); - Collection<String> amsComponents = new HashSet<String>(); + Collection<String> amsComponents = new HashSet<>(); amsComponents.add("METRICS_COLLECTOR"); serviceComponents.put("AMBARI_METRICS", amsComponents); - Collection<String> stormComponents = new HashSet<String>(); + Collection<String> stormComponents = new HashSet<>(); stormComponents.add("NIMBUS"); serviceComponents.put("STORM", stormComponents); @@ -202,26 +202,26 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_SingleHostProperty() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("yarn.resourcemanager.hostname", "testhost"); properties.put("yarn-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -235,9 +235,9 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_FilterProperties() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); + Map<String, Map<String, String>> properties = new HashMap<>(); - Map<String, String> kerberosEnvProps = new HashMap<String, String>(); + Map<String, String> kerberosEnvProps = new HashMap<>(); kerberosEnvProps.put("admin_server_host", "test"); kerberosEnvProps.put("kdc_hosts", "test"); kerberosEnvProps.put("realm", "test"); @@ -246,11 +246,11 @@ public class BlueprintConfigurationProcessorTest { kerberosEnvProps.put("container_dn", "test"); properties.put("kerberos-env", kerberosEnvProps); - Map<String, String> krb5ConfProps = new HashMap<String, String>(); + Map<String, String> krb5ConfProps = new HashMap<>(); krb5ConfProps.put("domains", "test"); properties.put("krb5-conf", krb5ConfProps); - Map<String, String> tezSiteConfProps = new HashMap<String, String>(); + Map<String, String> tezSiteConfProps = new HashMap<>(); tezSiteConfProps.put("tez.tez-ui.history-url.base", "test"); properties.put("tez-site", tezSiteConfProps); @@ -258,18 +258,18 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -320,13 +320,13 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_SingleHostProperty_specifiedInParentConfig() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> yarnSiteProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> yarnSiteProps = new HashMap<>(); yarnSiteProps.put("yarn.resourcemanager.hostname", "testhost"); properties.put("yarn-site", yarnSiteProps); - Map<String, Map<String, String>> parentProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> parentYarnSiteProps = new HashMap<String, String>(); + Map<String, Map<String, String>> parentProperties = new HashMap<>(); + Map<String, String> parentYarnSiteProps = new HashMap<>(); parentYarnSiteProps.put("yarn.resourcemanager.resource-tracker.address", "testhost"); parentProperties.put("yarn-site", parentYarnSiteProps); @@ -336,18 +336,18 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap(), parentClusterConfig); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -361,26 +361,26 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_SingleHostProperty_hostGroupConfiguration() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("yarn.resourcemanager.hostname", "testhost"); properties.put("yarn-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); - Map<String, Map<String, String>> group2Properties = new HashMap<String, Map<String, String>>(); - Map<String, String> group2YarnSiteProps = new HashMap<String, String>(); + Map<String, Map<String, String>> group2Properties = new HashMap<>(); + Map<String, String> group2YarnSiteProps = new HashMap<>(); group2YarnSiteProps.put("yarn.resourcemanager.resource-tracker.address", "testhost"); group2Properties.put("yarn-site", group2YarnSiteProps); // host group config -> BP config -> cluster scoped config @@ -394,7 +394,7 @@ public class BlueprintConfigurationProcessorTest { TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2"), group2Configuration); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -409,25 +409,25 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_SingleHostProperty__withPort() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("fs.defaultFS", "testhost:8020"); properties.put("core-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -441,26 +441,26 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_SingleHostProperty__ExternalReference() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("yarn.resourcemanager.hostname", "external-host"); properties.put("yarn-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -473,39 +473,39 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_MultiHostProperty() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("hbase.zookeeper.quorum", "testhost,testhost2,testhost2a,testhost2b"); properties.put("hbase-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("ZOOKEEPER_SERVER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_SERVER"); - Set<String> hosts2 = new HashSet<String>(); + Set<String> hosts2 = new HashSet<>(); hosts2.add("testhost2"); hosts2.add("testhost2a"); hosts2.add("testhost2b"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, hosts2); - Collection<String> hgComponents3 = new HashSet<String>(); + Collection<String> hgComponents3 = new HashSet<>(); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_CLIENT"); - Set<String> hosts3 = new HashSet<String>(); + Set<String> hosts3 = new HashSet<>(); hosts3.add("testhost3"); hosts3.add("testhost3a"); TestHostGroup group3 = new TestHostGroup("group3", hgComponents3, hosts3); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); hostGroups.add(group3); @@ -520,39 +520,39 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_MultiHostProperty__WithPorts() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("templeton.zookeeper.hosts", "testhost:5050,testhost2:9090,testhost2a:9090,testhost2b:9090"); properties.put("webhcat-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("ZOOKEEPER_SERVER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_SERVER"); - Set<String> hosts2 = new HashSet<String>(); + Set<String> hosts2 = new HashSet<>(); hosts2.add("testhost2"); hosts2.add("testhost2a"); hosts2.add("testhost2b"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, hosts2); - Collection<String> hgComponents3 = new HashSet<String>(); + Collection<String> hgComponents3 = new HashSet<>(); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_CLIENT"); - Set<String> hosts3 = new HashSet<String>(); + Set<String> hosts3 = new HashSet<>(); hosts3.add("testhost3"); hosts3.add("testhost3a"); TestHostGroup group3 = new TestHostGroup("group3", hgComponents3, hosts3); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); hostGroups.add(group3); @@ -567,8 +567,8 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_MultiHostProperty__YAML() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("storm.zookeeper.servers", "['testhost:5050','testhost2:9090','testhost2a:9090','testhost2b:9090']"); typeProps.put("drpc_server_host", "['testhost:5050']"); typeProps.put("storm_ui_server_host", "['testhost:5050']"); @@ -579,7 +579,7 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("ZOOKEEPER_SERVER"); @@ -588,26 +588,26 @@ public class BlueprintConfigurationProcessorTest { hgComponents.add("SUPERVISOR"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_SERVER"); hgComponents2.add("SUPERVISOR"); - Set<String> hosts2 = new HashSet<String>(); + Set<String> hosts2 = new HashSet<>(); hosts2.add("testhost2"); hosts2.add("testhost2a"); hosts2.add("testhost2b"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, hosts2); - Collection<String> hgComponents3 = new HashSet<String>(); + Collection<String> hgComponents3 = new HashSet<>(); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_CLIENT"); - Set<String> hosts3 = new HashSet<String>(); + Set<String> hosts3 = new HashSet<>(); hosts3.add("testhost3"); hosts3.add("testhost3a"); TestHostGroup group3 = new TestHostGroup("group3", hgComponents3, hosts3); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); hostGroups.add(group3); @@ -631,27 +631,27 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_DBHostProperty() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> hiveSiteProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> hiveSiteProps = new HashMap<>(); hiveSiteProps.put("javax.jdo.option.ConnectionURL", "jdbc:mysql://testhost/hive?createDatabaseIfNotExist=true"); properties.put("hive-site", hiveSiteProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); hgComponents.add("MYSQL_SERVER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -665,26 +665,26 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_DBHostProperty__External() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("javax.jdo.option.ConnectionURL", "jdbc:mysql://external-host/hive?createDatabaseIfNotExist=true"); properties.put("hive-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -697,8 +697,8 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForBlueprintExport_PasswordFilterApplied() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("REPOSITORY_CONFIG_PASSWORD", "test-password-one"); typeProps.put("SSL_KEYSTORE_PASSWORD", "test-password-two"); typeProps.put("SSL_TRUSTSTORE_PASSWORD", "test-password-three"); @@ -707,12 +707,12 @@ public class BlueprintConfigurationProcessorTest { typeProps.put("test.password.should.be.included", "test-another-pwd"); //Checking functionality for fields marked as SECRET - Map<String, String> secretProps = new HashMap<String, String>(); + Map<String, String> secretProps = new HashMap<>(); secretProps.put("knox_master_secret", "test-secret-one"); secretProps.put("test.secret.should.be.included", "test-another-secret"); // create a custom config type, to verify that the filters can // be applied across all config types - Map<String, String> customProps = new HashMap<String, String>(); + Map<String, String> customProps = new HashMap<>(); customProps.put("my_test_PASSWORD", "should be excluded"); customProps.put("PASSWORD_mytest", "should be included"); @@ -725,18 +725,18 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -798,8 +798,8 @@ public class BlueprintConfigurationProcessorTest { final String expectedPortNum = "808080"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> falconStartupProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> falconStartupProperties = new HashMap<>(); configProperties.put("falcon-startup.properties", falconStartupProperties); // setup properties that include host information @@ -813,14 +813,14 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("FALCON_SERVER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -842,8 +842,8 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostName = "c6401.apache.ambari.org"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> tezSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> tezSiteProperties = new HashMap<>(); configProperties.put("tez-site", tezSiteProperties); // set the UI property, to simulate the case of a UI-created cluster with TEZ @@ -855,14 +855,14 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("TEZ_CLIENT"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -885,9 +885,9 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostName = "c6401.apache.ambari.org"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> kerberosEnvProperties = new HashMap<String, String>(); - Map<String, String> coreSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> kerberosEnvProperties = new HashMap<>(); + Map<String, String> coreSiteProperties = new HashMap<>(); configProperties.put("kerberos-env", kerberosEnvProperties); configProperties.put("core-site", coreSiteProperties); @@ -903,15 +903,15 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("TEZ_CLIENT"); groupComponents.add("RESOURCEMANAGER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -936,10 +936,10 @@ public class BlueprintConfigurationProcessorTest { final String expectedNodeTwo = "nn2"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> hdfsSiteProperties = new HashMap<String, String>(); - Map<String, String> coreSiteProperties = new HashMap<String, String>(); - Map<String, String> hbaseSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> hdfsSiteProperties = new HashMap<>(); + Map<String, String> coreSiteProperties = new HashMap<>(); + Map<String, String> hbaseSiteProperties = new HashMap<>(); configProperties.put("hdfs-site", hdfsSiteProperties); configProperties.put("core-site", coreSiteProperties); @@ -964,14 +964,14 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("NAMENODE"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -1037,14 +1037,14 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("NAMENODE"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -1075,10 +1075,10 @@ public class BlueprintConfigurationProcessorTest { final String expectedNameService = "mynameservice"; final String expectedHostName = "c6401.apache.ambari.org"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> coreSiteProperties = new HashMap<String, String>(); - Map<String, String> hbaseSiteProperties = new HashMap<String, String>(); - Map<String, String> accumuloSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> coreSiteProperties = new HashMap<>(); + Map<String, String> hbaseSiteProperties = new HashMap<>(); + Map<String, String> accumuloSiteProperties = new HashMap<>(); configProperties.put("core-site", coreSiteProperties); configProperties.put("hbase-site", hbaseSiteProperties); @@ -1097,14 +1097,14 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("RESOURCEMANAGER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup("group1", groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -1123,8 +1123,8 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoNameNodeHighAvailabilityExportWithHANotEnabled() throws Exception { // hdfs-site config for this test will not include an HA values - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> hdfsSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> hdfsSiteProperties = new HashMap<>(); configProperties.put("hdfs-site", hdfsSiteProperties); assertEquals("Incorrect initial state for hdfs-site config", @@ -1136,11 +1136,11 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("NAMENODE"); TestHostGroup group = new TestHostGroup("group1", groupComponents, Collections.singleton("host1")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -1163,8 +1163,8 @@ public class BlueprintConfigurationProcessorTest { final String expectedNodeTwo = "nn2"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> hdfsSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> hdfsSiteProperties = new HashMap<>(); configProperties.put("hdfs-site", hdfsSiteProperties); // setup hdfs config for test @@ -1195,15 +1195,15 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("RESOURCEMANAGER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostNameOne); hosts.add(expectedHostNameTwo); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -1250,8 +1250,8 @@ public class BlueprintConfigurationProcessorTest { final String expectedPortNum = "808080"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> yarnSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> yarnSiteProperties = new HashMap<>(); configProperties.put("yarn-site", yarnSiteProperties); // setup properties that include host information @@ -1273,14 +1273,14 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("RESOURCEMANAGER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -1317,8 +1317,8 @@ public class BlueprintConfigurationProcessorTest { final String expectedPortNum = "808080"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> yarnSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> yarnSiteProperties = new HashMap<>(); configProperties.put("yarn-site", yarnSiteProperties); // setup properties that include host information @@ -1339,14 +1339,14 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("RESOURCEMANAGER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -1381,11 +1381,11 @@ public class BlueprintConfigurationProcessorTest { final String expectedPortNum = "808080"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> hdfsSiteProperties = new HashMap<String, String>(); - Map<String, String> coreSiteProperties = new HashMap<String, String>(); - Map<String, String> hbaseSiteProperties = new HashMap<String, String>(); - Map<String, String> accumuloSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> hdfsSiteProperties = new HashMap<>(); + Map<String, String> coreSiteProperties = new HashMap<>(); + Map<String, String> hbaseSiteProperties = new HashMap<>(); + Map<String, String> accumuloSiteProperties = new HashMap<>(); configProperties.put("hdfs-site", hdfsSiteProperties); configProperties.put("core-site", coreSiteProperties); @@ -1414,15 +1414,15 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("NAMENODE"); groupComponents.add("SECONDARY_NAMENODE"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -1464,11 +1464,11 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostGroupName = "host_group_1"; final String expectedHostGroupNameTwo = "host_group_2"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> hiveSiteProperties = new HashMap<String, String>(); - Map<String, String> hiveEnvProperties = new HashMap<String, String>(); - Map<String, String> webHCatSiteProperties = new HashMap<String, String>(); - Map<String, String> coreSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> hiveSiteProperties = new HashMap<>(); + Map<String, String> hiveEnvProperties = new HashMap<>(); + Map<String, String> webHCatSiteProperties = new HashMap<>(); + Map<String, String> coreSiteProperties = new HashMap<>(); configProperties.put("hive-site", hiveSiteProperties); configProperties.put("hive-env", hiveEnvProperties); @@ -1494,21 +1494,21 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("HIVE_SERVER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<String> groupComponents2 = new HashSet<String>(); + Collection<String> groupComponents2 = new HashSet<>(); groupComponents2.add("HIVE_CLIENT"); - Collection<String> hosts2 = new ArrayList<String>(); + Collection<String> hosts2 = new ArrayList<>(); hosts2.add(expectedHostNameTwo); hosts2.add("serverFour"); TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, groupComponents2, hosts2); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); hostGroups.add(group2); @@ -1556,16 +1556,16 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostGroupNameTwo = "host_group_2"; Map<String, Map<String, String>> configProperties = - new HashMap<String, Map<String, String>>(); + new HashMap<>(); Map<String, String> hiveSiteProperties = - new HashMap<String, String>(); + new HashMap<>(); Map<String, String> hiveEnvProperties = - new HashMap<String, String>(); + new HashMap<>(); Map<String, String> webHCatSiteProperties = - new HashMap<String, String>(); + new HashMap<>(); Map<String, String> coreSiteProperties = - new HashMap<String, String>(); + new HashMap<>(); configProperties.put("hive-site", hiveSiteProperties); configProperties.put("hive-env", hiveEnvProperties); @@ -1589,21 +1589,21 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(configProperties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("NAMENODE"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<String> groupComponents2 = new HashSet<String>(); + Collection<String> groupComponents2 = new HashSet<>(); groupComponents2.add("DATANODE"); - Collection<String> hosts2 = new ArrayList<String>(); + Collection<String> hosts2 = new ArrayList<>(); hosts2.add(expectedHostNameTwo); hosts2.add("serverThree"); TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, groupComponents2, hosts2); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); hostGroups.add(group2); @@ -1653,11 +1653,11 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostGroupName = "host_group_1"; final String expectedHostGroupNameTwo = "host_group_2"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> oozieSiteProperties = new HashMap<String, String>(); - Map<String, String> oozieEnvProperties = new HashMap<String, String>(); - Map<String, String> hiveEnvProperties = new HashMap<String, String>(); - Map<String, String> coreSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> oozieSiteProperties = new HashMap<>(); + Map<String, String> oozieEnvProperties = new HashMap<>(); + Map<String, String> hiveEnvProperties = new HashMap<>(); + Map<String, String> coreSiteProperties = new HashMap<>(); configProperties.put("oozie-site", oozieSiteProperties); configProperties.put("oozie-env", oozieEnvProperties); @@ -1682,21 +1682,21 @@ public class BlueprintConfigurationProcessorTest { // note: test hostgroups may not accurately reflect the required components for the config properties // which are mapped to them. Only the hostgroup name is used for hostgroup resolution an the components // are not validated - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("OOZIE_SERVER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<String> groupComponents2 = new HashSet<String>(); + Collection<String> groupComponents2 = new HashSet<>(); groupComponents2.add("OOZIE_SERVER"); - Collection<String> hosts2 = new ArrayList<String>(); + Collection<String> hosts2 = new ArrayList<>(); hosts2.add(expectedHostNameTwo); hosts2.add("serverFour"); TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, groupComponents2, hosts2); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); hostGroups.add(group2); @@ -1748,25 +1748,25 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostGroupNameTwo = "host_group_2"; final String expectedPortNum = "80000"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> oozieSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> oozieSiteProperties = new HashMap<>(); configProperties.put("oozie-site", oozieSiteProperties); oozieSiteProperties.put("oozie.service.JPAService.jdbc.url", "jdbc:mysql://" + expectedHostNameTwo + "/ooziedb"); Configuration clusterConfig = new Configuration(configProperties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("OOZIE_SERVER"); hgComponents.add("ZOOKEEPER_SERVER"); TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, Collections.singleton(expectedHostName)); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("OOZIE_SERVER"); hgComponents2.add("ZOOKEEPER_SERVER"); TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, hgComponents2, Collections.singleton(expectedHostNameTwo)); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -1787,25 +1787,25 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostGroupNameTwo = "host_group_2"; final String expectedPortNum = "80000"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> oozieSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> oozieSiteProperties = new HashMap<>(); configProperties.put("oozie-site", oozieSiteProperties); oozieSiteProperties.put("oozie.service.JPAService.jdbc.url", "jdbc:mysql://" + "%HOSTGROUP::group1%" + "/ooziedb"); Configuration clusterConfig = new Configuration(configProperties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("OOZIE_SERVER"); hgComponents.add("ZOOKEEPER_SERVER"); TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, Collections.singleton(expectedHostName)); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("OOZIE_SERVER"); hgComponents2.add("ZOOKEEPER_SERVER"); TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, hgComponents2, Collections.singleton(expectedHostNameTwo)); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -1827,14 +1827,14 @@ public class BlueprintConfigurationProcessorTest { final String expectedPortNumberOne = "2112"; final String expectedPortNumberTwo = "1221"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> coreSiteProperties = new HashMap<String, String>(); - Map<String, String> hbaseSiteProperties = new HashMap<String, String>(); - Map<String, String> webHCatSiteProperties = new HashMap<String, String>(); - Map<String, String> sliderClientProperties = new HashMap<String, String>(); - Map<String, String> yarnSiteProperties = new HashMap<String, String>(); - Map<String, String> kafkaBrokerProperties = new HashMap<String, String>(); - Map<String, String> accumuloSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> coreSiteProperties = new HashMap<>(); + Map<String, String> hbaseSiteProperties = new HashMap<>(); + Map<String, String> webHCatSiteProperties = new HashMap<>(); + Map<String, String> sliderClientProperties = new HashMap<>(); + Map<String, String> yarnSiteProperties = new HashMap<>(); + Map<String, String> kafkaBrokerProperties = new HashMap<>(); + Map<String, String> accumuloSiteProperties = new HashMap<>(); configProperties.put("core-site", coreSiteProperties); configProperties.put("hbase-site", hbaseSiteProperties); @@ -1856,21 +1856,21 @@ public class BlueprintConfigurationProcessorTest { Collections.<String, Map<String, Map<String, String>>>emptyMap()); // test hostgroups may not accurately reflect the required components for the config properties which are mapped to them - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("ZOOKEEPER_SERVER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<String> groupComponents2 = new HashSet<String>(); + Collection<String> groupComponents2 = new HashSet<>(); groupComponents2.add("ZOOKEEPER_SERVER"); - Collection<String> hosts2 = new ArrayList<String>(); + Collection<String> hosts2 = new ArrayList<>(); hosts2.add(expectedHostNameTwo); hosts2.add("serverFour"); TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, groupComponents2, hosts2); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); hostGroups.add(group2); @@ -1911,14 +1911,14 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostGroupNameTwo = "host_group_2"; Map<String, Map<String, String>> configProperties = - new HashMap<String, Map<String, String>>(); + new HashMap<>(); Map<String, String> coreSiteProperties = - new HashMap<String, String>(); + new HashMap<>(); Map<String, String> webHCatSiteProperties = - new HashMap<String, String>(); + new HashMap<>(); Map<String, String> oozieSiteProperties = - new HashMap<String, String>(); + new HashMap<>(); configProperties.put("core-site", coreSiteProperties); configProperties.put("webhcat-site", webHCatSiteProperties); @@ -1936,21 +1936,21 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(configProperties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("KNOX_GATEWAY"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<String> groupComponents2 = new HashSet<String>(); + Collection<String> groupComponents2 = new HashSet<>(); groupComponents2.add("KNOX_GATEWAY"); - Collection<String> hosts2 = new ArrayList<String>(); + Collection<String> hosts2 = new ArrayList<>(); hosts2.add(expectedHostNameTwo); hosts2.add("serverFour"); TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, groupComponents2, hosts2); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); hostGroups.add(group2); @@ -1980,26 +1980,26 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostGroupName = "host_group_1"; final String expectedPortNumberOne = "2112"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> kafkaBrokerProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); + Map<String, String> kafkaBrokerProperties = new HashMap<>(); configProperties.put("kafka-broker", kafkaBrokerProperties); kafkaBrokerProperties.put("kafka.ganglia.metrics.host", createHostAddress(expectedHostName, expectedPortNumberOne)); Configuration clusterConfig = new Configuration(configProperties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("KAFKA_BROKER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<String> groupComponents2 = new HashSet<String>(); + Collection<String> groupComponents2 = new HashSet<>(); groupComponents2.add("NAMENODE"); TestHostGroup group2 = new TestHostGroup("group2", groupComponents2, Collections.singleton("group2Host")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); hostGroups.add(group2); @@ -2019,9 +2019,9 @@ public class BlueprintConfigurationProcessorTest { final String expectedHostName = "c6401.apache.ambari.org"; final String expectedHostGroupName = "host_group_1"; - Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>(); + Map<String, Map<String, String>> configProperties = new HashMap<>(); - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); configProperties.put("storm-site", properties); // setup properties that include host information including undefined host properties @@ -2032,14 +2032,14 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(configProperties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> groupComponents = new HashSet<String>(); + Collection<String> groupComponents = new HashSet<>(); groupComponents.add("ZOOKEEPER_SERVER"); - Collection<String> hosts = new ArrayList<String>(); + Collection<String> hosts = new ArrayList<>(); hosts.add(expectedHostName); hosts.add("serverTwo"); TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); @@ -2058,9 +2058,9 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__defaultValue() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); - Map<String, String> typeProps2 = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); + Map<String, String> typeProps2 = new HashMap<>(); typeProps.put("yarn.resourcemanager.hostname", "localhost"); typeProps2.put("oozie_heapsize", "1024"); typeProps2.put("oozie_permsize", "128"); @@ -2069,18 +2069,18 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> group1Components = new HashSet<String>(); + Collection<String> group1Components = new HashSet<>(); group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); - Collection<String> group2Components = new HashSet<String>(); + Collection<String> group2Components = new HashSet<>(); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2109,13 +2109,13 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__defaultValue_providedInParent() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> yarnSiteProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> yarnSiteProps = new HashMap<>(); yarnSiteProps.put("yarn.resourcemanager.hostname", "localhost"); properties.put("yarn-site", yarnSiteProps); - Map<String, Map<String, String>> parentProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> parentYarnSiteProps = new HashMap<String, String>(); + Map<String, Map<String, String>> parentProperties = new HashMap<>(); + Map<String, String> parentYarnSiteProps = new HashMap<>(); parentYarnSiteProps.put("yarn.resourcemanager.resource-tracker.address", "localhost"); parentProperties.put("yarn-site", parentYarnSiteProps); @@ -2125,18 +2125,18 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap(), parentClusterConfig); - Collection<String> group1Components = new HashSet<String>(); + Collection<String> group1Components = new HashSet<>(); group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); - Collection<String> group2Components = new HashSet<String>(); + Collection<String> group2Components = new HashSet<>(); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2151,26 +2151,26 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__defaultValue_hostGroupConfig() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> yarnSiteProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> yarnSiteProps = new HashMap<>(); yarnSiteProps.put("yarn.resourcemanager.hostname", "localhost"); properties.put("yarn-site", yarnSiteProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> group1Components = new HashSet<String>(); + Collection<String> group1Components = new HashSet<>(); group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); - Collection<String> group2Components = new HashSet<String>(); + Collection<String> group2Components = new HashSet<>(); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); - Map<String, Map<String, String>> group2Properties = new HashMap<String, Map<String, String>>(); - Map<String, String> group2YarnSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> group2Properties = new HashMap<>(); + Map<String, String> group2YarnSiteProperties = new HashMap<>(); group2YarnSiteProperties.put("yarn.resourcemanager.resource-tracker.address", "localhost"); group2Properties.put("yarn-site", group2YarnSiteProperties); // group 2 host group configuration @@ -2183,7 +2183,7 @@ public class BlueprintConfigurationProcessorTest { // set config on HG TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2"), group2Config); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2198,26 +2198,26 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__defaultValue_BPHostGroupConfig() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> yarnSiteProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> yarnSiteProps = new HashMap<>(); yarnSiteProps.put("yarn.resourcemanager.hostname", "localhost"); properties.put("yarn-site", yarnSiteProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> group1Components = new HashSet<String>(); + Collection<String> group1Components = new HashSet<>(); group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); - Collection<String> group2Components = new HashSet<String>(); + Collection<String> group2Components = new HashSet<>(); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); - Map<String, Map<String, String>> group2BPProperties = new HashMap<String, Map<String, String>>(); - Map<String, String> group2YarnSiteProperties = new HashMap<String, String>(); + Map<String, Map<String, String>> group2BPProperties = new HashMap<>(); + Map<String, String> group2YarnSiteProperties = new HashMap<>(); group2YarnSiteProperties.put("yarn.resourcemanager.resource-tracker.address", "localhost"); group2BPProperties.put("yarn-site", group2YarnSiteProperties); // group 2 host group configuration @@ -2231,7 +2231,7 @@ public class BlueprintConfigurationProcessorTest { // set config on HG TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2"), group2Config); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2249,26 +2249,26 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__MissingComponent() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("yarn.resourcemanager.hostname", "localhost"); typeProps.put("yarn.timeline-service.address", "localhost"); properties.put("yarn-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> group1Components = new HashSet<String>(); + Collection<String> group1Components = new HashSet<>(); group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); - Collection<String> group2Components = new HashSet<String>(); + Collection<String> group2Components = new HashSet<>(); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2289,28 +2289,28 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__MultipleMatchingHostGroupsError() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("yarn.resourcemanager.hostname", "localhost"); typeProps.put("yarn.timeline-service.address", "localhost"); properties.put("yarn-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> group1Components = new HashSet<String>(); + Collection<String> group1Components = new HashSet<>(); group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); group1Components.add("APP_TIMELINE_SERVER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); - Collection<String> group2Components = new HashSet<String>(); + Collection<String> group2Components = new HashSet<>(); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); group2Components.add("APP_TIMELINE_SERVER"); TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2331,8 +2331,8 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__MultipleAppTimelineServer() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("yarn.timeline-service.address", "testhost:10200"); typeProps.put("yarn.timeline-service.webapp.address", "testhost:8188"); @@ -2341,20 +2341,20 @@ public class BlueprintConfigurationProcessorTest { Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> group1Components = new HashSet<String>(); + Collection<String> group1Components = new HashSet<>(); group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); group1Components.add("APP_TIMELINE_SERVER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); - Collection<String> group2Components = new HashSet<String>(); + Collection<String> group2Components = new HashSet<>(); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); group2Components.add("APP_TIMELINE_SERVER"); TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2373,25 +2373,25 @@ public class BlueprintConfigurationProcessorTest { public void testDoUpdateForClusterCreate_SingleHostProperty__MissingOptionalComponent() throws Exception { final String expectedHostName = "localhost"; - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("yarn.timeline-service.address", expectedHostName); properties.put("yarn-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> group1Components = new HashSet<String>(); + Collection<String> group1Components = new HashSet<>(); group1Components.add("NAMENODE"); group1Components.add("SECONDARY_NAMENODE"); group1Components.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost")); - Collection<String> group2Components = new HashSet<String>(); + Collection<String> group2Components = new HashSet<>(); group2Components.add("DATANODE"); group2Components.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2407,25 +2407,25 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_SingleHostProperty__defaultValue__WithPort() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("fs.defaultFS", "localhost:5050"); properties.put("core-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("RESOURCEMANAGER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, Collections.singleton("testhost2")); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); @@ -2438,38 +2438,38 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_MultiHostProperty__defaultValues() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("hbase.zookeeper.quorum", "localhost"); properties.put("hbase-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("ZOOKEEPER_SERVER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_SERVER"); - Set<String> hosts2 = new HashSet<String>(); + Set<String> hosts2 = new HashSet<>(); hosts2.add("testhost2"); hosts2.add("testhost2a"); hosts2.add("testhost2b"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, hosts2); - Collection<String> hgComponents3 = new HashSet<String>(); + Collection<String> hgComponents3 = new HashSet<>(); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_CLIENT"); - Set<String> hosts3 = new HashSet<String>(); + Set<String> hosts3 = new HashSet<>(); hosts3.add("testhost3"); hosts3.add("testhost3a"); TestHostGroup group3 = new TestHostGroup("group3", hgComponents3, hosts3); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); hostGroups.add(group3); @@ -2480,7 +2480,7 @@ public class BlueprintConfigurationProcessorTest { String updatedVal = topology.getConfiguration().getFullProperties().get("hbase-site").get("hbase.zookeeper.quorum"); String[] hosts = updatedVal.split(","); - Collection<String> expectedHosts = new HashSet<String>(); + Collection<String> expectedHosts = new HashSet<>(); expectedHosts.add("testhost"); expectedHosts.add("testhost2"); expectedHosts.add("testhost2a"); @@ -2495,38 +2495,38 @@ public class BlueprintConfigurationProcessorTest { @Test public void testDoUpdateForClusterCreate_MultiHostProperty__defaultValues___withPorts() throws Exception { - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, String> typeProps = new HashMap<String, String>(); + Map<String, Map<String, String>> properties = new HashMap<>(); + Map<String, String> typeProps = new HashMap<>(); typeProps.put("templeton.zookeeper.hosts", "localhost:9090"); properties.put("webhcat-site", typeProps); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); - Collection<String> hgComponents = new HashSet<String>(); + Collection<String> hgComponents = new HashSet<>(); hgComponents.add("NAMENODE"); hgComponents.add("SECONDARY_NAMENODE"); hgComponents.add("ZOOKEEPER_SERVER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents, Collections.singleton("testhost")); - Collection<String> hgComponents2 = new HashSet<String>(); + Collection<String> hgComponents2 = new HashSet<>(); hgComponents2.add("DATANODE"); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_SERVER"); - Set<String> hosts2 = new HashSet<String>(); + Set<String> hosts2 = new HashSet<>(); hosts2.add("testhost2"); hosts2.add("testhost2a"); hosts2.add("testhost2b"); TestHostGroup group2 = new TestHostGroup("group2", hgComponents2, hosts2); - Collection<String> hgComponents3 = new HashSet<String>(); + Collection<String> hgComponents3 = new HashSet<>(); hgComponents2.add("HDFS_CLIENT"); hgComponents2.add("ZOOKEEPER_CLIENT"); - Set<String> hosts3 = new HashSet<String>(); + Set<String> hosts3 = new HashSet<>(); hosts3.add("testhost3"); hosts3.add("testhost3a"); TestHostGroup group3 = new TestHostGroup("group3", hgComponents3, hosts3); - Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>(); + Collection<TestHostGroup> hostGroups = new HashSet<>(); hostGroups.add(group1); hostGroups.add(group2); hostGroups.add(group3); @@ -2537,7 +2537,7 @@ public class BlueprintConfigurationProcessorTest { String updatedVal = topology.getConfiguration().getFullProperties().get("webhcat-site").get("templeton.zookeeper.hosts"); String[] hosts = updatedVal.split(","); - Collection<String> expectedHosts = new HashSet<String>(); + Collection<String> expectedHosts = new HashSet<>(); expectedHosts.add("testhost:9090"); expectedHosts.add("testhost2:9090"); expectedHosts.add("testhost2a:9090"); @@ -2559,26 +2559,26 @@ public class BlueprintConfigurationProcessorTest { final String component1 = "ZOOKEEPER_SERVER"; final String component2 = "ZOOKEEPER_CLIENT"; - Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); - Map<String, Stri
<TRUNCATED>