Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB2A210A0F for ; Wed, 10 Jul 2013 11:18:11 +0000 (UTC) Received: (qmail 97048 invoked by uid 500); 10 Jul 2013 11:18:09 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 96994 invoked by uid 500); 10 Jul 2013 11:18:09 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 96943 invoked by uid 99); 10 Jul 2013 11:18:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jul 2013 11:18:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jul 2013 11:18:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6D3142388B3A; Wed, 10 Jul 2013 11:17:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1501723 [5/11] - in /hbase/branches/0.95/hbase-examples: src/main/java/org/apache/hadoop/hbase/thrift/generated/ src/main/java/org/apache/hadoop/hbase/thrift2/ src/main/python/ src/main/python/gen-py/hbase/ src/main/python/thrift1/ src/mai... Date: Wed, 10 Jul 2013 11:17:37 -0000 To: commits@hbase.apache.org From: larsgeorge@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130710111742.6D3142388B3A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: hbase/branches/0.95/hbase-examples/src/main/python/DemoClient.py URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-examples/src/main/python/DemoClient.py?rev=1501723&r1=1501722&r2=1501723&view=diff ============================================================================== --- hbase/branches/0.95/hbase-examples/src/main/python/DemoClient.py (original) +++ hbase/branches/0.95/hbase-examples/src/main/python/DemoClient.py Wed Jul 10 11:17:36 2013 @@ -1,218 +0,0 @@ -#!/usr/bin/python -''' - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -''' - -import sys -import time -import os - -# Modify this import path to point to the correct location to thrift. -thrift_path = os.path.abspath('/Users/sergey/Downloads/thrift/lib/py/build/lib.macosx-10.8-intel-2.7') -sys.path.append(thrift_path) -gen_py_path = os.path.abspath('gen-py') -sys.path.append(gen_py_path) - -from thrift import Thrift -from thrift.transport import TSocket, TTransport -from thrift.protocol import TBinaryProtocol -from hbase import ttypes -from hbase.Hbase import Client, ColumnDescriptor, Mutation - -def printVersions(row, versions): - print "row: " + row + ", values: ", - for cell in versions: - print cell.value + "; ", - print - -def printRow(entry): - print "row: " + entry.row + ", cols:", - for k in sorted(entry.columns): - print k + " => " + entry.columns[k].value, - print - - -def demo_client(host, port, is_framed_transport): - - # Make socket - socket = TSocket.TSocket(host, port) - - # Make transport - if is_framed_transport: - transport = TTransport.TFramedTransport(socket) - else: - transport = TTransport.TBufferedTransport(socket) - - # Wrap in a protocol - protocol = TBinaryProtocol.TBinaryProtocol(transport) - - # Create a client to use the protocol encoder - client = Client(protocol) - - # Connect! - transport.open() - - t = "demo_table" - - # - # Scan all tables, look for the demo table and delete it. - # - print "scanning tables..." - for table in client.getTableNames(): - print " found: %s" %(table) - if table == t: - if client.isTableEnabled(table): - print " disabling table: %s" %(t) - client.disableTable(table) - print " deleting table: %s" %(t) - client.deleteTable(table) - - columns = [] - col = ColumnDescriptor() - col.name = 'entry:' - col.maxVersions = 10 - columns.append(col) - col = ColumnDescriptor() - col.name = 'unused:' - columns.append(col) - - try: - print "creating table: %s" %(t) - client.createTable(t, columns) - except AlreadyExists, ae: - print "WARN: " + ae.message - - cols = client.getColumnDescriptors(t) - print "column families in %s" %(t) - for col_name in cols.keys(): - col = cols[col_name] - print " column: %s, maxVer: %d" % (col.name, col.maxVersions) - - dummy_attributes = {} - # - # Test UTF-8 handling - # - invalid = "foo-\xfc\xa1\xa1\xa1\xa1\xa1" - valid = "foo-\xE7\x94\x9F\xE3\x83\x93\xE3\x83\xBC\xE3\x83\xAB"; - - # non-utf8 is fine for data - mutations = [Mutation(column="entry:foo",value=invalid)] - print str(mutations) - client.mutateRow(t, "foo", mutations, dummy_attributes) - - # try empty strings - mutations = [Mutation(column="entry:", value="")] - client.mutateRow(t, "", mutations, dummy_attributes) - - # this row name is valid utf8 - mutations = [Mutation(column="entry:foo", value=valid)] - client.mutateRow(t, valid, mutations, dummy_attributes) - - # non-utf8 is not allowed in row names - try: - mutations = [Mutation(column="entry:foo", value=invalid)] - client.mutateRow(t, invalid, mutations, dummy_attributes) - except ttypes.IOError, e: - print 'expected exception: %s' %(e.message) - - # Run a scanner on the rows we just created - print "Starting scanner..." - scanner = client.scannerOpen(t, "", ["entry:"], dummy_attributes) - - r = client.scannerGet(scanner) - while r: - printRow(r[0]) - r = client.scannerGet(scanner) - print "Scanner finished" - - # - # Run some operations on a bunch of rows. - # - for e in range(100, 0, -1): - # format row keys as "00000" to "00100" - row = "%0.5d" % (e) - - mutations = [Mutation(column="unused:", value="DELETE_ME")] - client.mutateRow(t, row, mutations, dummy_attributes) - printRow(client.getRow(t, row, dummy_attributes)[0]) - client.deleteAllRow(t, row, dummy_attributes) - - mutations = [Mutation(column="entry:num", value="0"), - Mutation(column="entry:foo", value="FOO")] - client.mutateRow(t, row, mutations, dummy_attributes) - printRow(client.getRow(t, row, dummy_attributes)[0]); - - mutations = [Mutation(column="entry:foo",isDelete=True), - Mutation(column="entry:num",value="-1")] - client.mutateRow(t, row, mutations, dummy_attributes) - printRow(client.getRow(t, row, dummy_attributes)[0]) - - mutations = [Mutation(column="entry:num", value=str(e)), - Mutation(column="entry:sqr", value=str(e*e))] - client.mutateRow(t, row, mutations, dummy_attributes) - printRow(client.getRow(t, row, dummy_attributes)[0]) - - time.sleep(0.05) - - mutations = [Mutation(column="entry:num",value="-999"), - Mutation(column="entry:sqr",isDelete=True)] - client.mutateRowTs(t, row, mutations, 1, dummy_attributes) # shouldn't override latest - printRow(client.getRow(t, row, dummy_attributes)[0]) - - versions = client.getVer(t, row, "entry:num", 10, dummy_attributes) - printVersions(row, versions) - if len(versions) != 3: - print("FATAL: wrong # of versions") - sys.exit(-1) - - r = client.get(t, row, "entry:foo", dummy_attributes) - # just to be explicit, we get lists back, if it's empty there was no matching row. - if len(r) > 0: - raise "shouldn't get here!" - - columnNames = [] - for (col, desc) in client.getColumnDescriptors(t).items(): - print "column with name: "+desc.name - print desc - columnNames.append(desc.name+":") - - print "Starting scanner..." - scanner = client.scannerOpenWithStop(t, "00020", "00040", columnNames, dummy_attributes) - - r = client.scannerGet(scanner) - while r: - printRow(r[0]) - r = client.scannerGet(scanner) - - client.scannerClose(scanner) - print "Scanner finished" - - transport.close() - - -if __name__ == '__main__': - - import sys - if len(sys.argv) < 3: - print 'usage: %s ' % __file__ - sys.exit(1) - - host = sys.argv[1] - port = sys.argv[2] - is_framed_transport = False - demo_client(host, port, is_framed_transport) - Modified: hbase/branches/0.95/hbase-examples/src/main/python/gen-py/hbase/Hbase-remote URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-examples/src/main/python/gen-py/hbase/Hbase-remote?rev=1501723&r1=1501722&r2=1501723&view=diff ============================================================================== --- hbase/branches/0.95/hbase-examples/src/main/python/gen-py/hbase/Hbase-remote (original) +++ hbase/branches/0.95/hbase-examples/src/main/python/gen-py/hbase/Hbase-remote Wed Jul 10 11:17:36 2013 @@ -1,382 +0,0 @@ -#!/usr/bin/env python -# -# Autogenerated by Thrift Compiler (0.9.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py -# - -import sys -import pprint -from urlparse import urlparse -from thrift.transport import TTransport -from thrift.transport import TSocket -from thrift.transport import THttpClient -from thrift.protocol import TBinaryProtocol - -import Hbase -from ttypes import * - -if len(sys.argv) <= 1 or sys.argv[1] == '--help': - print '' - print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]' - print '' - print 'Functions:' - print ' void enableTable(Bytes tableName)' - print ' void disableTable(Bytes tableName)' - print ' bool isTableEnabled(Bytes tableName)' - print ' void compact(Bytes tableNameOrRegionName)' - print ' void majorCompact(Bytes tableNameOrRegionName)' - print ' getTableNames()' - print ' getColumnDescriptors(Text tableName)' - print ' getTableRegions(Text tableName)' - print ' void createTable(Text tableName, columnFamilies)' - print ' void deleteTable(Text tableName)' - print ' get(Text tableName, Text row, Text column, attributes)' - print ' getVer(Text tableName, Text row, Text column, i32 numVersions, attributes)' - print ' getVerTs(Text tableName, Text row, Text column, i64 timestamp, i32 numVersions, attributes)' - print ' getRow(Text tableName, Text row, attributes)' - print ' getRowWithColumns(Text tableName, Text row, columns, attributes)' - print ' getRowTs(Text tableName, Text row, i64 timestamp, attributes)' - print ' getRowWithColumnsTs(Text tableName, Text row, columns, i64 timestamp, attributes)' - print ' getRows(Text tableName, rows, attributes)' - print ' getRowsWithColumns(Text tableName, rows, columns, attributes)' - print ' getRowsTs(Text tableName, rows, i64 timestamp, attributes)' - print ' getRowsWithColumnsTs(Text tableName, rows, columns, i64 timestamp, attributes)' - print ' void mutateRow(Text tableName, Text row, mutations, attributes)' - print ' void mutateRowTs(Text tableName, Text row, mutations, i64 timestamp, attributes)' - print ' void mutateRows(Text tableName, rowBatches, attributes)' - print ' void mutateRowsTs(Text tableName, rowBatches, i64 timestamp, attributes)' - print ' i64 atomicIncrement(Text tableName, Text row, Text column, i64 value)' - print ' void deleteAll(Text tableName, Text row, Text column, attributes)' - print ' void deleteAllTs(Text tableName, Text row, Text column, i64 timestamp, attributes)' - print ' void deleteAllRow(Text tableName, Text row, attributes)' - print ' void increment(TIncrement increment)' - print ' void incrementRows( increments)' - print ' void deleteAllRowTs(Text tableName, Text row, i64 timestamp, attributes)' - print ' ScannerID scannerOpenWithScan(Text tableName, TScan scan, attributes)' - print ' ScannerID scannerOpen(Text tableName, Text startRow, columns, attributes)' - print ' ScannerID scannerOpenWithStop(Text tableName, Text startRow, Text stopRow, columns, attributes)' - print ' ScannerID scannerOpenWithPrefix(Text tableName, Text startAndPrefix, columns, attributes)' - print ' ScannerID scannerOpenTs(Text tableName, Text startRow, columns, i64 timestamp, attributes)' - print ' ScannerID scannerOpenWithStopTs(Text tableName, Text startRow, Text stopRow, columns, i64 timestamp, attributes)' - print ' scannerGet(ScannerID id)' - print ' scannerGetList(ScannerID id, i32 nbRows)' - print ' void scannerClose(ScannerID id)' - print ' getRowOrBefore(Text tableName, Text row, Text family)' - print ' TRegionInfo getRegionInfo(Text row)' - print '' - sys.exit(0) - -pp = pprint.PrettyPrinter(indent = 2) -host = 'localhost' -port = 9090 -uri = '' -framed = False -http = False -argi = 1 - -if sys.argv[argi] == '-h': - parts = sys.argv[argi+1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - argi += 2 - -if sys.argv[argi] == '-u': - url = urlparse(sys.argv[argi+1]) - parts = url[1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - else: - port = 80 - uri = url[2] - if url[4]: - uri += '?%s' % url[4] - http = True - argi += 2 - -if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': - framed = True - argi += 1 - -cmd = sys.argv[argi] -args = sys.argv[argi+1:] - -if http: - transport = THttpClient.THttpClient(host, port, uri) -else: - socket = TSocket.TSocket(host, port) - if framed: - transport = TTransport.TFramedTransport(socket) - else: - transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol.TBinaryProtocol(transport) -client = Hbase.Client(protocol) -transport.open() - -if cmd == 'enableTable': - if len(args) != 1: - print 'enableTable requires 1 args' - sys.exit(1) - pp.pprint(client.enableTable(eval(args[0]),)) - -elif cmd == 'disableTable': - if len(args) != 1: - print 'disableTable requires 1 args' - sys.exit(1) - pp.pprint(client.disableTable(eval(args[0]),)) - -elif cmd == 'isTableEnabled': - if len(args) != 1: - print 'isTableEnabled requires 1 args' - sys.exit(1) - pp.pprint(client.isTableEnabled(eval(args[0]),)) - -elif cmd == 'compact': - if len(args) != 1: - print 'compact requires 1 args' - sys.exit(1) - pp.pprint(client.compact(eval(args[0]),)) - -elif cmd == 'majorCompact': - if len(args) != 1: - print 'majorCompact requires 1 args' - sys.exit(1) - pp.pprint(client.majorCompact(eval(args[0]),)) - -elif cmd == 'getTableNames': - if len(args) != 0: - print 'getTableNames requires 0 args' - sys.exit(1) - pp.pprint(client.getTableNames()) - -elif cmd == 'getColumnDescriptors': - if len(args) != 1: - print 'getColumnDescriptors requires 1 args' - sys.exit(1) - pp.pprint(client.getColumnDescriptors(eval(args[0]),)) - -elif cmd == 'getTableRegions': - if len(args) != 1: - print 'getTableRegions requires 1 args' - sys.exit(1) - pp.pprint(client.getTableRegions(eval(args[0]),)) - -elif cmd == 'createTable': - if len(args) != 2: - print 'createTable requires 2 args' - sys.exit(1) - pp.pprint(client.createTable(eval(args[0]),eval(args[1]),)) - -elif cmd == 'deleteTable': - if len(args) != 1: - print 'deleteTable requires 1 args' - sys.exit(1) - pp.pprint(client.deleteTable(eval(args[0]),)) - -elif cmd == 'get': - if len(args) != 4: - print 'get requires 4 args' - sys.exit(1) - pp.pprint(client.get(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'getVer': - if len(args) != 5: - print 'getVer requires 5 args' - sys.exit(1) - pp.pprint(client.getVer(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) - -elif cmd == 'getVerTs': - if len(args) != 6: - print 'getVerTs requires 6 args' - sys.exit(1) - pp.pprint(client.getVerTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),)) - -elif cmd == 'getRow': - if len(args) != 3: - print 'getRow requires 3 args' - sys.exit(1) - pp.pprint(client.getRow(eval(args[0]),eval(args[1]),eval(args[2]),)) - -elif cmd == 'getRowWithColumns': - if len(args) != 4: - print 'getRowWithColumns requires 4 args' - sys.exit(1) - pp.pprint(client.getRowWithColumns(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'getRowTs': - if len(args) != 4: - print 'getRowTs requires 4 args' - sys.exit(1) - pp.pprint(client.getRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'getRowWithColumnsTs': - if len(args) != 5: - print 'getRowWithColumnsTs requires 5 args' - sys.exit(1) - pp.pprint(client.getRowWithColumnsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) - -elif cmd == 'getRows': - if len(args) != 3: - print 'getRows requires 3 args' - sys.exit(1) - pp.pprint(client.getRows(eval(args[0]),eval(args[1]),eval(args[2]),)) - -elif cmd == 'getRowsWithColumns': - if len(args) != 4: - print 'getRowsWithColumns requires 4 args' - sys.exit(1) - pp.pprint(client.getRowsWithColumns(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'getRowsTs': - if len(args) != 4: - print 'getRowsTs requires 4 args' - sys.exit(1) - pp.pprint(client.getRowsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'getRowsWithColumnsTs': - if len(args) != 5: - print 'getRowsWithColumnsTs requires 5 args' - sys.exit(1) - pp.pprint(client.getRowsWithColumnsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) - -elif cmd == 'mutateRow': - if len(args) != 4: - print 'mutateRow requires 4 args' - sys.exit(1) - pp.pprint(client.mutateRow(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'mutateRowTs': - if len(args) != 5: - print 'mutateRowTs requires 5 args' - sys.exit(1) - pp.pprint(client.mutateRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) - -elif cmd == 'mutateRows': - if len(args) != 3: - print 'mutateRows requires 3 args' - sys.exit(1) - pp.pprint(client.mutateRows(eval(args[0]),eval(args[1]),eval(args[2]),)) - -elif cmd == 'mutateRowsTs': - if len(args) != 4: - print 'mutateRowsTs requires 4 args' - sys.exit(1) - pp.pprint(client.mutateRowsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'atomicIncrement': - if len(args) != 4: - print 'atomicIncrement requires 4 args' - sys.exit(1) - pp.pprint(client.atomicIncrement(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'deleteAll': - if len(args) != 4: - print 'deleteAll requires 4 args' - sys.exit(1) - pp.pprint(client.deleteAll(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'deleteAllTs': - if len(args) != 5: - print 'deleteAllTs requires 5 args' - sys.exit(1) - pp.pprint(client.deleteAllTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) - -elif cmd == 'deleteAllRow': - if len(args) != 3: - print 'deleteAllRow requires 3 args' - sys.exit(1) - pp.pprint(client.deleteAllRow(eval(args[0]),eval(args[1]),eval(args[2]),)) - -elif cmd == 'increment': - if len(args) != 1: - print 'increment requires 1 args' - sys.exit(1) - pp.pprint(client.increment(eval(args[0]),)) - -elif cmd == 'incrementRows': - if len(args) != 1: - print 'incrementRows requires 1 args' - sys.exit(1) - pp.pprint(client.incrementRows(eval(args[0]),)) - -elif cmd == 'deleteAllRowTs': - if len(args) != 4: - print 'deleteAllRowTs requires 4 args' - sys.exit(1) - pp.pprint(client.deleteAllRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'scannerOpenWithScan': - if len(args) != 3: - print 'scannerOpenWithScan requires 3 args' - sys.exit(1) - pp.pprint(client.scannerOpenWithScan(eval(args[0]),eval(args[1]),eval(args[2]),)) - -elif cmd == 'scannerOpen': - if len(args) != 4: - print 'scannerOpen requires 4 args' - sys.exit(1) - pp.pprint(client.scannerOpen(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'scannerOpenWithStop': - if len(args) != 5: - print 'scannerOpenWithStop requires 5 args' - sys.exit(1) - pp.pprint(client.scannerOpenWithStop(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) - -elif cmd == 'scannerOpenWithPrefix': - if len(args) != 4: - print 'scannerOpenWithPrefix requires 4 args' - sys.exit(1) - pp.pprint(client.scannerOpenWithPrefix(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) - -elif cmd == 'scannerOpenTs': - if len(args) != 5: - print 'scannerOpenTs requires 5 args' - sys.exit(1) - pp.pprint(client.scannerOpenTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) - -elif cmd == 'scannerOpenWithStopTs': - if len(args) != 6: - print 'scannerOpenWithStopTs requires 6 args' - sys.exit(1) - pp.pprint(client.scannerOpenWithStopTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),)) - -elif cmd == 'scannerGet': - if len(args) != 1: - print 'scannerGet requires 1 args' - sys.exit(1) - pp.pprint(client.scannerGet(eval(args[0]),)) - -elif cmd == 'scannerGetList': - if len(args) != 2: - print 'scannerGetList requires 2 args' - sys.exit(1) - pp.pprint(client.scannerGetList(eval(args[0]),eval(args[1]),)) - -elif cmd == 'scannerClose': - if len(args) != 1: - print 'scannerClose requires 1 args' - sys.exit(1) - pp.pprint(client.scannerClose(eval(args[0]),)) - -elif cmd == 'getRowOrBefore': - if len(args) != 3: - print 'getRowOrBefore requires 3 args' - sys.exit(1) - pp.pprint(client.getRowOrBefore(eval(args[0]),eval(args[1]),eval(args[2]),)) - -elif cmd == 'getRegionInfo': - if len(args) != 1: - print 'getRegionInfo requires 1 args' - sys.exit(1) - pp.pprint(client.getRegionInfo(eval(args[0]),)) - -else: - print 'Unrecognized method %s' % cmd - sys.exit(1) - -transport.close()