def stress(self, stress_options): stress = common.get_stress_bin(self.get_install_dir()) livenodes = [ node.network_interfaces['storage'][0] for node in list(self.nodes.values()) if node.is_live() ] if len(livenodes) == 0: print_("No live node") return nodes_options = [] if self.cassandra_version() <= '2.1': if '-d' not in stress_options: nodes_options = ['-d', ",".join(livenodes)] args = [stress] + nodes_options + stress_options else: if '-node' not in stress_options: nodes_options = ['-node', ','.join(livenodes)] args = [stress] + stress_options + nodes_options rc = None try: # need to set working directory for env on Windows if common.is_win(): rc = subprocess.call(args, cwd=common.parse_path(stress)) else: rc = subprocess.call(args) except KeyboardInterrupt: pass return rc
def stress(self, stress_options): stress = common.get_stress_bin(self.get_install_dir()) livenodes = [node.network_interfaces['storage'][0] for node in list(self.nodes.values()) if node.is_live()] if len(livenodes) == 0: print_("No live node") return nodes_options = [] if self.cassandra_version() <= '2.1': if '-d' not in stress_options: nodes_options = ['-d', ",".join(livenodes)] args = [stress] + nodes_options + stress_options else: if '-node' not in stress_options: nodes_options = ['-node', ','.join(livenodes)] args = [stress] + stress_options + nodes_options rc = None try: # need to set working directory for env on Windows if common.is_win(): rc = subprocess.call(args, cwd=common.parse_path(stress)) else: rc = subprocess.call(args) except KeyboardInterrupt: pass return rc
def stress(self, stress_options): stress = common.get_stress_bin(self.get_cassandra_dir()) args = [ stress ] + stress_options try: subprocess.call(args, cwd=common.parse_path(stress)) except KeyboardInterrupt: pass
def stress(self, stress_options): stress = common.get_stress_bin(self.get_cassandra_dir()) args = [stress] + stress_options try: subprocess.call(args, cwd=common.parse_path(stress)) except KeyboardInterrupt: pass
def stress(self, stress_options): stress = common.get_stress_bin(self.get_cassandra_dir()) livenodes = [ node.network_interfaces['storage'][0] for node in list(self.nodes.values()) if node.is_live() ] if len(livenodes) == 0: print_("No live node") return args = [ stress, '-d', ",".join(livenodes) ] + stress_options try: # need to set working directory for env on Windows if common.is_win(): subprocess.call(args, cwd=common.parse_path(stress)) else: subprocess.call(args) except KeyboardInterrupt: pass return self
def stress(self, stress_options): stress = common.get_stress_bin(self.get_install_dir()) livenodes = [ node.network_interfaces['binary'] for node in list(self.nodes.values()) if node.is_live() ] if len(livenodes) == 0: print_('No live node') return def live_node_ips_joined(): return ','.join(n[0] for n in livenodes) nodes_options = [] if self.cassandra_version() <= '2.1': if '-d' not in stress_options: nodes_options = ['-d', live_node_ips_joined()] args = [stress] + nodes_options + stress_options elif self.cassandra_version() >= '4.0': if '-node' not in stress_options: nodes_options = [ '-node', ','.join( [node[0] + ':' + str(node[1]) for node in livenodes]) ] args = [stress] + stress_options + nodes_options else: if '-node' not in stress_options: nodes_options = ['-node', live_node_ips_joined()] args = [stress] + stress_options + nodes_options rc = None try: # need to set working directory for env on Windows if common.is_win(): rc = subprocess.call(args, cwd=common.parse_path(stress)) else: rc = subprocess.call(args) except KeyboardInterrupt: pass return rc
def stress(self, stress_options): stress = common.get_stress_bin(self.get_install_dir()) livenodes = [ node.network_interfaces['binary'] for node in list(self.nodes.values()) if node.is_live() ] if len(livenodes) == 0: print_("No live node") return nodes_options = [] if self.cassandra_version() <= '2.1': if '-d' not in stress_options: nodes_options = ['-d', ",".join(livenodes)] args = [stress] + nodes_options + stress_options elif self.cassandra_version() >= '4.0': if '-node' not in stress_options: args = [stress] + stress_options + ['-node'] if not self.allNativePortsMatch(): args += ['allow_server_port_discovery'] args += [ ",".join( [node[0] + ":" + str(node[1]) for node in livenodes]) ] else: if '-node' not in stress_options: nodes_options = ['-node', ','.join(livenodes)] args = [stress] + stress_options + nodes_options rc = None try: # need to set working directory for env on Windows if common.is_win(): rc = subprocess.call(args, cwd=common.parse_path(stress)) else: rc = subprocess.call(args) except KeyboardInterrupt: pass return rc