def test_get_node_group_services(self): node_processes = ['ZooKeeper', 'Webserver', 'CLDB'] node_group = s.NodeGroup(None, node_processes=node_processes) cluster_info = ci.ClusterInfo(None, self.plugin_spec) actual = cluster_info.get_services(node_group) expected = ['Management', 'MapR FS', 'general'] self.assertItemsEqual(expected, actual)
def __init__(self, cluster, plugin_spec): h_version = cluster.hadoop_version v_handler = vhf.VersionHandlerFactory.get().get_handler(h_version) self.context = v_handler.get_context(cluster) self.cluster = cluster self.plugin_spec = plugin_spec self.cluster_info = ci.ClusterInfo(self.cluster, self.plugin_spec) self.cluster_configs_template = self.get_cluster_configs_template() self.node_group_files = self.get_node_group_configs()
def test_get_cluster_services(self): np0 = ['ZooKeeper', 'Webserver', 'CLDB'] ng0 = s.NodeGroup(node_processes=np0) np1 = ['ZooKeeper', 'TaskTracker', 'FileServer'] ng1 = s.NodeGroup(node_processes=np1) cluster = s.Cluster(node_groups=[ng0, ng1]) cluster_info = ci.ClusterInfo(cluster, self.plugin_spec) actual = cluster_info.get_services() expected = ['Management', 'MapR FS', 'general', 'MapReduce'] self.assertItemsEqual(expected, actual)
def validate(cluster, component, count): c_info = ci.ClusterInfo(cluster, None) actual_count = c_info.get_instances_count(component) if not actual_count == count: raise e.InvalidComponentCountException(component, count, actual_count)
def validate(cluster, component, dependency): c_info = ci.ClusterInfo(cluster, None) for ng in c_info.get_node_groups(component): if dependency not in ng.node_processes: raise NodeRequiredServiceMissingException( component, dependency)
def validate(cluster, components): rc_vr = require_of_listed_components(components) c_info = ci.ClusterInfo(cluster, None) for i in c_info.get_instances(): rc_vr(i)
def validate(cluster, component): rc_vr = require_component_vr(component) c_info = ci.ClusterInfo(cluster, None) for i in c_info.get_instances(): rc_vr(i)