Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added get_cluster_status

  • Loading branch information...
commit aa3747e2e5d1ab872c4b41a5857aaa5786555687 1 parent 9ad142f
@hammer hammer authored
View
7 examples/pyhbase-cli
@@ -1,5 +1,6 @@
#! /usr/bin/env python
import sys
+import pprint
from pyhbase.connection import HBaseConnection
@@ -11,6 +12,7 @@ if __name__=="__main__":
Commands:
get_hbase_version
+ get_cluster_status
list_tables
describe_table table
is_table_enabled table
@@ -61,6 +63,11 @@ if __name__=="__main__":
usage()
sys.exit(1)
print connection.get_hbase_version(*args)
+ elif cmd == 'get_cluster_status':
+ if len(args) != 0:
+ usage()
+ sys.exit(1)
+ pprint.pprint(connection.get_cluster_status(*args))
elif cmd == 'describe_table':
if len(args) != 1:
usage()
View
4 pyhbase/connection.py
@@ -63,6 +63,10 @@ def get_hbase_version(self):
"""Get HBase version."""
return self.requestor.request("getHBaseVersion", {})
+ def get_cluster_status(self):
+ """Get cluster status."""
+ return self.requestor.request("getClusterStatus", {})
+
@retry_wrapper
def describe_table(self, table):
"""Grab table information."""
View
133 pyhbase/schema/hbase.avpr
@@ -203,6 +203,134 @@
}, "null" ]
} ]
}, {
+ "type" : "record",
+ "name" : "AServerAddress",
+ "fields" : [ {
+ "name" : "bindAddress",
+ "type" : "string"
+ }, {
+ "name" : "hostname",
+ "type" : "string"
+ }, {
+ "name" : "inetSocketAddress",
+ "type" : "string"
+ }, {
+ "name" : "port",
+ "type" : "int"
+ } ]
+ }, {
+ "type" : "record",
+ "name" : "ARegionLoad",
+ "fields" : [ {
+ "name" : "memStoreSizeMB",
+ "type" : "int"
+ }, {
+ "name" : "name",
+ "type" : "bytes"
+ }, {
+ "name" : "storefileIndexSizeMB",
+ "type" : "int"
+ }, {
+ "name" : "storefiles",
+ "type" : "int"
+ }, {
+ "name" : "storefileSizeMB",
+ "type" : "int"
+ }, {
+ "name" : "stores",
+ "type" : "int"
+ } ]
+ }, {
+ "type" : "record",
+ "name" : "AServerLoad",
+ "fields" : [ {
+ "name" : "load",
+ "type" : "int"
+ }, {
+ "name" : "maxHeapMB",
+ "type" : "int"
+ }, {
+ "name" : "memStoreSizeInMB",
+ "type" : "int"
+ }, {
+ "name" : "numberOfRegions",
+ "type" : "int"
+ }, {
+ "name" : "numberOfRequests",
+ "type" : "int"
+ }, {
+ "name" : "regionsLoad",
+ "type" : [ {
+ "type" : "array",
+ "items" : "ARegionLoad"
+ }, "null" ]
+ }, {
+ "name" : "storefileIndexSizeInMB",
+ "type" : "int"
+ }, {
+ "name" : "storefiles",
+ "type" : "int"
+ }, {
+ "name" : "storefileSizeInMB",
+ "type" : "int"
+ }, {
+ "name" : "usedHeapMB",
+ "type" : "int"
+ } ]
+ }, {
+ "type" : "record",
+ "name" : "AServerInfo",
+ "fields" : [ {
+ "name" : "infoPort",
+ "type" : "int"
+ }, {
+ "name" : "load",
+ "type" : "AServerLoad"
+ }, {
+ "name" : "serverAddress",
+ "type" : "AServerAddress"
+ }, {
+ "name" : "serverName",
+ "type" : "string"
+ }, {
+ "name" : "startCode",
+ "type" : "long"
+ } ]
+ }, {
+ "type" : "record",
+ "name" : "AClusterStatus",
+ "fields" : [ {
+ "name" : "averageLoad",
+ "type" : "double"
+ }, {
+ "name" : "deadServerNames",
+ "type" : [ {
+ "type" : "array",
+ "items" : "string"
+ }, "null" ]
+ }, {
+ "name" : "deadServers",
+ "type" : "int"
+ }, {
+ "name" : "hbaseVersion",
+ "type" : "string"
+ }, {
+ "name" : "regionsCount",
+ "type" : "int"
+ }, {
+ "name" : "requestsCount",
+ "type" : "int"
+ }, {
+ "name" : "serverInfos",
+ "type" : [ {
+ "type" : "array",
+ "items" : "AServerInfo"
+ }, "null" ]
+ }, {
+ "name" : "servers",
+ "type" : "int"
+ } ]
+ }, {
"type" : "error",
"name" : "AIOError",
"fields" : [ {
@@ -324,6 +452,11 @@
"response" : "string",
"errors" : [ "AIOError" ]
},
+ "getClusterStatus" : {
+ "request" : [ ],
+ "response" : "AClusterStatus",
+ "errors" : [ "AIOError" ]
+ },
"listTables" : {
"request" : [ ],
"response" : {
View
2  setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(name="PyHBase",
- version='0.0.11',
+ version='0.0.12',
description="High-level Python interface to HBase",
url="http://github.com/hammer/pyhbase/",
packages=['pyhbase'],
Please sign in to comment.
Something went wrong with that request. Please try again.