You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2013/07/10 13:17:07 UTC
svn commit: r1501722 [1/5] - in /hbase/trunk/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/ src/main/python/thrift1/ src/main/python/thrift...
Author: larsgeorge
Date: Wed Jul 10 11:17:06 2013
New Revision: 1501722
URL: http://svn.apache.org/r1501722
Log:
HBASE-8890 Fix Thrift 2 example class location
Added:
hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/
hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java
hbase/trunk/hbase-examples/src/main/python/thrift1/
hbase/trunk/hbase-examples/src/main/python/thrift1/DemoClient.py
hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/
hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/
hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-remote
hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase.py
hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/__init__.py
hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/constants.py
hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/ttypes.py
hbase/trunk/hbase-examples/src/main/python/thrift2/
hbase/trunk/hbase-examples/src/main/python/thrift2/DemoClient.py
hbase/trunk/hbase-examples/src/main/python/thrift2/gen-py/
hbase/trunk/hbase-examples/src/main/python/thrift2/gen-py/hbase/
hbase/trunk/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService-remote (with props)
hbase/trunk/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService.py
hbase/trunk/hbase-examples/src/main/python/thrift2/gen-py/hbase/__init__.py
hbase/trunk/hbase-examples/src/main/python/thrift2/gen-py/hbase/constants.py
hbase/trunk/hbase-examples/src/main/python/thrift2/gen-py/hbase/ttypes.py
Removed:
hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift/generated/
hbase/trunk/hbase-examples/src/main/python/DemoClient.py
hbase/trunk/hbase-examples/src/main/python/gen-py/
hbase/trunk/hbase-examples/thrift2/
Added: hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java?rev=1501722&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java (added)
+++ hbase/trunk/hbase-examples/src/main/java/org/apache/hadoop/hbase/thrift2/DemoClient.java Wed Jul 10 11:17:06 2013
@@ -0,0 +1,89 @@
+/**
+ *
+ * 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.
+ */
+package org.apache.hadoop.hbase.thrift2;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hadoop.hbase.thrift2.generated.TColumnValue;
+import org.apache.hadoop.hbase.thrift2.generated.TGet;
+import org.apache.hadoop.hbase.thrift2.generated.THBaseService;
+import org.apache.hadoop.hbase.thrift2.generated.TIOError;
+import org.apache.hadoop.hbase.thrift2.generated.TPut;
+import org.apache.hadoop.hbase.thrift2.generated.TResult;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TFramedTransport;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+
+public class DemoClient {
+ public static void main(String[] args) throws TIOError, TException {
+ System.out.println("Thrift2 Demo");
+ System.out.println("This demo assumes you have a table called \"example\" with a column family called \"family1\"");
+
+ String host = "localhost";
+ int port = 9090;
+ int timeout = 10000;
+ boolean framed = false;
+
+ TTransport transport = new TSocket(host, port, timeout);
+ if (framed) {
+ transport = new TFramedTransport(transport);
+ }
+ TProtocol protocol = new TBinaryProtocol(transport);
+ // This is our thrift client.
+ THBaseService.Iface client = new THBaseService.Client(protocol);
+
+ // open the transport
+ transport.open();
+
+ ByteBuffer table = ByteBuffer.wrap("example".getBytes());
+
+ TPut put = new TPut();
+ put.setRow("row1".getBytes());
+
+ TColumnValue columnValue = new TColumnValue();
+ columnValue.setFamily("family1".getBytes());
+ columnValue.setQualifier("qualifier1".getBytes());
+ columnValue.setValue("value1".getBytes());
+ List<TColumnValue> columnValues = new ArrayList<TColumnValue>();
+ columnValues.add(columnValue);
+ put.setColumnValues(columnValues);
+
+ client.put(table, put);
+
+ TGet get = new TGet();
+ get.setRow("row1".getBytes());
+
+ TResult result = client.get(table, get);
+
+ System.out.print("row = " + new String(result.getRow()));
+ for (TColumnValue resultColumnValue : result.getColumnValues()) {
+ System.out.print("family = " + new String(resultColumnValue.getFamily()));
+ System.out.print("qualifier = " + new String(resultColumnValue.getFamily()));
+ System.out.print("value = " + new String(resultColumnValue.getValue()));
+ System.out.print("timestamp = " + resultColumnValue.getTimestamp());
+ }
+
+ transport.close();
+ }
+}
Added: hbase/trunk/hbase-examples/src/main/python/thrift1/DemoClient.py
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/python/thrift1/DemoClient.py?rev=1501722&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/python/thrift1/DemoClient.py (added)
+++ hbase/trunk/hbase-examples/src/main/python/thrift1/DemoClient.py Wed Jul 10 11:17:06 2013
@@ -0,0 +1,218 @@
+#!/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 <host> <port>' % __file__
+ sys.exit(1)
+
+ host = sys.argv[1]
+ port = sys.argv[2]
+ is_framed_transport = False
+ demo_client(host, port, is_framed_transport)
+
Added: hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-remote
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-remote?rev=1501722&view=auto
==============================================================================
--- hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-remote (added)
+++ hbase/trunk/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-remote Wed Jul 10 11:17:06 2013
@@ -0,0 +1,382 @@
+#!/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()