def setUpClass(cls): cls.cluster_path, master_port = cls.start_cluster() time.sleep(1) cls.client = kudu.Client('127.0.0.1:{0}'.format(master_port)) cls.schema = cls.example_schema() cls.ex_table = 'example-table' if cls.client.table_exists(cls.ex_table): cls.client.delete_table(cls.ex_table) cls.client.create_table(cls.ex_table, cls.schema)
def _get_scan_token_results(input): client = kudu.Client("{0}:{1}".format(input[1], input[2])) scanner = client.deserialize_token_into_scanner(input[0]) scanner.open() return scanner.read_all_tuples()
def __init__(self, kudu_table=None): self.client = kudu.Client(settings.KUDU_MASTER) self.kudu_table = self.client.open_table(settings.KUDU_TABLE)
def connect_to(host, port=7051): """Returns a kudu client object connecting to the specified kudu master""" return kudu.Client("{0}:{1}".format(host, port))