def _validate_additional_ng_scaling(self, cluster, additional): jt = utils.get_jobtracker(cluster) scalable_processes = self._get_scalable_processes() for ng_id in additional: ng = self._get_by_id(cluster.node_groups, ng_id) if not set(ng.node_processes).issubset(scalable_processes): raise ex.NodeGroupCannotBeScaled( ng.name, "Vanilla plugin cannot scale nodegroup" " with processes: " + ' '.join(ng.node_processes)) if not jt and 'tasktracker' in ng.node_processes: raise ex.NodeGroupCannotBeScaled( ng.name, "Vanilla plugin cannot scale node group with " "processes which have no master-processes run " "in cluster")
def _validate_existing_ng_scaling(self, cluster, existing): scalable_processes = self._get_scalable_processes() dn_to_delete = 0 for ng in cluster.node_groups: if ng.id in existing: if ng.count > existing[ng.id] and "datanode" in \ ng.node_processes: dn_to_delete += ng.count - existing[ng.id] if not set(ng.node_processes).issubset(scalable_processes): raise ex.NodeGroupCannotBeScaled( ng.name, "Intel plugin cannot scale nodegroup" " with processes: " + ' '.join(ng.node_processes))
def _validate_existing_ng_scaling(self, cluster, existing): scalable_processes = self._get_scalable_processes() dn_to_delete = 0 for ng in cluster.node_groups: if ng.id in existing: if ng.count > existing[ng.id] and "datanode" in \ ng.node_processes: dn_to_delete += ng.count - existing[ng.id] if not set(ng.node_processes).issubset(scalable_processes): raise ex.NodeGroupCannotBeScaled( ng.name, "Vanilla plugin cannot scale nodegroup" " with processes: " + ' '.join(ng.node_processes)) dn_amount = len(utils.get_datanodes(cluster)) rep_factor = c_helper.determine_cluster_config(cluster, "dfs.replication") if dn_to_delete > 0 and dn_amount - dn_to_delete < rep_factor: raise Exception("Vanilla plugin cannot shrink cluster because " "it would be not enough nodes for replicas " "(replication factor is %s )" % rep_factor)