def setup_servers(): logging.info("Setup servers...") # Blockade up parser = block.setup_parser() opts = parser.parse_args(args=["up"]) block.cmd_up(opts) # Ceph start subp.call(["./ceph_start.sh"])
def setup_servers(): logging.info("Setup servers...") # Blockade up parser = block.setup_parser() opts = parser.parse_args(args=["up"]) block.cmd_up(opts) # Zk start subp.call(["./zk_start.sh"])
def get_servers_addrs(): # Get server addresses through Blockade parser = block.setup_parser() opts = parser.parse_args(args=["status"]) config = block.load_config(opts) b = block.get_blockade(config) containers = b.status() global servers for c in containers: servers.append((c.ip_address, 5000))
def get_servers_addrs(): # Get server addresses through Blockade parser = block.setup_parser() opts = parser.parse_args(args=["status"]) config = block.load_config(opts) b = block.get_blockade(config) containers = b.status() global servers global num_servers for c in containers: servers += c.ip_address servers += ":2181," num_servers += 1 servers.strip(",")
def write(): p = ThreadPool(num_write) # partition one random server from the others partition(random.choice(["ceph1","ceph2","ceph3"])) # print partition status parser = block.setup_parser() opts = parser.parse_args(args=["status"]) block.cmd_status(opts) for i in p.map(_issue_writes, range(0,num_clients)): pass #time.sleep(2) p.close() p.join() join_partition()
def write(): p = ThreadPool(num_write) # partition one random server from the others partition(random.choice(["ceph1", "ceph2", "ceph3"])) # print partition status parser = block.setup_parser() opts = parser.parse_args(args=["status"]) block.cmd_status(opts) for i in p.map(_issue_writes, range(0, num_clients)): pass #time.sleep(2) p.close() p.join() join_partition()
def write(): p = ThreadPool(num_write) # partition one random server from the others partition("zk" + str(random.randint(1, num_servers)) + "," + "zk" + str(random.randint(1, num_servers))) # print partition status parser = block.setup_parser() opts = parser.parse_args(args=["status"]) block.cmd_status(opts) for i in p.map(_issue_writes, clients): pass #time.sleep(2) p.close() p.join() join_partition()
def test_parser(self): # just make sure we don't have any typos for now cli.setup_parser()
def shutdown(): # Blocakde destroy parser = block.setup_parser() opts = parser.parse_args(args=["destroy"]) block.cmd_destroy(opts)
def join_partition(): # Blockade join logging.info("Joining partitions") parser = block.setup_parser() opts = parser.parse_args(args=["join"]) block.cmd_join(opts)
def partition(srv): # Blockade partition logging.info("Partitioning " + srv) parser = block.setup_parser() opts = parser.parse_args(args=["partition", srv]) block.cmd_partition(opts)