Exemple #1
0
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())))
Exemple #2
0
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)))
Exemple #3
0
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)))
Exemple #4
0
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)))
Exemple #5
0
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)))
Exemple #6
0
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())))