def list_resources(fabric): try: pinot_fabric = PinotFabric(config, logger, fabric) except PinotException as e: return jsonify( dict(success=False, error_message='Failed getting fabric {0}'.format(e))) try: resources = pinot_fabric.get_resources() except PinotException as e: return jsonify( dict(success=False, error_message='Failed getting fabric: {0}'.format(e))) try: zk = PinotZk(config, logger, fabric) except PinotException as e: return jsonify( dict(success=False, error_message='Failed getting ZK: {0}'.format(e))) return jsonify( dict(success=True, clusters=resources, nodes=pinot_fabric.get_nodes(zk.get_handle())))
def get_table_info(fabric, cluster, table): resource = PinotResource(config, logger, fabric, cluster) try: zk = PinotZk(config, logger, fabric) except PinotException as e: return jsonify(dict(success=False, error_message='Failed getting ZK: {0}'.format(e))) zkhandle = zk.get_handle() return jsonify(dict(success=True, data=resource.get_table_info(table, zkhandle), segments=resource.get_table_segments(table, zkhandle)))
def cluster_info(fabric, cluster): resource = PinotResource(config, logger, fabric, cluster) try: zk = PinotZk(config, logger, fabric) except PinotException as e: return jsonify(dict(success=False, error_message='Failed getting ZK: {0}'.format(e))) zkhandle = zk.get_handle() return jsonify(dict(success=True, info={}, tables=resource.get_tables(zkhandle), nodes=resource.get_nodes(zkhandle)))
def get_table_info(fabric, cluster, table): resource = PinotResource(config, logger, fabric, cluster) try: zk = PinotZk(config, logger, fabric) except PinotException as e: return jsonify( dict(success=False, error_message='Failed getting ZK: {0}'.format(e))) zkhandle = zk.get_handle() return jsonify( dict(success=True, data=resource.get_table_info(table, zkhandle), segments=resource.get_table_segments(table, zkhandle)))
def cluster_info(fabric, cluster): resource = PinotResource(config, logger, fabric, cluster) try: zk = PinotZk(config, logger, fabric) except PinotException as e: return jsonify( dict(success=False, error_message='Failed getting ZK: {0}'.format(e))) zkhandle = zk.get_handle() return jsonify( dict(success=True, info={}, tables=resource.get_tables(zkhandle), nodes=resource.get_nodes(zkhandle)))
def list_resources(fabric): try: pinot_fabric = PinotFabric(config, logger, fabric) except PinotException as e: return jsonify(dict(success=False, error_message='Failed getting fabric {0}'.format(e))) try: resources = pinot_fabric.get_resources() except PinotException as e: return jsonify(dict(success=False, error_message='Failed getting fabric: {0}'.format(e))) try: zk = PinotZk(config, logger, fabric) except PinotException as e: return jsonify(dict(success=False, error_message='Failed getting ZK: {0}'.format(e))) return jsonify(dict(success=True, clusters=resources, nodes=pinot_fabric.get_nodes(zk.get_handle())))