@Test public void testGetComponents() throws Exception { ClusterDefinition clusterDefinition = new ClusterDefinition(new TestStateProvider(), new TestClusterDefinitionProvider(), new TestHostInfoProvider()); Set<String> components = clusterDefinition.getComponents("HDFS"); Assert.assertTrue(components.contains("NAMENODE")); Assert.assertTrue(components.contains("SECONDARY_NAMENODE")); Assert.assertTrue(components.contains("DATANODE")); components = clusterDefinition.getComponents("MAPREDUCE"); Assert.assertTrue(components.contains("JOBTRACKER")); Assert.assertTrue(components.contains("TASKTRACKER")); components = clusterDefinition.getComponents("FLUME"); Assert.assertTrue(components.contains("FLUME_SERVER")); components = clusterDefinition.getComponents("OOZIE"); Assert.assertTrue(components.contains("OOZIE_SERVER")); components = clusterDefinition.getComponents("HBASE"); Assert.assertTrue(components.contains("HBASE_MASTER")); Assert.assertTrue(components.contains("HBASE_REGIONSERVER")); components = clusterDefinition.getComponents("ZOOKEEPER"); Assert.assertTrue(components.contains("ZOOKEEPER_SERVER")); components = clusterDefinition.getComponents("HIVE"); Assert.assertTrue(components.contains("HIVE_SERVER")); clusterDefinition = new ClusterDefinition(new TestStateProvider(), new TestClusterDefinitionProvider("clusterproperties_HDP2_HA.txt", "myCluster", "HDP-2.0.6"), new TestHostInfoProvider()); components = clusterDefinition.getComponents("HDFS"); Assert.assertTrue(components.contains("NAMENODE")); Assert.assertTrue(components.contains("SECONDARY_NAMENODE")); Assert.assertTrue(components.contains("DATANODE")); Assert.assertTrue(components.contains("ZKFC")); Assert.assertTrue(components.contains("JOURNALNODE")); clusterDefinition = new ClusterDefinition(new TestStateProvider(), new TestClusterDefinitionProvider("clusterproperties_HDP21_HA.txt", "myCluster", "HDP-2.1.2"), new TestHostInfoProvider()); components = clusterDefinition.getComponents("HDFS"); Assert.assertTrue(components.contains("NAMENODE")); Assert.assertTrue(components.contains("ZKFC")); Assert.assertTrue(components.contains("JOURNALNODE")); components = clusterDefinition.getComponents("YARN"); Assert.assertTrue(components.contains("RESOURCEMANAGER")); }
public Set<String> getComponents(String service) { Set<String> componentSet = components.get(service); return componentSet == null ? Collections.<String>emptySet() : componentSet; }
ClusterDefinition { public Set<String> getComponents(String service) { Set<String> componentSet = components.get(service); return componentSet == null ? Collections.<String>emptySet() : componentSet; } }
ClusterDefinition { public Set<String> getComponents(String service) { Set<String> componentSet = components.get(service); return componentSet == null ? Collections.<String>emptySet() : componentSet; } ClusterDefinition(StateProvider stateProvider,
                           ClusterDefinitionProvider definitionProvider,
                           HostInfoProvider hostInfoProvider); }
ClusterDefinition { public Set<String> getComponents(String service) { Set<String> componentSet = components.get(service); return componentSet == null ? Collections.<String>emptySet() : componentSet; } ClusterDefinition(StateProvider stateProvider,
                           ClusterDefinitionProvider definitionProvider,
                           HostInfoProvider hostInfoProvider); Integer getMajorStackVersion(); Integer getMinorStackVersion(); String getClusterName(); String getVersionId(); Set<String> getServices(); Set<String> getHosts(); HostInfoProvider getHostInfoProvider(); Set<String> getComponents(String service); Set<String> getHostComponents(String service, String host); String getHostState(String hostName); String getServiceState(String serviceName); int setServiceState(String serviceName, String state); String getComponentState(String serviceName, String componentName); int setComponentState(String serviceName, String componentName, String state); String getHostComponentState(String hostName, String componentName); int setHostComponentState(String hostName, String componentName, String state); StateProvider.Process getProcess(Integer id); Set<Resource> getRequestResources(); Set<Resource> getTaskResources(); }
ClusterDefinition { public Set<String> getComponents(String service) { Set<String> componentSet = components.get(service); return componentSet == null ? Collections.<String>emptySet() : componentSet; } ClusterDefinition(StateProvider stateProvider,
                           ClusterDefinitionProvider definitionProvider,
                           HostInfoProvider hostInfoProvider); Integer getMajorStackVersion(); Integer getMinorStackVersion(); String getClusterName(); String getVersionId(); Set<String> getServices(); Set<String> getHosts(); HostInfoProvider getHostInfoProvider(); Set<String> getComponents(String service); Set<String> getHostComponents(String service, String host); String getHostState(String hostName); String getServiceState(String serviceName); int setServiceState(String serviceName, String state); String getComponentState(String serviceName, String componentName); int setComponentState(String serviceName, String componentName, String state); String getHostComponentState(String hostName, String componentName); int setHostComponentState(String hostName, String componentName, String state); StateProvider.Process getProcess(Integer id); Set<Resource> getRequestResources(); Set<Resource> getTaskResources();  }