예제 #1
0
파일: __init__.py 프로젝트: bforevdr/pinot_
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())))
예제 #2
0
파일: __init__.py 프로젝트: BITDM/pinot
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)))
예제 #3
0
파일: __init__.py 프로젝트: BITDM/pinot
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)))
예제 #4
0
파일: __init__.py 프로젝트: bforevdr/pinot_
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)))
예제 #5
0
파일: __init__.py 프로젝트: bforevdr/pinot_
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)))
예제 #6
0
파일: __init__.py 프로젝트: BITDM/pinot
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())))