diff options
author | Wouter Bolsterlee <uws@xs4all.nl> | 2012-05-20 22:12:20 +0200 |
---|---|---|
committer | Wouter Bolsterlee <uws@xs4all.nl> | 2012-05-20 22:12:20 +0200 |
commit | f806fdf92755f227ca88dba3ae2b28477a26f531 (patch) | |
tree | 121907a81fd4024c574050a1f0ee9c135fbfe8d4 | |
parent | 6631068d9f7d1aca067f6dbcf901c67115aa32d0 (diff) | |
download | happybase-f806fdf92755f227ca88dba3ae2b28477a26f531.tar.gz |
Add happybase module
-rw-r--r-- | happybase/Hbase.thrift | 781 | ||||
-rw-r--r-- | happybase/__init__.py | 5 | ||||
-rw-r--r-- | happybase/api.py | 723 | ||||
-rwxr-xr-x | happybase/hbase/Hbase-remote | 354 | ||||
-rw-r--r-- | happybase/hbase/Hbase.py | 8865 | ||||
-rw-r--r-- | happybase/hbase/__init__.py | 1 | ||||
-rw-r--r-- | happybase/hbase/constants.py | 11 | ||||
-rw-r--r-- | happybase/hbase/ttypes.py | 948 | ||||
-rw-r--r-- | happybase/util.py | 39 |
9 files changed, 11727 insertions, 0 deletions
diff --git a/happybase/Hbase.thrift b/happybase/Hbase.thrift new file mode 100644 index 0000000..57985c1 --- /dev/null +++ b/happybase/Hbase.thrift @@ -0,0 +1,781 @@ +/* + * 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. + */ + +// ---------------------------------------------------------------- +// Hbase.thrift +// +// This is a Thrift interface definition file for the Hbase service. +// Target language libraries for C++, Java, Ruby, PHP, (and more) are +// generated by running this file through the Thrift compiler with the +// appropriate flags. The Thrift compiler binary and runtime +// libraries for various languages are available +// from the Apache Incubator (http://incubator.apache.org/thrift/) +// +// See the package.html file for information on the version of Thrift +// used to generate the *.java files checked into the Hbase project. +// ---------------------------------------------------------------- + +namespace java org.apache.hadoop.hbase.thrift.generated +namespace cpp apache.hadoop.hbase.thrift +namespace rb Apache.Hadoop.Hbase.Thrift +namespace py hbase +namespace perl Hbase + +// +// Types +// + +// NOTE: all variables with the Text type are assumed to be correctly +// formatted UTF-8 strings. This is a programming language and locale +// dependent property that the client application is repsonsible for +// maintaining. If strings with an invalid encoding are sent, an +// IOError will be thrown. + +typedef binary Text +typedef binary Bytes +typedef i32 ScannerID + +/** + * TCell - Used to transport a cell value (byte[]) and the timestamp it was + * stored with together as a result for get and getRow methods. This promotes + * the timestamp of a cell to a first-class value, making it easy to take + * note of temporal data. Cell is used all the way from HStore up to HTable. + */ +struct TCell{ + 1:Bytes value, + 2:i64 timestamp +} + +/** + * An HColumnDescriptor contains information about a column family + * such as the number of versions, compression settings, etc. It is + * used as input when creating a table or adding a column. + */ +struct ColumnDescriptor { + 1:Text name, + 2:i32 maxVersions = 3, + 3:string compression = "NONE", + 4:bool inMemory = 0, + 5:string bloomFilterType = "NONE", + 6:i32 bloomFilterVectorSize = 0, + 7:i32 bloomFilterNbHashes = 0, + 8:bool blockCacheEnabled = 0, + 9:i32 timeToLive = -1 +} + +/** + * A TRegionInfo contains information about an HTable region. + */ +struct TRegionInfo { + 1:Text startKey, + 2:Text endKey, + 3:i64 id, + 4:Text name, + 5:byte version +} + +/** + * A Mutation object is used to either update or delete a column-value. + */ +struct Mutation { + 1:bool isDelete = 0, + 2:Text column, + 3:Text value +} + + +/** + * A BatchMutation object is used to apply a number of Mutations to a single row. + */ +struct BatchMutation { + 1:Text row, + 2:list<Mutation> mutations +} + + +/** + * Holds row name and then a map of columns to cells. + */ +struct TRowResult { + 1:Text row, + 2:map<Text, TCell> columns +} + +/** + * A Scan object is used to specify scanner parameters when opening a scanner. + */ +struct TScan { + 1:optional Text startRow, + 2:optional Text stopRow, + 3:optional i64 timestamp, + 4:optional list<Text> columns, + 5:optional i32 caching, + 6:optional Text filterString +} + +// +// Exceptions +// +/** + * An IOError exception signals that an error occurred communicating + * to the Hbase master or an Hbase region server. Also used to return + * more general Hbase error conditions. + */ +exception IOError { + 1:string message +} + +/** + * An IllegalArgument exception indicates an illegal or invalid + * argument was passed into a procedure. + */ +exception IllegalArgument { + 1:string message +} + +/** + * An AlreadyExists exceptions signals that a table with the specified + * name already exists + */ +exception AlreadyExists { + 1:string message +} + +// +// Service +// + +service Hbase { + /** + * Brings a table on-line (enables it) + */ + void enableTable( + /** name of the table */ + 1:Bytes tableName + ) throws (1:IOError io) + + /** + * Disables a table (takes it off-line) If it is being served, the master + * will tell the servers to stop serving it. + */ + void disableTable( + /** name of the table */ + 1:Bytes tableName + ) throws (1:IOError io) + + /** + * @return true if table is on-line + */ + bool isTableEnabled( + /** name of the table to check */ + 1:Bytes tableName + ) throws (1:IOError io) + + void compact(1:Bytes tableNameOrRegionName) + throws (1:IOError io) + + void majorCompact(1:Bytes tableNameOrRegionName) + throws (1:IOError io) + + /** + * List all the userspace tables. + * + * @return returns a list of names + */ + list<Text> getTableNames() + throws (1:IOError io) + + /** + * List all the column families assoicated with a table. + * + * @return list of column family descriptors + */ + map<Text,ColumnDescriptor> getColumnDescriptors ( + /** table name */ + 1:Text tableName + ) throws (1:IOError io) + + /** + * List the regions associated with a table. + * + * @return list of region descriptors + */ + list<TRegionInfo> getTableRegions( + /** table name */ + 1:Text tableName) + throws (1:IOError io) + + /** + * Create a table with the specified column families. The name + * field for each ColumnDescriptor must be set and must end in a + * colon (:). All other fields are optional and will get default + * values if not explicitly specified. + * + * @throws IllegalArgument if an input parameter is invalid + * + * @throws AlreadyExists if the table name already exists + */ + void createTable( + /** name of table to create */ + 1:Text tableName, + + /** list of column family descriptors */ + 2:list<ColumnDescriptor> columnFamilies + ) throws (1:IOError io, 2:IllegalArgument ia, 3:AlreadyExists exist) + + /** + * Deletes a table + * + * @throws IOError if table doesn't exist on server or there was some other + * problem + */ + void deleteTable( + /** name of table to delete */ + 1:Text tableName + ) throws (1:IOError io) + + /** + * Get a single TCell for the specified table, row, and column at the + * latest timestamp. Returns an empty list if no such value exists. + * + * @return value for specified row/column + */ + list<TCell> get( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** column name */ + 3:Text column + ) throws (1:IOError io) + + /** + * Get the specified number of versions for the specified table, + * row, and column. + * + * @return list of cells for specified row/column + */ + list<TCell> getVer( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** column name */ + 3:Text column, + + /** number of versions to retrieve */ + 4:i32 numVersions + ) throws (1:IOError io) + + /** + * Get the specified number of versions for the specified table, + * row, and column. Only versions less than or equal to the specified + * timestamp will be returned. + * + * @return list of cells for specified row/column + */ + list<TCell> getVerTs( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** column name */ + 3:Text column, + + /** timestamp */ + 4:i64 timestamp, + + /** number of versions to retrieve */ + 5:i32 numVersions + ) throws (1:IOError io) + + /** + * Get all the data for the specified table and row at the latest + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list<TRowResult> getRow( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row + ) throws (1:IOError io) + + /** + * Get the specified columns for the specified table and row at the latest + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list<TRowResult> getRowWithColumns( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** List of columns to return, null for all columns */ + 3:list<Text> columns + ) throws (1:IOError io) + + /** + * Get all the data for the specified table and row at the specified + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list<TRowResult> getRowTs( + /** name of the table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** timestamp */ + 3:i64 timestamp + ) throws (1:IOError io) + + /** + * Get the specified columns for the specified table and row at the specified + * timestamp. Returns an empty list if the row does not exist. + * + * @return TRowResult containing the row and map of columns to TCells + */ + list<TRowResult> getRowWithColumnsTs( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** List of columns to return, null for all columns */ + 3:list<Text> columns, + 4:i64 timestamp + ) throws (1:IOError io) + + /** + * Get all the data for the specified table and rows at the latest + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + */ + list<TRowResult> getRows( + /** name of table */ + 1:Text tableName, + + /** row keys */ + 2:list<Text> rows + ) throws (1:IOError io) + + /** + * Get the specified columns for the specified table and rows at the latest + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + */ + list<TRowResult> getRowsWithColumns( + /** name of table */ + 1:Text tableName, + + /** row keys */ + 2:list<Text> rows + + /** List of columns to return, null for all columns */ + 3:list<Text> columns + ) throws (1:IOError io) + + /** + * Get all the data for the specified table and rows at the specified + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + */ + list<TRowResult> getRowsTs( + /** name of the table */ + 1:Text tableName, + + /** row keys */ + 2:list<Text> rows + + /** timestamp */ + 3:i64 timestamp + ) throws (1:IOError io) + + /** + * Get the specified columns for the specified table and rows at the specified + * timestamp. Returns an empty list if no rows exist. + * + * @return TRowResult containing the rows and map of columns to TCells + */ + list<TRowResult> getRowsWithColumnsTs( + /** name of table */ + 1:Text tableName, + + /** row keys */ + 2:list<Text> rows + + /** List of columns to return, null for all columns */ + 3:list<Text> columns, + 4:i64 timestamp + ) throws (1:IOError io) + + /** + * Apply a series of mutations (updates/deletes) to a row in a + * single transaction. If an exception is thrown, then the + * transaction is aborted. Default current timestamp is used, and + * all entries will have an identical timestamp. + */ + void mutateRow( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** list of mutation commands */ + 3:list<Mutation> mutations + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Apply a series of mutations (updates/deletes) to a row in a + * single transaction. If an exception is thrown, then the + * transaction is aborted. The specified timestamp is used, and + * all entries will have an identical timestamp. + */ + void mutateRowTs( + /** name of table */ + 1:Text tableName, + + /** row key */ + 2:Text row, + + /** list of mutation commands */ + 3:list<Mutation> mutations, + + /** timestamp */ + 4:i64 timestamp + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Apply a series of batches (each a series of mutations on a single row) + * in a single transaction. If an exception is thrown, then the + * transaction is aborted. Default current timestamp is used, and + * all entries will have an identical timestamp. + */ + void mutateRows( + /** name of table */ + 1:Text tableName, + + /** list of row batches */ + 2:list<BatchMutation> rowBatches + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Apply a series of batches (each a series of mutations on a single row) + * in a single transaction. If an exception is thrown, then the + * transaction is aborted. The specified timestamp is used, and + * all entries will have an identical timestamp. + */ + void mutateRowsTs( + /** name of table */ + 1:Text tableName, + + /** list of row batches */ + 2:list<BatchMutation> rowBatches, + + /** timestamp */ + 3:i64 timestamp + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Atomically increment the column value specified. Returns the next value post increment. + */ + i64 atomicIncrement( + /** name of table */ + 1:Text tableName, + + /** row to increment */ + 2:Text row, + + /** name of column */ + 3:Text column, + + /** amount to increment by */ + 4:i64 value + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Delete all cells that match the passed row and column. + */ + void deleteAll( + /** name of table */ + 1:Text tableName, + + /** Row to update */ + 2:Text row, + + /** name of column whose value is to be deleted */ + 3:Text column + ) throws (1:IOError io) + + /** + * Delete all cells that match the passed row and column and whose + * timestamp is equal-to or older than the passed timestamp. + */ + void deleteAllTs( + /** name of table */ + 1:Text tableName, + + /** Row to update */ + 2:Text row, + + /** name of column whose value is to be deleted */ + 3:Text column, + + /** timestamp */ + 4:i64 timestamp + ) throws (1:IOError io) + + /** + * Completely delete the row's cells. + */ + void deleteAllRow( + /** name of table */ + 1:Text tableName, + + /** key of the row to be completely deleted. */ + 2:Text row + ) throws (1:IOError io) + + /** + * Completely delete the row's cells marked with a timestamp + * equal-to or older than the passed timestamp. + */ + void deleteAllRowTs( + /** name of table */ + 1:Text tableName, + + /** key of the row to be completely deleted. */ + 2:Text row, + + /** timestamp */ + 3:i64 timestamp + ) throws (1:IOError io) + + /** + * Get a scanner on the current table, using the Scan instance + * for the scan parameters. + */ + ScannerID scannerOpenWithScan( + /** name of table */ + 1:Text tableName, + + /** Scan instance */ + 2:TScan scan + ) throws (1:IOError io) + + /** + * Get a scanner on the current table starting at the specified row and + * ending at the last row in the table. Return the specified columns. + * + * @return scanner id to be used with other scanner procedures + */ + ScannerID scannerOpen( + /** name of table */ + 1:Text tableName, + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + 2:Text startRow, + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + 3:list<Text> columns + ) throws (1:IOError io) + + /** + * Get a scanner on the current table starting and stopping at the + * specified rows. ending at the last row in the table. Return the + * specified columns. + * + * @return scanner id to be used with other scanner procedures + */ + ScannerID scannerOpenWithStop( + /** name of table */ + 1:Text tableName, + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + 2:Text startRow, + + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + 3:Text stopRow, + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + 4:list<Text> columns + ) throws (1:IOError io) + + /** + * Open a scanner for a given prefix. That is all rows will have the specified + * prefix. No other rows will be returned. + * + * @return scanner id to use with other scanner calls + */ + ScannerID scannerOpenWithPrefix( + /** name of table */ + 1:Text tableName, + + /** the prefix (and thus start row) of the keys you want */ + 2:Text startAndPrefix, + + /** the columns you want returned */ + 3:list<Text> columns + ) throws (1:IOError io) + + /** + * Get a scanner on the current table starting at the specified row and + * ending at the last row in the table. Return the specified columns. + * Only values with the specified timestamp are returned. + * + * @return scanner id to be used with other scanner procedures + */ + ScannerID scannerOpenTs( + /** name of table */ + 1:Text tableName, + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + 2:Text startRow, + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + 3:list<Text> columns, + + /** timestamp */ + 4:i64 timestamp + ) throws (1:IOError io) + + /** + * Get a scanner on the current table starting and stopping at the + * specified rows. ending at the last row in the table. Return the + * specified columns. Only values with the specified timestamp are + * returned. + * + * @return scanner id to be used with other scanner procedures + */ + ScannerID scannerOpenWithStopTs( + /** name of table */ + 1:Text tableName, + + /** + * Starting row in table to scan. + * Send "" (empty string) to start at the first row. + */ + 2:Text startRow, + + /** + * row to stop scanning on. This row is *not* included in the + * scanner's results + */ + 3:Text stopRow, + + /** + * columns to scan. If column name is a column family, all + * columns of the specified column family are returned. It's also possible + * to pass a regex in the column qualifier. + */ + 4:list<Text> columns, + + /** timestamp */ + 5:i64 timestamp + ) throws (1:IOError io) + + /** + * Returns the scanner's current row value and advances to the next + * row in the table. When there are no more rows in the table, or a key + * greater-than-or-equal-to the scanner's specified stopRow is reached, + * an empty list is returned. + * + * @return a TRowResult containing the current row and a map of the columns to TCells. + * + * @throws IllegalArgument if ScannerID is invalid + * + * @throws NotFound when the scanner reaches the end + */ + list<TRowResult> scannerGet( + /** id of a scanner returned by scannerOpen */ + 1:ScannerID id + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Returns, starting at the scanner's current row value nbRows worth of + * rows and advances to the next row in the table. When there are no more + * rows in the table, or a key greater-than-or-equal-to the scanner's + * specified stopRow is reached, an empty list is returned. + * + * @return a TRowResult containing the current row and a map of the columns to TCells. + * + * @throws IllegalArgument if ScannerID is invalid + * + * @throws NotFound when the scanner reaches the end + */ + list<TRowResult> scannerGetList( + /** id of a scanner returned by scannerOpen */ + 1:ScannerID id, + + /** number of results to return */ + 2:i32 nbRows + ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Closes the server-state associated with an open scanner. + * + * @throws IllegalArgument if ScannerID is invalid + */ + void scannerClose( + /** id of a scanner returned by scannerOpen */ + 1:ScannerID id + ) throws (1:IOError io, 2:IllegalArgument ia) +} diff --git a/happybase/__init__.py b/happybase/__init__.py new file mode 100644 index 0000000..4ba797c --- /dev/null +++ b/happybase/__init__.py @@ -0,0 +1,5 @@ +""" +HappyBase, a pythonic interface for HBase using Thrift +""" + +from .api import * diff --git a/happybase/api.py b/happybase/api.py new file mode 100644 index 0000000..398468c --- /dev/null +++ b/happybase/api.py @@ -0,0 +1,723 @@ +# coding: UTF-8 + +""" +HappyBase main API module. +""" + +import logging +logger = logging.getLogger(__name__) + +from collections import defaultdict +from operator import attrgetter +from struct import Struct + +from thrift.transport.TSocket import TSocket +from thrift.transport.TTransport import TBufferedTransport +from thrift.protocol import TBinaryProtocol + +from .hbase import Hbase +from .hbase.ttypes import BatchMutation, ColumnDescriptor, Mutation, TScan + +from .util import thrift_type_to_dict, pep8_to_camel_case + +__all__ = ['DEFAULT_HOST', 'DEFAULT_PORT', 'Connection', 'Table', 'Batch'] + + +# TODO: properly handle errors defined in Thrift specification + +DEFAULT_HOST = 'localhost' +DEFAULT_PORT = 9090 + +make_cell = attrgetter('value') +make_cell_timestamp = attrgetter('value', 'timestamp') +pack_i64 = Struct('>q').pack + + +def _make_row(cell_map, include_timestamp): + """Makes a row dict for a cell mapping like ttypes.TRowResult.columns.""" + cellfn = include_timestamp and make_cell_timestamp or make_cell + return dict((cn, cellfn(cell)) for cn, cell in cell_map.iteritems()) + + +class Connection(object): + """Connection to an HBase Thrift server. + + The `host` and `port` parameters specify the host name and TCP port of the + HBase Thrift server to connect to. If omitted or ``None``, a connection to + the default port on ``localhost`` is made. + + If `autoconnect` is `True` (the default) the connection is made directly, + otherwise :py:meth:`Connection.open` must be called explicitly before first + use. + + The optional `table_prefix` argument specifies a prefix that will be + prepended to all table names, e.g. when :py:meth:`Connection.table` is + invoked. If specified, the prefix plus an underscore will be prepended to + each table name. For example, if `table_prefix` is ``myproject``, all + tables tables will have names like ``myproject_XYZ``. + + :param str host: The host to connect to + :param int port: The port to connect to + :param bool autoconnect: Whether the connection should be opened directly. + :param str table_prefix: Prefix used to construct table names (optional) + """ + def __init__(self, host=DEFAULT_HOST, port=DEFAULT_PORT, autoconnect=True, + table_prefix=None): + + # Allow host and port to be None, which may be easier for + # applications wrapping a Connection object. + self.host = host or DEFAULT_HOST + self.port = port or DEFAULT_PORT + + self.table_prefix = table_prefix + self.transport = TBufferedTransport(TSocket(self.host, self.port)) + protocol = TBinaryProtocol.TBinaryProtocolAccelerated(self.transport) + self.client = Hbase.Client(protocol) + if autoconnect: + self.open() + + def _table_name(self, name): + """Constructs a table name by optionally adding a table name prefix.""" + if self.table_prefix is None: + return name + + return '%s_%s' % (self.table_prefix, name) + + def open(self): + """Opens the underlying transport to the HBase instance. + + This method opens the underlying Thrift transport (TCP connection). + """ + logger.debug("Opening Thrift transport to %s:%d", self.host, self.port) + self.transport.open() + + def close(self): + """Closes the underyling transport to the HBase instance. + + This method closes the underlying Thrift transport (TCP connection). + """ + logger.debug("Closing Thrift transport to %s:%d", self.host, self.port) + self.transport.close() + + __del__ = close + + def table(self, name, use_prefix=True): + """Returns a table object. + + Returns a :py:class:`happybase.Table` instance for the table named + `name`. This does not result in a round-trip to the server, and the + table is not checked for existence. + + The optional `use_prefix` parameter specifies whether the table prefix + (if any) is prepended to the specified `name`. Set this to `False` if + you want to use a table that resides in another ‘prefix namespace’, + e.g. a table from a ‘friendly’ application co-hosted on the same HBase + instance. See the `table_prefix` parameter to the + :py:class:`Connection` constructor for more information. + + :param str name: the name of the table + :param bool use_prefix: whether to use the table prefix (if any) + :return: Table object + :rtype: :py:class:`Table` + """ + if use_prefix: + name = self._table_name(name) + return Table(name, self.client) + + # + # Table administration and maintenance + # + + def tables(self): + """Returns a list of table names available in this HBase instance. + + If a `table_prefix` was set for this :py:class:`Connection`, only + tables that have the specified prefix will be listed. + + :return: The table names + :rtype: List of strings + """ + names = self.client.getTableNames() + + # Filter using prefix, and strip prefix from names + if self.table_prefix is not None: + prefix = self._table_name('') + offset = len(prefix) + names = [n[offset:] for n in names if n.startswith(prefix)] + + return names + + def create_table(self, name, families): + """Creates a table. + + :param str name: The table name + :param dict families: The name and options for each column family + + The `families` parameter is a dictionary mapping column family names to + a dictionary containing the options for this column family. See + ColumnDescriptor in the Thrift API for the supported options, but note + that the names should be provided in Python style, and not in camel + case notation, for example `time_to_live` (not `timeToLive`) and + `max_versions` (not `maxVersions`). + """ + name = self._table_name(name) + if not isinstance(families, dict): + raise TypeError("'families' arg must be a dictionary") + + if not families: + raise ValueError( + "Cannot create table %r (no column families specified)" + % name) + + column_descriptors = [] + for cf_name, options in families.iteritems(): + if options is None: + options = dict() + + kwargs = dict() + for option_name, value in options.iteritems(): + kwargs[pep8_to_camel_case(option_name)] = value + + if not cf_name.endswith(':'): + cf_name += ':' + kwargs['name'] = cf_name + + column_descriptors.append(ColumnDescriptor(**kwargs)) + + self.client.createTable(name, column_descriptors) + + def delete_table(self, name): + """Deletes the specified table. + + :param str name: The table name + """ + name = self._table_name(name) + self.client.deleteTable(name) + + def enable_table(self, name): + """Enables the specified table. + + :param str name: The table name + """ + name = self._table_name(name) + self.client.enableTable(name) + + def disable_table(self, name): + """Disables the specified table. + + :param str name: The table name + """ + name = self._table_name(name) + self.client.disableTable(name) + + def is_table_enabled(self, name): + """Returns whether the specified table is enabled. + + :param str name: The table name + """ + name = self._table_name(name) + return self.client.isTableEnabled(name) + + def compact_table(self, name, major=False): + """Compacts the specified table. + + :param str name: The table name + :param bool major: Whether to perform a major compaction. + """ + name = self._table_name(name) + if major: + self.client.majorCompact(name) + else: + self.client.compact(name) + + +class Table(object): + """HBase table abstraction class. + + This class cannot be instantiated directly; use :py:meth:`Connection.table` + instead. + """ + def __init__(self, name, client): + self.name = name + self.client = client + + def __repr__(self): + return '<%s.%s name=%r>' % (__name__, + self.__class__.__name__, + self.name) + + def families(self): + """Retrieves the column families for this table.""" + descriptors = self.client.getColumnDescriptors(self.name) + families = dict() + for name, descriptor in descriptors.items(): + name = name[:-1] # drop trailing ':' + families[name] = thrift_type_to_dict(descriptor) + return families + + def _column_family_names(self): + """Retrieves the column family names for this table (internal use)""" + return self.client.getColumnDescriptors(self.name).keys() + + def regions(self): + """Retrieves the regions for this table.""" + regions = self.client.getTableRegions(self.name) + return [thrift_type_to_dict(region) for region in regions] + + # + # Data retrieval + # + + def row(self, row, columns=None, timestamp=None, include_timestamp=False): + """Retrieves a single row of data. + + This method retrieves the row with the row key specified in the `row` + argument and returns the columns and values for this row as + a dictionary. + + The `row` argument is the row key of the row. If the `columns` argument + is specified, only the values for these columns will be returned + instead of all available columns. The `columns` argument should be + a list or tuple containing strings. Each name can be a column family, + such as `cf1` or `cf1:` (the trailing colon is not required), or + a column family with a qualifier, such as `cf1:col1`. + + If specified, the `timestamp` argument specifies the maximum version + that results may have. The `include_timestamp` argument specifies + whether cells are returned as single values or as `(value, timestamp)` + tuples. + + :param str row: the row key + :param list_or_tuple columns: list of columns (optional) + :param int timestamp: timestamp (optional) + :param bool include_timestamp: whether timestamps are returned + """ + if columns is not None and not isinstance(columns, (tuple, list)): + raise TypeError("'columns' must be a tuple or list") + + if timestamp is None: + rows = self.client.getRowWithColumns(self.name, row, columns) + else: + if not isinstance(timestamp, int): + raise TypeError("'timestamp' must be an integer") + rows = self.client.getRowWithColumnsTs(self.name, row, columns, + timestamp) + + if not rows: + return {} + + return _make_row(rows[0].columns, include_timestamp) + + def rows(self, rows, columns=None, timestamp=None, + include_timestamp=False): + """Retrieves multiple rows of data. + + This method retrieves the rows with the row keys specified in the + `rows` argument, which should be should be a list (or tuple) of row + keys. The return value is a list of `(row_key, data)` tuples. + + The `columns`, `timestamp` and `include_timestamp` arguments behave + exactly the same as for :py:meth:`row`. + + :param list rows: list of row keys + :param list_or_tuple columns: list of columns (optional) + :param int timestamp: timestamp (optional) + :param bool include_timestamp: whether timestamps are returned + """ + if columns is not None and not isinstance(columns, (tuple, list)): + raise TypeError("'columns' must be a tuple or list") + + if not rows: + # Avoid round-trip if the result is empty anyway + return {} + + if timestamp is None: + results = self.client.getRowsWithColumns(self.name, rows, columns) + else: + if not isinstance(timestamp, int): + raise TypeError("'timestamp' must be an integer") + + # Work-around a bug in the HBase Thrift server where the + # timestamp is only applied if columns are specified, at + # the cost of an extra round-trip. + if columns is None: + columns = self._column_family_names() + + results = self.client.getRowsWithColumnsTs(self.name, rows, + columns, timestamp) + + return [(r.row, _make_row(r.columns, include_timestamp)) + for r in results] + + def cells(self, row, column, versions=None, timestamp=None, + include_timestamp=False): + """Retrieves multiple versions of a single cell from the table. + + This method retrieves multiple versions of a cell (if any) and returns + the result as a list of dictionaries, each with `value` and `timestamp` + keys. The `versions` argument defines how many cell versions to + retrieve at most. The `timestamp` argument can be used to only return + cells with a version less than or equal to `timestamp`. + + :param str row: the row key + :param str column: the column name + :param int versions: the maximum number of versions to retrieve + :param int timestamp: timestamp (optional) + """ + if versions is None: + versions = (2 ** 31) - 1 # Thrift type is i32 + elif not isinstance(versions, int): + raise TypeError("'versions' parameter must be a number or None") + elif versions < 1: + raise ValueError("'versions' parameter must be at least 1 (or None)") + + if timestamp is None: + cells = self.client.getVer(self.name, row, column, versions) + else: + if not isinstance(timestamp, int): + raise TypeError("'timestamp' must be an integer") + cells = self.client.getVerTs(self.name, row, column, timestamp, + versions) + + if include_timestamp: + return map(make_cell_timestamp, cells) + else: + return map(make_cell, cells) + + def scan(self, row_start=None, row_stop=None, row_prefix=None, + columns=None, filter=None, timestamp=None, + include_timestamp=False, batch_size=1000, limit=None): + """Create a scanner for data in the table. + + This method returns an iterable that can be used for looping over the + matching rows. Scanners can be created in two ways: + + * The `row_start` and `row_stop` arguments specify the row keys where + the scanner should start and stop. It does not matter whether the + table contains any rows with the specified keys: the first row after + `row_start` will be the first result, and the last row before + `row_stop` will be the last result. Note that the start of the range + is inclusive, while the end is exclusive. + + Both `row_start` and `row_stop` can be `None` to specify the start + and the end of the table respectively. If both are omitted, a full + table scan is done. Note that this usually results in severe + performance problems. + + * Alternatively, if `row_prefix` is specified, only rows with row keys + matching the prefix will be returned. If given, `row_start` and + `row_stop` cannot be used. + + The `columns`, `timestamp` and `include_timestamp` arguments behave + exactly the same as for :py:meth:`row`. + + The `filter` argument may be a filter string that will be applied at + the server by the region servers. + + If `limit` is given, at most `limit` results will be returned. + + The `batch_size` argument specified how many results should be + retrieved per batch when retrieving results from the scanner. Only set + this to a low value (or even 1) if your data is large, since a low + batch size results in added round-trips to the server. + + :param str row_start: the row key to start at (inclusive) + :param str row_stop: the row key to stop at (exclusive) + :param str row_prefix: a prefix of the row key that must match + :param list_or_tuple columns: list of columns (optional) + :param str filter: a filter string (optional) + :param int timestamp: timestamp (optional) + :param bool include_timestamp: whether timestamps are returned + :param int batch_size: batch size for retrieving resuls + """ + if batch_size < 1: + raise ValueError("'batch_size' must be >= 1") + + if limit is not None and limit < 1: + raise ValueError("'limit' must be >= 1") + + if row_prefix is not None: + if row_start is not None or row_stop is not None: + raise TypeError("'row_prefix' cannot be combined with 'row_start' or 'row_stop'") + + # Account for Thrift API limitations. FIXME: perhaps + # a filter string can be used as a work-around? + if timestamp is not None: + raise NotImplementedError("prefix scans with 'timestamp' are unsupported") + + if filter is not None: + raise NotImplementedError("prefix scans with 'filter' are unsupported") + + scan_id = self.client.scannerOpenWithPrefix(self.name, row_prefix, + columns) + else: + # The scan's caching size is set to the batch_size, so that + # the HTable on the Java side retrieves rows from the region + # servers in the same chunk sizes that it sends out over + # Thrift. + scan = TScan(startRow=row_start, + stopRow=row_stop, + timestamp=timestamp, + columns=columns, + caching=batch_size, + filterString=filter) + scan_id = self.client.scannerOpenWithScan(self.name, scan) + + logger.debug("Opened scanner (id=%d) on '%s'", scan_id, self.name) + + n_results = 0 + try: + while True: + if limit is None: + how_many = batch_size + else: + how_many = min(batch_size, limit - n_results) + + if how_many == 1: + items = self.client.scannerGet(scan_id) + else: + items = self.client.scannerGetList(scan_id, how_many) + + for item in items: + n_results += 1 + yield item.row, _make_row(item.columns, include_timestamp) + if limit is not None and n_results == limit: + return + + # Avoid round-trip when exhausted + if len(items) < how_many: + break + finally: + self.client.scannerClose(scan_id) + logger.debug("Closed scanner (id=%d) on '%s'", scan_id, self.name) + + # + # Data manipulation + # + + def put(self, row, data, timestamp=None): + """Stores data in the table. + + This method stores the data in the `data` argument for the row + specified by `row`. The `data` argument is dictionary that maps columns + to values. Column names must include a family and qualifier part, e.g. + `cf:col`, though the qualifier part may be the empty string, e.g. + `cf:`. The `timestamp` argument is optional. + + Note that, in many situations, :py:meth:`batch()` is a more appropriate + method to manipulate data. + + :param str row: the row key + :param dict data: the data to store + :param int timestamp: timestamp (optional) + """ + with self.batch(timestamp=timestamp) as batch: + batch.put(row, data) + + def delete(self, row, columns=None, timestamp=None): + """Deletes data from the table. + + This method deletes all columns for the row specified by `row`, or only + some columns if the `columns` argument is specified. + + Note that, in many situations, :py:meth:`batch()` is a more appropriate + method to manipulate data. + + :param str row: the row key + :param list_or_tuple columns: list of columns (optional) + :param int timestamp: timestamp (optional) + """ + if columns is None: + if timestamp is None: + self.client.deleteAllRow(self.name, row) + else: + self.client.deleteAllRowTs(self.name, row, timestamp) + else: + with self.batch(timestamp=timestamp) as batch: + batch.delete(row, columns) + + def batch(self, timestamp=None, batch_size=None, transaction=False): + """Creates a new batch instance for this table. + + This method returns a new :py:class:`Batch` instance that can be used + for mass data manipulation. The `timestamp` argument applies to all + puts and deletes on the batch. + + If given, the `batch_size` argument specifies the maximum batch size + after which the batch should send the mutations to the server. By + default this is unbounded. + + The `transaction` argument specifies whether the returned + :py:class:`Batch` instance should act in a transaction-like manner when + used as context manager in a ``with`` block of code. The `transaction` + flag cannot be used in combination with `batch_size`. + + :param bool transaction: whether this batch should behave like + a transaction (only useful when used as a + context manager) + :param int timestamp: timestamp (optional) + """ + return Batch(self, timestamp, batch_size, transaction) + + # + # Atomic counters + # + + def counter_get(self, row, column): + """Retrieves the current value of a counter column. + + This method retrieves the current value of a counter column. If the + counter column does not exist, this function initialises it to `0`. + + Note that application code should *never* store a incremented or + decremented counter value directly; use the atomic + :py:meth:`Table.counter_inc` and :py:meth:`Table.counter_dec` methods + for that. + + :param str row: the row key + :param str column: the column name + """ + # Don't query directly, but increment with value=0 so that the counter + # is correctly initialised if didn't exist yet. + return self.counter_inc(row, column, value=0) + + def counter_set(self, row, column, value=0): + """Sets a counter column to a specific value. + + This method stores a 64-bit signed integer value in the specified + column. + + Note that application code should *never* store a incremented or + decremented counter value directly; use the atomic + :py:meth:`Table.counter_inc` and :py:meth:`Table.counter_dec` methods + for that. + + :param str row: the row key + :param str column: the column name + :param int value: the counter value to set + """ + self.put(row, {column: pack_i64(value)}) + + def counter_inc(self, row, column, value=1): + """Atomically increments (or decrements) a counter column. + + This method atomically increments or decrements a counter column in the + row specified by `row`. The `value` argument specifies how much the + counter should be incremented (for positive values) or decremented (for + negative values). If the counter column did not exist, it is + automatically initialised to 0 before incrementing it. + + :param str row: the row key + :param str column: the column name + :param int value: the amount to increment or decrement by (optional) + """ + return self.client.atomicIncrement(self.name, row, column, value) + + def counter_dec(self, row, column, value=1): + """Atomically decrements (or increments) a counter column. + + This method is a shortcut for calling :py:meth:`Table.counter_inc` with + the value negated. + """ + return self.counter_inc(row, column, -value) + + +class Batch: + """Batch mutation class. + + This class cannot be instantiated directly; use :py:meth:`Table.batch` + instead. + """ + def __init__(self, table, timestamp=None, batch_size=None, + transaction=False): + """Initialises a new Batch instance.""" + if not (timestamp is None or isinstance(timestamp, int)): + raise TypeError("'timestamp' must be an integer or None") + + if batch_size is not None: + if transaction: + raise TypeError("'transaction' can only be used when no 'batch_size' is specified") + if not batch_size > 0: + raise ValueError("'batch_size' must be >= 1") + + self.table = table + self.batch_size = batch_size + self.timestamp = timestamp + self.transaction = transaction + self._families = None + self._reset_mutations() + + def _reset_mutations(self): + self._mutations = defaultdict(list) + self._mutation_count = 0 + + def send(self): + """Sends the batch to the server.""" + bms = [BatchMutation(row, m) for row, m in self._mutations.iteritems()] + if not bms: + return + + logger.debug("Sending batch for '%s' (%d mutations on %d rows)", + self.table.name, self._mutation_count, len(bms)) + if self.timestamp is None: + self.table.client.mutateRows(self.table.name, bms) + else: + self.table.client.mutateRowsTs(self.table.name, bms, + self.timestamp) + + self._reset_mutations() + + # + # Mutation methods + # + + def put(self, row, data): + """Stores data in the table. + + See :py:meth:`Table.put` for a description of the `row` and `data` + arguments. + """ + self._mutations[row].extend( + Mutation(isDelete=False, column=column, value=value) + for column, value in data.iteritems()) + + self._mutation_count += len(data) + if self.batch_size and self._mutation_count >= self.batch_size: + self.send() + + def delete(self, row, columns=None): + """Deletes data from the table. + + See :py:meth:`Table.delete` for a description of the `row` and `data` + arguments. + """ + # Work-around Thrift API limitation: the mutation API can only + # delete specified columns, not complete rows, so just list the + # column families once and cache them for later use in the same + # transaction. + if columns is None: + if self._families is None: + self._families = self.table._column_family_names() + columns = self._families + + self._mutations[row].extend( + Mutation(isDelete=True, column=column) for column in columns) + + self._mutation_count += len(columns) + if self.batch_size and self._mutation_count >= self.batch_size: + self.send() + + # + # Context manager methods + # + + def __enter__(self): + """Called upon entering a ``with`` block""" + return self + + def __exit__(self, exc_type, exc_value, traceback): + """Called upon exiting a ``with`` block""" + if self.transaction and exc_type is not None: + return + + self.send() diff --git a/happybase/hbase/Hbase-remote b/happybase/hbase/Hbase-remote new file mode 100755 index 0000000..b283051 --- /dev/null +++ b/happybase/hbase/Hbase-remote @@ -0,0 +1,354 @@ +#!/usr/bin/env python +# +# Autogenerated by Thrift Compiler (0.8.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)' + print ' getVer(Text tableName, Text row, Text column, i32 numVersions)' + print ' getVerTs(Text tableName, Text row, Text column, i64 timestamp, i32 numVersions)' + print ' getRow(Text tableName, Text row)' + print ' getRowWithColumns(Text tableName, Text row, columns)' + print ' getRowTs(Text tableName, Text row, i64 timestamp)' + print ' getRowWithColumnsTs(Text tableName, Text row, columns, i64 timestamp)' + print ' getRows(Text tableName, rows)' + print ' getRowsWithColumns(Text tableName, rows, columns)' + print ' getRowsTs(Text tableName, rows, i64 timestamp)' + print ' getRowsWithColumnsTs(Text tableName, rows, columns, i64 timestamp)' + print ' void mutateRow(Text tableName, Text row, mutations)' + print ' void mutateRowTs(Text tableName, Text row, mutations, i64 timestamp)' + print ' void mutateRows(Text tableName, rowBatches)' + print ' void mutateRowsTs(Text tableName, rowBatches, i64 timestamp)' + print ' i64 atomicIncrement(Text tableName, Text row, Text column, i64 value)' + print ' void deleteAll(Text tableName, Text row, Text column)' + print ' void deleteAllTs(Text tableName, Text row, Text column, i64 timestamp)' + print ' void deleteAllRow(Text tableName, Text row)' + print ' void deleteAllRowTs(Text tableName, Text row, i64 timestamp)' + print ' ScannerID scannerOpenWithScan(Text tableName, TScan scan)' + print ' ScannerID scannerOpen(Text tableName, Text startRow, columns)' + print ' ScannerID scannerOpenWithStop(Text tableName, Text startRow, Text stopRow, columns)' + print ' ScannerID scannerOpenWithPrefix(Text tableName, Text startAndPrefix, columns)' + print ' ScannerID scannerOpenTs(Text tableName, Text startRow, columns, i64 timestamp)' + print ' ScannerID scannerOpenWithStopTs(Text tableName, Text startRow, Text stopRow, columns, i64 timestamp)' + print ' scannerGet(ScannerID id)' + print ' scannerGetList(ScannerID id, i32 nbRows)' + print ' void scannerClose(ScannerID id)' + 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) != 3: + print 'get requires 3 args' + sys.exit(1) + pp.pprint(client.get(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'getVer': + if len(args) != 4: + print 'getVer requires 4 args' + sys.exit(1) + pp.pprint(client.getVer(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + +elif cmd == 'getVerTs': + if len(args) != 5: + print 'getVerTs requires 5 args' + sys.exit(1) + pp.pprint(client.getVerTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) + +elif cmd == 'getRow': + if len(args) != 2: + print 'getRow requires 2 args' + sys.exit(1) + pp.pprint(client.getRow(eval(args[0]),eval(args[1]),)) + +elif cmd == 'getRowWithColumns': + if len(args) != 3: + print 'getRowWithColumns requires 3 args' + sys.exit(1) + pp.pprint(client.getRowWithColumns(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'getRowTs': + if len(args) != 3: + print 'getRowTs requires 3 args' + sys.exit(1) + pp.pprint(client.getRowTs(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'getRowWithColumnsTs': + if len(args) != 4: + print 'getRowWithColumnsTs requires 4 args' + sys.exit(1) + pp.pprint(client.getRowWithColumnsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + +elif cmd == 'getRows': + if len(args) != 2: + print 'getRows requires 2 args' + sys.exit(1) + pp.pprint(client.getRows(eval(args[0]),eval(args[1]),)) + +elif cmd == 'getRowsWithColumns': + if len(args) != 3: + print 'getRowsWithColumns requires 3 args' + sys.exit(1) + pp.pprint(client.getRowsWithColumns(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'getRowsTs': + if len(args) != 3: + print 'getRowsTs requires 3 args' + sys.exit(1) + pp.pprint(client.getRowsTs(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'getRowsWithColumnsTs': + if len(args) != 4: + print 'getRowsWithColumnsTs requires 4 args' + sys.exit(1) + pp.pprint(client.getRowsWithColumnsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + +elif cmd == 'mutateRow': + if len(args) != 3: + print 'mutateRow requires 3 args' + sys.exit(1) + pp.pprint(client.mutateRow(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'mutateRowTs': + if len(args) != 4: + print 'mutateRowTs requires 4 args' + sys.exit(1) + pp.pprint(client.mutateRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + +elif cmd == 'mutateRows': + if len(args) != 2: + print 'mutateRows requires 2 args' + sys.exit(1) + pp.pprint(client.mutateRows(eval(args[0]),eval(args[1]),)) + +elif cmd == 'mutateRowsTs': + if len(args) != 3: + print 'mutateRowsTs requires 3 args' + sys.exit(1) + pp.pprint(client.mutateRowsTs(eval(args[0]),eval(args[1]),eval(args[2]),)) + +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) != 3: + print 'deleteAll requires 3 args' + sys.exit(1) + pp.pprint(client.deleteAll(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'deleteAllTs': + if len(args) != 4: + print 'deleteAllTs requires 4 args' + sys.exit(1) + pp.pprint(client.deleteAllTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + +elif cmd == 'deleteAllRow': + if len(args) != 2: + print 'deleteAllRow requires 2 args' + sys.exit(1) + pp.pprint(client.deleteAllRow(eval(args[0]),eval(args[1]),)) + +elif cmd == 'deleteAllRowTs': + if len(args) != 3: + print 'deleteAllRowTs requires 3 args' + sys.exit(1) + pp.pprint(client.deleteAllRowTs(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'scannerOpenWithScan': + if len(args) != 2: + print 'scannerOpenWithScan requires 2 args' + sys.exit(1) + pp.pprint(client.scannerOpenWithScan(eval(args[0]),eval(args[1]),)) + +elif cmd == 'scannerOpen': + if len(args) != 3: + print 'scannerOpen requires 3 args' + sys.exit(1) + pp.pprint(client.scannerOpen(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'scannerOpenWithStop': + if len(args) != 4: + print 'scannerOpenWithStop requires 4 args' + sys.exit(1) + pp.pprint(client.scannerOpenWithStop(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + +elif cmd == 'scannerOpenWithPrefix': + if len(args) != 3: + print 'scannerOpenWithPrefix requires 3 args' + sys.exit(1) + pp.pprint(client.scannerOpenWithPrefix(eval(args[0]),eval(args[1]),eval(args[2]),)) + +elif cmd == 'scannerOpenTs': + if len(args) != 4: + print 'scannerOpenTs requires 4 args' + sys.exit(1) + pp.pprint(client.scannerOpenTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) + +elif cmd == 'scannerOpenWithStopTs': + if len(args) != 5: + print 'scannerOpenWithStopTs requires 5 args' + sys.exit(1) + pp.pprint(client.scannerOpenWithStopTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) + +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]),)) + +else: + print 'Unrecognized method %s' % cmd + sys.exit(1) + +transport.close() diff --git a/happybase/hbase/Hbase.py b/happybase/hbase/Hbase.py new file mode 100644 index 0000000..08a2ec9 --- /dev/null +++ b/happybase/hbase/Hbase.py @@ -0,0 +1,8865 @@ +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException +from ttypes import * +from thrift.Thrift import TProcessor +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + +class Iface: + def enableTable(self, tableName): + """ + Brings a table on-line (enables it) + + Parameters: + - tableName: name of the table + """ + pass + + def disableTable(self, tableName): + """ + Disables a table (takes it off-line) If it is being served, the master + will tell the servers to stop serving it. + + Parameters: + - tableName: name of the table + """ + pass + + def isTableEnabled(self, tableName): + """ + @return true if table is on-line + + Parameters: + - tableName: name of the table to check + """ + pass + + def compact(self, tableNameOrRegionName): + """ + Parameters: + - tableNameOrRegionName + """ + pass + + def majorCompact(self, tableNameOrRegionName): + """ + Parameters: + - tableNameOrRegionName + """ + pass + + def getTableNames(self, ): + """ + List all the userspace tables. + + @return returns a list of names + """ + pass + + def getColumnDescriptors(self, tableName): + """ + List all the column families assoicated with a table. + + @return list of column family descriptors + + Parameters: + - tableName: table name + """ + pass + + def getTableRegions(self, tableName): + """ + List the regions associated with a table. + + @return list of region descriptors + + Parameters: + - tableName: table name + """ + pass + + def createTable(self, tableName, columnFamilies): + """ + Create a table with the specified column families. The name + field for each ColumnDescriptor must be set and must end in a + colon (:). All other fields are optional and will get default + values if not explicitly specified. + + @throws IllegalArgument if an input parameter is invalid + + @throws AlreadyExists if the table name already exists + + Parameters: + - tableName: name of table to create + - columnFamilies: list of column family descriptors + """ + pass + + def deleteTable(self, tableName): + """ + Deletes a table + + @throws IOError if table doesn't exist on server or there was some other + problem + + Parameters: + - tableName: name of table to delete + """ + pass + + def get(self, tableName, row, column): + """ + Get a single TCell for the specified table, row, and column at the + latest timestamp. Returns an empty list if no such value exists. + + @return value for specified row/column + + Parameters: + - tableName: name of table + - row: row key + - column: column name + """ + pass + + def getVer(self, tableName, row, column, numVersions): + """ + Get the specified number of versions for the specified table, + row, and column. + + @return list of cells for specified row/column + + Parameters: + - tableName: name of table + - row: row key + - column: column name + - numVersions: number of versions to retrieve + """ + pass + + def getVerTs(self, tableName, row, column, timestamp, numVersions): + """ + Get the specified number of versions for the specified table, + row, and column. Only versions less than or equal to the specified + timestamp will be returned. + + @return list of cells for specified row/column + + Parameters: + - tableName: name of table + - row: row key + - column: column name + - timestamp: timestamp + - numVersions: number of versions to retrieve + """ + pass + + def getRow(self, tableName, row): + """ + Get all the data for the specified table and row at the latest + timestamp. Returns an empty list if the row does not exist. + + @return TRowResult containing the row and map of columns to TCells + + Parameters: + - tableName: name of table + - row: row key + """ + pass + + def getRowWithColumns(self, tableName, row, columns): + """ + Get the specified columns for the specified table and row at the latest + timestamp. Returns an empty list if the row does not exist. + + @return TRowResult containing the row and map of columns to TCells + + Parameters: + - tableName: name of table + - row: row key + - columns: List of columns to return, null for all columns + """ + pass + + def getRowTs(self, tableName, row, timestamp): + """ + Get all the data for the specified table and row at the specified + timestamp. Returns an empty list if the row does not exist. + + @return TRowResult containing the row and map of columns to TCells + + Parameters: + - tableName: name of the table + - row: row key + - timestamp: timestamp + """ + pass + + def getRowWithColumnsTs(self, tableName, row, columns, timestamp): + """ + Get the specified columns for the specified table and row at the specified + timestamp. Returns an empty list if the row does not exist. + + @return TRowResult containing the row and map of columns to TCells + + Parameters: + - tableName: name of table + - row: row key + - columns: List of columns to return, null for all columns + - timestamp + """ + pass + + def getRows(self, tableName, rows): + """ + Get all the data for the specified table and rows at the latest + timestamp. Returns an empty list if no rows exist. + + @return TRowResult containing the rows and map of columns to TCells + + Parameters: + - tableName: name of table + - rows: row keys + """ + pass + + def getRowsWithColumns(self, tableName, rows, columns): + """ + Get the specified columns for the specified table and rows at the latest + timestamp. Returns an empty list if no rows exist. + + @return TRowResult containing the rows and map of columns to TCells + + Parameters: + - tableName: name of table + - rows: row keys + - columns: List of columns to return, null for all columns + """ + pass + + def getRowsTs(self, tableName, rows, timestamp): + """ + Get all the data for the specified table and rows at the specified + timestamp. Returns an empty list if no rows exist. + + @return TRowResult containing the rows and map of columns to TCells + + Parameters: + - tableName: name of the table + - rows: row keys + - timestamp: timestamp + """ + pass + + def getRowsWithColumnsTs(self, tableName, rows, columns, timestamp): + """ + Get the specified columns for the specified table and rows at the specified + timestamp. Returns an empty list if no rows exist. + + @return TRowResult containing the rows and map of columns to TCells + + Parameters: + - tableName: name of table + - rows: row keys + - columns: List of columns to return, null for all columns + - timestamp + """ + pass + + def mutateRow(self, tableName, row, mutations): + """ + Apply a series of mutations (updates/deletes) to a row in a + single transaction. If an exception is thrown, then the + transaction is aborted. Default current timestamp is used, and + all entries will have an identical timestamp. + + Parameters: + - tableName: name of table + - row: row key + - mutations: list of mutation commands + """ + pass + + def mutateRowTs(self, tableName, row, mutations, timestamp): + """ + Apply a series of mutations (updates/deletes) to a row in a + single transaction. If an exception is thrown, then the + transaction is aborted. The specified timestamp is used, and + all entries will have an identical timestamp. + + Parameters: + - tableName: name of table + - row: row key + - mutations: list of mutation commands + - timestamp: timestamp + """ + pass + + def mutateRows(self, tableName, rowBatches): + """ + Apply a series of batches (each a series of mutations on a single row) + in a single transaction. If an exception is thrown, then the + transaction is aborted. Default current timestamp is used, and + all entries will have an identical timestamp. + + Parameters: + - tableName: name of table + - rowBatches: list of row batches + """ + pass + + def mutateRowsTs(self, tableName, rowBatches, timestamp): + """ + Apply a series of batches (each a series of mutations on a single row) + in a single transaction. If an exception is thrown, then the + transaction is aborted. The specified timestamp is used, and + all entries will have an identical timestamp. + + Parameters: + - tableName: name of table + - rowBatches: list of row batches + - timestamp: timestamp + """ + pass + + def atomicIncrement(self, tableName, row, column, value): + """ + Atomically increment the column value specified. Returns the next value post increment. + + Parameters: + - tableName: name of table + - row: row to increment + - column: name of column + - value: amount to increment by + """ + pass + + def deleteAll(self, tableName, row, column): + """ + Delete all cells that match the passed row and column. + + Parameters: + - tableName: name of table + - row: Row to update + - column: name of column whose value is to be deleted + """ + pass + + def deleteAllTs(self, tableName, row, column, timestamp): + """ + Delete all cells that match the passed row and column and whose + timestamp is equal-to or older than the passed timestamp. + + Parameters: + - tableName: name of table + - row: Row to update + - column: name of column whose value is to be deleted + - timestamp: timestamp + """ + pass + + def deleteAllRow(self, tableName, row): + """ + Completely delete the row's cells. + + Parameters: + - tableName: name of table + - row: key of the row to be completely deleted. + """ + pass + + def deleteAllRowTs(self, tableName, row, timestamp): + """ + Completely delete the row's cells marked with a timestamp + equal-to or older than the passed timestamp. + + Parameters: + - tableName: name of table + - row: key of the row to be completely deleted. + - timestamp: timestamp + """ + pass + + def scannerOpenWithScan(self, tableName, scan): + """ + Get a scanner on the current table, using the Scan instance + for the scan parameters. + + Parameters: + - tableName: name of table + - scan: Scan instance + """ + pass + + def scannerOpen(self, tableName, startRow, columns): + """ + Get a scanner on the current table starting at the specified row and + ending at the last row in the table. Return the specified columns. + + @return scanner id to be used with other scanner procedures + + Parameters: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + """ + pass + + def scannerOpenWithStop(self, tableName, startRow, stopRow, columns): + """ + Get a scanner on the current table starting and stopping at the + specified rows. ending at the last row in the table. Return the + specified columns. + + @return scanner id to be used with other scanner procedures + + Parameters: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - stopRow: row to stop scanning on. This row is *not* included in the + scanner's results + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + """ + pass + + def scannerOpenWithPrefix(self, tableName, startAndPrefix, columns): + """ + Open a scanner for a given prefix. That is all rows will have the specified + prefix. No other rows will be returned. + + @return scanner id to use with other scanner calls + + Parameters: + - tableName: name of table + - startAndPrefix: the prefix (and thus start row) of the keys you want + - columns: the columns you want returned + """ + pass + + def scannerOpenTs(self, tableName, startRow, columns, timestamp): + """ + Get a scanner on the current table starting at the specified row and + ending at the last row in the table. Return the specified columns. + Only values with the specified timestamp are returned. + + @return scanner id to be used with other scanner procedures + + Parameters: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + - timestamp: timestamp + """ + pass + + def scannerOpenWithStopTs(self, tableName, startRow, stopRow, columns, timestamp): + """ + Get a scanner on the current table starting and stopping at the + specified rows. ending at the last row in the table. Return the + specified columns. Only values with the specified timestamp are + returned. + + @return scanner id to be used with other scanner procedures + + Parameters: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - stopRow: row to stop scanning on. This row is *not* included in the + scanner's results + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + - timestamp: timestamp + """ + pass + + def scannerGet(self, id): + """ + Returns the scanner's current row value and advances to the next + row in the table. When there are no more rows in the table, or a key + greater-than-or-equal-to the scanner's specified stopRow is reached, + an empty list is returned. + + @return a TRowResult containing the current row and a map of the columns to TCells. + + @throws IllegalArgument if ScannerID is invalid + + @throws NotFound when the scanner reaches the end + + Parameters: + - id: id of a scanner returned by scannerOpen + """ + pass + + def scannerGetList(self, id, nbRows): + """ + Returns, starting at the scanner's current row value nbRows worth of + rows and advances to the next row in the table. When there are no more + rows in the table, or a key greater-than-or-equal-to the scanner's + specified stopRow is reached, an empty list is returned. + + @return a TRowResult containing the current row and a map of the columns to TCells. + + @throws IllegalArgument if ScannerID is invalid + + @throws NotFound when the scanner reaches the end + + Parameters: + - id: id of a scanner returned by scannerOpen + - nbRows: number of results to return + """ + pass + + def scannerClose(self, id): + """ + Closes the server-state associated with an open scanner. + + @throws IllegalArgument if ScannerID is invalid + + Parameters: + - id: id of a scanner returned by scannerOpen + """ + pass + + +class Client(Iface): + def __init__(self, iprot, oprot=None): + self._iprot = self._oprot = iprot + if oprot is not None: + self._oprot = oprot + self._seqid = 0 + + def enableTable(self, tableName): + """ + Brings a table on-line (enables it) + + Parameters: + - tableName: name of the table + """ + self.send_enableTable(tableName) + self.recv_enableTable() + + def send_enableTable(self, tableName): + self._oprot.writeMessageBegin('enableTable', TMessageType.CALL, self._seqid) + args = enableTable_args() + args.tableName = tableName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_enableTable(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = enableTable_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def disableTable(self, tableName): + """ + Disables a table (takes it off-line) If it is being served, the master + will tell the servers to stop serving it. + + Parameters: + - tableName: name of the table + """ + self.send_disableTable(tableName) + self.recv_disableTable() + + def send_disableTable(self, tableName): + self._oprot.writeMessageBegin('disableTable', TMessageType.CALL, self._seqid) + args = disableTable_args() + args.tableName = tableName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_disableTable(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = disableTable_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def isTableEnabled(self, tableName): + """ + @return true if table is on-line + + Parameters: + - tableName: name of the table to check + """ + self.send_isTableEnabled(tableName) + return self.recv_isTableEnabled() + + def send_isTableEnabled(self, tableName): + self._oprot.writeMessageBegin('isTableEnabled', TMessageType.CALL, self._seqid) + args = isTableEnabled_args() + args.tableName = tableName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_isTableEnabled(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = isTableEnabled_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "isTableEnabled failed: unknown result"); + + def compact(self, tableNameOrRegionName): + """ + Parameters: + - tableNameOrRegionName + """ + self.send_compact(tableNameOrRegionName) + self.recv_compact() + + def send_compact(self, tableNameOrRegionName): + self._oprot.writeMessageBegin('compact', TMessageType.CALL, self._seqid) + args = compact_args() + args.tableNameOrRegionName = tableNameOrRegionName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_compact(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = compact_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def majorCompact(self, tableNameOrRegionName): + """ + Parameters: + - tableNameOrRegionName + """ + self.send_majorCompact(tableNameOrRegionName) + self.recv_majorCompact() + + def send_majorCompact(self, tableNameOrRegionName): + self._oprot.writeMessageBegin('majorCompact', TMessageType.CALL, self._seqid) + args = majorCompact_args() + args.tableNameOrRegionName = tableNameOrRegionName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_majorCompact(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = majorCompact_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def getTableNames(self, ): + """ + List all the userspace tables. + + @return returns a list of names + """ + self.send_getTableNames() + return self.recv_getTableNames() + + def send_getTableNames(self, ): + self._oprot.writeMessageBegin('getTableNames', TMessageType.CALL, self._seqid) + args = getTableNames_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getTableNames(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getTableNames_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTableNames failed: unknown result"); + + def getColumnDescriptors(self, tableName): + """ + List all the column families assoicated with a table. + + @return list of column family descriptors + + Parameters: + - tableName: table name + """ + self.send_getColumnDescriptors(tableName) + return self.recv_getColumnDescriptors() + + def send_getColumnDescriptors(self, tableName): + self._oprot.writeMessageBegin('getColumnDescriptors', TMessageType.CALL, self._seqid) + args = getColumnDescriptors_args() + args.tableName = tableName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getColumnDescriptors(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getColumnDescriptors_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getColumnDescriptors failed: unknown result"); + + def getTableRegions(self, tableName): + """ + List the regions associated with a table. + + @return list of region descriptors + + Parameters: + - tableName: table name + """ + self.send_getTableRegions(tableName) + return self.recv_getTableRegions() + + def send_getTableRegions(self, tableName): + self._oprot.writeMessageBegin('getTableRegions', TMessageType.CALL, self._seqid) + args = getTableRegions_args() + args.tableName = tableName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getTableRegions(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getTableRegions_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTableRegions failed: unknown result"); + + def createTable(self, tableName, columnFamilies): + """ + Create a table with the specified column families. The name + field for each ColumnDescriptor must be set and must end in a + colon (:). All other fields are optional and will get default + values if not explicitly specified. + + @throws IllegalArgument if an input parameter is invalid + + @throws AlreadyExists if the table name already exists + + Parameters: + - tableName: name of table to create + - columnFamilies: list of column family descriptors + """ + self.send_createTable(tableName, columnFamilies) + self.recv_createTable() + + def send_createTable(self, tableName, columnFamilies): + self._oprot.writeMessageBegin('createTable', TMessageType.CALL, self._seqid) + args = createTable_args() + args.tableName = tableName + args.columnFamilies = columnFamilies + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_createTable(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = createTable_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + if result.exist is not None: + raise result.exist + return + + def deleteTable(self, tableName): + """ + Deletes a table + + @throws IOError if table doesn't exist on server or there was some other + problem + + Parameters: + - tableName: name of table to delete + """ + self.send_deleteTable(tableName) + self.recv_deleteTable() + + def send_deleteTable(self, tableName): + self._oprot.writeMessageBegin('deleteTable', TMessageType.CALL, self._seqid) + args = deleteTable_args() + args.tableName = tableName + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_deleteTable(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = deleteTable_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def get(self, tableName, row, column): + """ + Get a single TCell for the specified table, row, and column at the + latest timestamp. Returns an empty list if no such value exists. + + @return value for specified row/column + + Parameters: + - tableName: name of table + - row: row key + - column: column name + """ + self.send_get(tableName, row, column) + return self.recv_get() + + def send_get(self, tableName, row, column): + self._oprot.writeMessageBegin('get', TMessageType.CALL, self._seqid) + args = get_args() + args.tableName = tableName + args.row = row + args.column = column + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "get failed: unknown result"); + + def getVer(self, tableName, row, column, numVersions): + """ + Get the specified number of versions for the specified table, + row, and column. + + @return list of cells for specified row/column + + Parameters: + - tableName: name of table + - row: row key + - column: column name + - numVersions: number of versions to retrieve + """ + self.send_getVer(tableName, row, column, numVersions) + return self.recv_getVer() + + def send_getVer(self, tableName, row, column, numVersions): + self._oprot.writeMessageBegin('getVer', TMessageType.CALL, self._seqid) + args = getVer_args() + args.tableName = tableName + args.row = row + args.column = column + args.numVersions = numVersions + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getVer(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getVer_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getVer failed: unknown result"); + + def getVerTs(self, tableName, row, column, timestamp, numVersions): + """ + Get the specified number of versions for the specified table, + row, and column. Only versions less than or equal to the specified + timestamp will be returned. + + @return list of cells for specified row/column + + Parameters: + - tableName: name of table + - row: row key + - column: column name + - timestamp: timestamp + - numVersions: number of versions to retrieve + """ + self.send_getVerTs(tableName, row, column, timestamp, numVersions) + return self.recv_getVerTs() + + def send_getVerTs(self, tableName, row, column, timestamp, numVersions): + self._oprot.writeMessageBegin('getVerTs', TMessageType.CALL, self._seqid) + args = getVerTs_args() + args.tableName = tableName + args.row = row + args.column = column + args.timestamp = timestamp + args.numVersions = numVersions + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getVerTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getVerTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getVerTs failed: unknown result"); + + def getRow(self, tableName, row): + """ + Get all the data for the specified table and row at the latest + timestamp. Returns an empty list if the row does not exist. + + @return TRowResult containing the row and map of columns to TCells + + Parameters: + - tableName: name of table + - row: row key + """ + self.send_getRow(tableName, row) + return self.recv_getRow() + + def send_getRow(self, tableName, row): + self._oprot.writeMessageBegin('getRow', TMessageType.CALL, self._seqid) + args = getRow_args() + args.tableName = tableName + args.row = row + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRow(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getRow_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRow failed: unknown result"); + + def getRowWithColumns(self, tableName, row, columns): + """ + Get the specified columns for the specified table and row at the latest + timestamp. Returns an empty list if the row does not exist. + + @return TRowResult containing the row and map of columns to TCells + + Parameters: + - tableName: name of table + - row: row key + - columns: List of columns to return, null for all columns + """ + self.send_getRowWithColumns(tableName, row, columns) + return self.recv_getRowWithColumns() + + def send_getRowWithColumns(self, tableName, row, columns): + self._oprot.writeMessageBegin('getRowWithColumns', TMessageType.CALL, self._seqid) + args = getRowWithColumns_args() + args.tableName = tableName + args.row = row + args.columns = columns + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRowWithColumns(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getRowWithColumns_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowWithColumns failed: unknown result"); + + def getRowTs(self, tableName, row, timestamp): + """ + Get all the data for the specified table and row at the specified + timestamp. Returns an empty list if the row does not exist. + + @return TRowResult containing the row and map of columns to TCells + + Parameters: + - tableName: name of the table + - row: row key + - timestamp: timestamp + """ + self.send_getRowTs(tableName, row, timestamp) + return self.recv_getRowTs() + + def send_getRowTs(self, tableName, row, timestamp): + self._oprot.writeMessageBegin('getRowTs', TMessageType.CALL, self._seqid) + args = getRowTs_args() + args.tableName = tableName + args.row = row + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRowTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getRowTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowTs failed: unknown result"); + + def getRowWithColumnsTs(self, tableName, row, columns, timestamp): + """ + Get the specified columns for the specified table and row at the specified + timestamp. Returns an empty list if the row does not exist. + + @return TRowResult containing the row and map of columns to TCells + + Parameters: + - tableName: name of table + - row: row key + - columns: List of columns to return, null for all columns + - timestamp + """ + self.send_getRowWithColumnsTs(tableName, row, columns, timestamp) + return self.recv_getRowWithColumnsTs() + + def send_getRowWithColumnsTs(self, tableName, row, columns, timestamp): + self._oprot.writeMessageBegin('getRowWithColumnsTs', TMessageType.CALL, self._seqid) + args = getRowWithColumnsTs_args() + args.tableName = tableName + args.row = row + args.columns = columns + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRowWithColumnsTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getRowWithColumnsTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowWithColumnsTs failed: unknown result"); + + def getRows(self, tableName, rows): + """ + Get all the data for the specified table and rows at the latest + timestamp. Returns an empty list if no rows exist. + + @return TRowResult containing the rows and map of columns to TCells + + Parameters: + - tableName: name of table + - rows: row keys + """ + self.send_getRows(tableName, rows) + return self.recv_getRows() + + def send_getRows(self, tableName, rows): + self._oprot.writeMessageBegin('getRows', TMessageType.CALL, self._seqid) + args = getRows_args() + args.tableName = tableName + args.rows = rows + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRows(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getRows_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRows failed: unknown result"); + + def getRowsWithColumns(self, tableName, rows, columns): + """ + Get the specified columns for the specified table and rows at the latest + timestamp. Returns an empty list if no rows exist. + + @return TRowResult containing the rows and map of columns to TCells + + Parameters: + - tableName: name of table + - rows: row keys + - columns: List of columns to return, null for all columns + """ + self.send_getRowsWithColumns(tableName, rows, columns) + return self.recv_getRowsWithColumns() + + def send_getRowsWithColumns(self, tableName, rows, columns): + self._oprot.writeMessageBegin('getRowsWithColumns', TMessageType.CALL, self._seqid) + args = getRowsWithColumns_args() + args.tableName = tableName + args.rows = rows + args.columns = columns + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRowsWithColumns(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getRowsWithColumns_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowsWithColumns failed: unknown result"); + + def getRowsTs(self, tableName, rows, timestamp): + """ + Get all the data for the specified table and rows at the specified + timestamp. Returns an empty list if no rows exist. + + @return TRowResult containing the rows and map of columns to TCells + + Parameters: + - tableName: name of the table + - rows: row keys + - timestamp: timestamp + """ + self.send_getRowsTs(tableName, rows, timestamp) + return self.recv_getRowsTs() + + def send_getRowsTs(self, tableName, rows, timestamp): + self._oprot.writeMessageBegin('getRowsTs', TMessageType.CALL, self._seqid) + args = getRowsTs_args() + args.tableName = tableName + args.rows = rows + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRowsTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getRowsTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowsTs failed: unknown result"); + + def getRowsWithColumnsTs(self, tableName, rows, columns, timestamp): + """ + Get the specified columns for the specified table and rows at the specified + timestamp. Returns an empty list if no rows exist. + + @return TRowResult containing the rows and map of columns to TCells + + Parameters: + - tableName: name of table + - rows: row keys + - columns: List of columns to return, null for all columns + - timestamp + """ + self.send_getRowsWithColumnsTs(tableName, rows, columns, timestamp) + return self.recv_getRowsWithColumnsTs() + + def send_getRowsWithColumnsTs(self, tableName, rows, columns, timestamp): + self._oprot.writeMessageBegin('getRowsWithColumnsTs', TMessageType.CALL, self._seqid) + args = getRowsWithColumnsTs_args() + args.tableName = tableName + args.rows = rows + args.columns = columns + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRowsWithColumnsTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = getRowsWithColumnsTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowsWithColumnsTs failed: unknown result"); + + def mutateRow(self, tableName, row, mutations): + """ + Apply a series of mutations (updates/deletes) to a row in a + single transaction. If an exception is thrown, then the + transaction is aborted. Default current timestamp is used, and + all entries will have an identical timestamp. + + Parameters: + - tableName: name of table + - row: row key + - mutations: list of mutation commands + """ + self.send_mutateRow(tableName, row, mutations) + self.recv_mutateRow() + + def send_mutateRow(self, tableName, row, mutations): + self._oprot.writeMessageBegin('mutateRow', TMessageType.CALL, self._seqid) + args = mutateRow_args() + args.tableName = tableName + args.row = row + args.mutations = mutations + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_mutateRow(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = mutateRow_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + return + + def mutateRowTs(self, tableName, row, mutations, timestamp): + """ + Apply a series of mutations (updates/deletes) to a row in a + single transaction. If an exception is thrown, then the + transaction is aborted. The specified timestamp is used, and + all entries will have an identical timestamp. + + Parameters: + - tableName: name of table + - row: row key + - mutations: list of mutation commands + - timestamp: timestamp + """ + self.send_mutateRowTs(tableName, row, mutations, timestamp) + self.recv_mutateRowTs() + + def send_mutateRowTs(self, tableName, row, mutations, timestamp): + self._oprot.writeMessageBegin('mutateRowTs', TMessageType.CALL, self._seqid) + args = mutateRowTs_args() + args.tableName = tableName + args.row = row + args.mutations = mutations + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_mutateRowTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = mutateRowTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + return + + def mutateRows(self, tableName, rowBatches): + """ + Apply a series of batches (each a series of mutations on a single row) + in a single transaction. If an exception is thrown, then the + transaction is aborted. Default current timestamp is used, and + all entries will have an identical timestamp. + + Parameters: + - tableName: name of table + - rowBatches: list of row batches + """ + self.send_mutateRows(tableName, rowBatches) + self.recv_mutateRows() + + def send_mutateRows(self, tableName, rowBatches): + self._oprot.writeMessageBegin('mutateRows', TMessageType.CALL, self._seqid) + args = mutateRows_args() + args.tableName = tableName + args.rowBatches = rowBatches + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_mutateRows(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = mutateRows_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + return + + def mutateRowsTs(self, tableName, rowBatches, timestamp): + """ + Apply a series of batches (each a series of mutations on a single row) + in a single transaction. If an exception is thrown, then the + transaction is aborted. The specified timestamp is used, and + all entries will have an identical timestamp. + + Parameters: + - tableName: name of table + - rowBatches: list of row batches + - timestamp: timestamp + """ + self.send_mutateRowsTs(tableName, rowBatches, timestamp) + self.recv_mutateRowsTs() + + def send_mutateRowsTs(self, tableName, rowBatches, timestamp): + self._oprot.writeMessageBegin('mutateRowsTs', TMessageType.CALL, self._seqid) + args = mutateRowsTs_args() + args.tableName = tableName + args.rowBatches = rowBatches + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_mutateRowsTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = mutateRowsTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + return + + def atomicIncrement(self, tableName, row, column, value): + """ + Atomically increment the column value specified. Returns the next value post increment. + + Parameters: + - tableName: name of table + - row: row to increment + - column: name of column + - value: amount to increment by + """ + self.send_atomicIncrement(tableName, row, column, value) + return self.recv_atomicIncrement() + + def send_atomicIncrement(self, tableName, row, column, value): + self._oprot.writeMessageBegin('atomicIncrement', TMessageType.CALL, self._seqid) + args = atomicIncrement_args() + args.tableName = tableName + args.row = row + args.column = column + args.value = value + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_atomicIncrement(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = atomicIncrement_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + raise TApplicationException(TApplicationException.MISSING_RESULT, "atomicIncrement failed: unknown result"); + + def deleteAll(self, tableName, row, column): + """ + Delete all cells that match the passed row and column. + + Parameters: + - tableName: name of table + - row: Row to update + - column: name of column whose value is to be deleted + """ + self.send_deleteAll(tableName, row, column) + self.recv_deleteAll() + + def send_deleteAll(self, tableName, row, column): + self._oprot.writeMessageBegin('deleteAll', TMessageType.CALL, self._seqid) + args = deleteAll_args() + args.tableName = tableName + args.row = row + args.column = column + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_deleteAll(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = deleteAll_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def deleteAllTs(self, tableName, row, column, timestamp): + """ + Delete all cells that match the passed row and column and whose + timestamp is equal-to or older than the passed timestamp. + + Parameters: + - tableName: name of table + - row: Row to update + - column: name of column whose value is to be deleted + - timestamp: timestamp + """ + self.send_deleteAllTs(tableName, row, column, timestamp) + self.recv_deleteAllTs() + + def send_deleteAllTs(self, tableName, row, column, timestamp): + self._oprot.writeMessageBegin('deleteAllTs', TMessageType.CALL, self._seqid) + args = deleteAllTs_args() + args.tableName = tableName + args.row = row + args.column = column + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_deleteAllTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = deleteAllTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def deleteAllRow(self, tableName, row): + """ + Completely delete the row's cells. + + Parameters: + - tableName: name of table + - row: key of the row to be completely deleted. + """ + self.send_deleteAllRow(tableName, row) + self.recv_deleteAllRow() + + def send_deleteAllRow(self, tableName, row): + self._oprot.writeMessageBegin('deleteAllRow', TMessageType.CALL, self._seqid) + args = deleteAllRow_args() + args.tableName = tableName + args.row = row + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_deleteAllRow(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = deleteAllRow_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def deleteAllRowTs(self, tableName, row, timestamp): + """ + Completely delete the row's cells marked with a timestamp + equal-to or older than the passed timestamp. + + Parameters: + - tableName: name of table + - row: key of the row to be completely deleted. + - timestamp: timestamp + """ + self.send_deleteAllRowTs(tableName, row, timestamp) + self.recv_deleteAllRowTs() + + def send_deleteAllRowTs(self, tableName, row, timestamp): + self._oprot.writeMessageBegin('deleteAllRowTs', TMessageType.CALL, self._seqid) + args = deleteAllRowTs_args() + args.tableName = tableName + args.row = row + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_deleteAllRowTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = deleteAllRowTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def scannerOpenWithScan(self, tableName, scan): + """ + Get a scanner on the current table, using the Scan instance + for the scan parameters. + + Parameters: + - tableName: name of table + - scan: Scan instance + """ + self.send_scannerOpenWithScan(tableName, scan) + return self.recv_scannerOpenWithScan() + + def send_scannerOpenWithScan(self, tableName, scan): + self._oprot.writeMessageBegin('scannerOpenWithScan', TMessageType.CALL, self._seqid) + args = scannerOpenWithScan_args() + args.tableName = tableName + args.scan = scan + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerOpenWithScan(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerOpenWithScan_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithScan failed: unknown result"); + + def scannerOpen(self, tableName, startRow, columns): + """ + Get a scanner on the current table starting at the specified row and + ending at the last row in the table. Return the specified columns. + + @return scanner id to be used with other scanner procedures + + Parameters: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + """ + self.send_scannerOpen(tableName, startRow, columns) + return self.recv_scannerOpen() + + def send_scannerOpen(self, tableName, startRow, columns): + self._oprot.writeMessageBegin('scannerOpen', TMessageType.CALL, self._seqid) + args = scannerOpen_args() + args.tableName = tableName + args.startRow = startRow + args.columns = columns + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerOpen(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerOpen_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpen failed: unknown result"); + + def scannerOpenWithStop(self, tableName, startRow, stopRow, columns): + """ + Get a scanner on the current table starting and stopping at the + specified rows. ending at the last row in the table. Return the + specified columns. + + @return scanner id to be used with other scanner procedures + + Parameters: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - stopRow: row to stop scanning on. This row is *not* included in the + scanner's results + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + """ + self.send_scannerOpenWithStop(tableName, startRow, stopRow, columns) + return self.recv_scannerOpenWithStop() + + def send_scannerOpenWithStop(self, tableName, startRow, stopRow, columns): + self._oprot.writeMessageBegin('scannerOpenWithStop', TMessageType.CALL, self._seqid) + args = scannerOpenWithStop_args() + args.tableName = tableName + args.startRow = startRow + args.stopRow = stopRow + args.columns = columns + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerOpenWithStop(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerOpenWithStop_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithStop failed: unknown result"); + + def scannerOpenWithPrefix(self, tableName, startAndPrefix, columns): + """ + Open a scanner for a given prefix. That is all rows will have the specified + prefix. No other rows will be returned. + + @return scanner id to use with other scanner calls + + Parameters: + - tableName: name of table + - startAndPrefix: the prefix (and thus start row) of the keys you want + - columns: the columns you want returned + """ + self.send_scannerOpenWithPrefix(tableName, startAndPrefix, columns) + return self.recv_scannerOpenWithPrefix() + + def send_scannerOpenWithPrefix(self, tableName, startAndPrefix, columns): + self._oprot.writeMessageBegin('scannerOpenWithPrefix', TMessageType.CALL, self._seqid) + args = scannerOpenWithPrefix_args() + args.tableName = tableName + args.startAndPrefix = startAndPrefix + args.columns = columns + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerOpenWithPrefix(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerOpenWithPrefix_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithPrefix failed: unknown result"); + + def scannerOpenTs(self, tableName, startRow, columns, timestamp): + """ + Get a scanner on the current table starting at the specified row and + ending at the last row in the table. Return the specified columns. + Only values with the specified timestamp are returned. + + @return scanner id to be used with other scanner procedures + + Parameters: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + - timestamp: timestamp + """ + self.send_scannerOpenTs(tableName, startRow, columns, timestamp) + return self.recv_scannerOpenTs() + + def send_scannerOpenTs(self, tableName, startRow, columns, timestamp): + self._oprot.writeMessageBegin('scannerOpenTs', TMessageType.CALL, self._seqid) + args = scannerOpenTs_args() + args.tableName = tableName + args.startRow = startRow + args.columns = columns + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerOpenTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerOpenTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenTs failed: unknown result"); + + def scannerOpenWithStopTs(self, tableName, startRow, stopRow, columns, timestamp): + """ + Get a scanner on the current table starting and stopping at the + specified rows. ending at the last row in the table. Return the + specified columns. Only values with the specified timestamp are + returned. + + @return scanner id to be used with other scanner procedures + + Parameters: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - stopRow: row to stop scanning on. This row is *not* included in the + scanner's results + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + - timestamp: timestamp + """ + self.send_scannerOpenWithStopTs(tableName, startRow, stopRow, columns, timestamp) + return self.recv_scannerOpenWithStopTs() + + def send_scannerOpenWithStopTs(self, tableName, startRow, stopRow, columns, timestamp): + self._oprot.writeMessageBegin('scannerOpenWithStopTs', TMessageType.CALL, self._seqid) + args = scannerOpenWithStopTs_args() + args.tableName = tableName + args.startRow = startRow + args.stopRow = stopRow + args.columns = columns + args.timestamp = timestamp + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerOpenWithStopTs(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerOpenWithStopTs_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithStopTs failed: unknown result"); + + def scannerGet(self, id): + """ + Returns the scanner's current row value and advances to the next + row in the table. When there are no more rows in the table, or a key + greater-than-or-equal-to the scanner's specified stopRow is reached, + an empty list is returned. + + @return a TRowResult containing the current row and a map of the columns to TCells. + + @throws IllegalArgument if ScannerID is invalid + + @throws NotFound when the scanner reaches the end + + Parameters: + - id: id of a scanner returned by scannerOpen + """ + self.send_scannerGet(id) + return self.recv_scannerGet() + + def send_scannerGet(self, id): + self._oprot.writeMessageBegin('scannerGet', TMessageType.CALL, self._seqid) + args = scannerGet_args() + args.id = id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerGet(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerGet_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerGet failed: unknown result"); + + def scannerGetList(self, id, nbRows): + """ + Returns, starting at the scanner's current row value nbRows worth of + rows and advances to the next row in the table. When there are no more + rows in the table, or a key greater-than-or-equal-to the scanner's + specified stopRow is reached, an empty list is returned. + + @return a TRowResult containing the current row and a map of the columns to TCells. + + @throws IllegalArgument if ScannerID is invalid + + @throws NotFound when the scanner reaches the end + + Parameters: + - id: id of a scanner returned by scannerOpen + - nbRows: number of results to return + """ + self.send_scannerGetList(id, nbRows) + return self.recv_scannerGetList() + + def send_scannerGetList(self, id, nbRows): + self._oprot.writeMessageBegin('scannerGetList', TMessageType.CALL, self._seqid) + args = scannerGetList_args() + args.id = id + args.nbRows = nbRows + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerGetList(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerGetList_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerGetList failed: unknown result"); + + def scannerClose(self, id): + """ + Closes the server-state associated with an open scanner. + + @throws IllegalArgument if ScannerID is invalid + + Parameters: + - id: id of a scanner returned by scannerOpen + """ + self.send_scannerClose(id) + self.recv_scannerClose() + + def send_scannerClose(self, id): + self._oprot.writeMessageBegin('scannerClose', TMessageType.CALL, self._seqid) + args = scannerClose_args() + args.id = id + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_scannerClose(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = scannerClose_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.io is not None: + raise result.io + if result.ia is not None: + raise result.ia + return + + +class Processor(Iface, TProcessor): + def __init__(self, handler): + self._handler = handler + self._processMap = {} + self._processMap["enableTable"] = Processor.process_enableTable + self._processMap["disableTable"] = Processor.process_disableTable + self._processMap["isTableEnabled"] = Processor.process_isTableEnabled + self._processMap["compact"] = Processor.process_compact + self._processMap["majorCompact"] = Processor.process_majorCompact + self._processMap["getTableNames"] = Processor.process_getTableNames + self._processMap["getColumnDescriptors"] = Processor.process_getColumnDescriptors + self._processMap["getTableRegions"] = Processor.process_getTableRegions + self._processMap["createTable"] = Processor.process_createTable + self._processMap["deleteTable"] = Processor.process_deleteTable + self._processMap["get"] = Processor.process_get + self._processMap["getVer"] = Processor.process_getVer + self._processMap["getVerTs"] = Processor.process_getVerTs + self._processMap["getRow"] = Processor.process_getRow + self._processMap["getRowWithColumns"] = Processor.process_getRowWithColumns + self._processMap["getRowTs"] = Processor.process_getRowTs + self._processMap["getRowWithColumnsTs"] = Processor.process_getRowWithColumnsTs + self._processMap["getRows"] = Processor.process_getRows + self._processMap["getRowsWithColumns"] = Processor.process_getRowsWithColumns + self._processMap["getRowsTs"] = Processor.process_getRowsTs + self._processMap["getRowsWithColumnsTs"] = Processor.process_getRowsWithColumnsTs + self._processMap["mutateRow"] = Processor.process_mutateRow + self._processMap["mutateRowTs"] = Processor.process_mutateRowTs + self._processMap["mutateRows"] = Processor.process_mutateRows + self._processMap["mutateRowsTs"] = Processor.process_mutateRowsTs + self._processMap["atomicIncrement"] = Processor.process_atomicIncrement + self._processMap["deleteAll"] = Processor.process_deleteAll + self._processMap["deleteAllTs"] = Processor.process_deleteAllTs + self._processMap["deleteAllRow"] = Processor.process_deleteAllRow + self._processMap["deleteAllRowTs"] = Processor.process_deleteAllRowTs + self._processMap["scannerOpenWithScan"] = Processor.process_scannerOpenWithScan + self._processMap["scannerOpen"] = Processor.process_scannerOpen + self._processMap["scannerOpenWithStop"] = Processor.process_scannerOpenWithStop + self._processMap["scannerOpenWithPrefix"] = Processor.process_scannerOpenWithPrefix + self._processMap["scannerOpenTs"] = Processor.process_scannerOpenTs + self._processMap["scannerOpenWithStopTs"] = Processor.process_scannerOpenWithStopTs + self._processMap["scannerGet"] = Processor.process_scannerGet + self._processMap["scannerGetList"] = Processor.process_scannerGetList + self._processMap["scannerClose"] = Processor.process_scannerClose + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_enableTable(self, seqid, iprot, oprot): + args = enableTable_args() + args.read(iprot) + iprot.readMessageEnd() + result = enableTable_result() + try: + self._handler.enableTable(args.tableName) + except IOError, io: + result.io = io + oprot.writeMessageBegin("enableTable", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_disableTable(self, seqid, iprot, oprot): + args = disableTable_args() + args.read(iprot) + iprot.readMessageEnd() + result = disableTable_result() + try: + self._handler.disableTable(args.tableName) + except IOError, io: + result.io = io + oprot.writeMessageBegin("disableTable", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_isTableEnabled(self, seqid, iprot, oprot): + args = isTableEnabled_args() + args.read(iprot) + iprot.readMessageEnd() + result = isTableEnabled_result() + try: + result.success = self._handler.isTableEnabled(args.tableName) + except IOError, io: + result.io = io + oprot.writeMessageBegin("isTableEnabled", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_compact(self, seqid, iprot, oprot): + args = compact_args() + args.read(iprot) + iprot.readMessageEnd() + result = compact_result() + try: + self._handler.compact(args.tableNameOrRegionName) + except IOError, io: + result.io = io + oprot.writeMessageBegin("compact", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_majorCompact(self, seqid, iprot, oprot): + args = majorCompact_args() + args.read(iprot) + iprot.readMessageEnd() + result = majorCompact_result() + try: + self._handler.majorCompact(args.tableNameOrRegionName) + except IOError, io: + result.io = io + oprot.writeMessageBegin("majorCompact", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getTableNames(self, seqid, iprot, oprot): + args = getTableNames_args() + args.read(iprot) + iprot.readMessageEnd() + result = getTableNames_result() + try: + result.success = self._handler.getTableNames() + except IOError, io: + result.io = io + oprot.writeMessageBegin("getTableNames", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getColumnDescriptors(self, seqid, iprot, oprot): + args = getColumnDescriptors_args() + args.read(iprot) + iprot.readMessageEnd() + result = getColumnDescriptors_result() + try: + result.success = self._handler.getColumnDescriptors(args.tableName) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getColumnDescriptors", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getTableRegions(self, seqid, iprot, oprot): + args = getTableRegions_args() + args.read(iprot) + iprot.readMessageEnd() + result = getTableRegions_result() + try: + result.success = self._handler.getTableRegions(args.tableName) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getTableRegions", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_createTable(self, seqid, iprot, oprot): + args = createTable_args() + args.read(iprot) + iprot.readMessageEnd() + result = createTable_result() + try: + self._handler.createTable(args.tableName, args.columnFamilies) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + except AlreadyExists, exist: + result.exist = exist + oprot.writeMessageBegin("createTable", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_deleteTable(self, seqid, iprot, oprot): + args = deleteTable_args() + args.read(iprot) + iprot.readMessageEnd() + result = deleteTable_result() + try: + self._handler.deleteTable(args.tableName) + except IOError, io: + result.io = io + oprot.writeMessageBegin("deleteTable", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get(self, seqid, iprot, oprot): + args = get_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_result() + try: + result.success = self._handler.get(args.tableName, args.row, args.column) + except IOError, io: + result.io = io + oprot.writeMessageBegin("get", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getVer(self, seqid, iprot, oprot): + args = getVer_args() + args.read(iprot) + iprot.readMessageEnd() + result = getVer_result() + try: + result.success = self._handler.getVer(args.tableName, args.row, args.column, args.numVersions) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getVer", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getVerTs(self, seqid, iprot, oprot): + args = getVerTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = getVerTs_result() + try: + result.success = self._handler.getVerTs(args.tableName, args.row, args.column, args.timestamp, args.numVersions) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getVerTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRow(self, seqid, iprot, oprot): + args = getRow_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRow_result() + try: + result.success = self._handler.getRow(args.tableName, args.row) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getRow", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRowWithColumns(self, seqid, iprot, oprot): + args = getRowWithColumns_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRowWithColumns_result() + try: + result.success = self._handler.getRowWithColumns(args.tableName, args.row, args.columns) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getRowWithColumns", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRowTs(self, seqid, iprot, oprot): + args = getRowTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRowTs_result() + try: + result.success = self._handler.getRowTs(args.tableName, args.row, args.timestamp) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getRowTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRowWithColumnsTs(self, seqid, iprot, oprot): + args = getRowWithColumnsTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRowWithColumnsTs_result() + try: + result.success = self._handler.getRowWithColumnsTs(args.tableName, args.row, args.columns, args.timestamp) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getRowWithColumnsTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRows(self, seqid, iprot, oprot): + args = getRows_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRows_result() + try: + result.success = self._handler.getRows(args.tableName, args.rows) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getRows", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRowsWithColumns(self, seqid, iprot, oprot): + args = getRowsWithColumns_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRowsWithColumns_result() + try: + result.success = self._handler.getRowsWithColumns(args.tableName, args.rows, args.columns) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getRowsWithColumns", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRowsTs(self, seqid, iprot, oprot): + args = getRowsTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRowsTs_result() + try: + result.success = self._handler.getRowsTs(args.tableName, args.rows, args.timestamp) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getRowsTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRowsWithColumnsTs(self, seqid, iprot, oprot): + args = getRowsWithColumnsTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRowsWithColumnsTs_result() + try: + result.success = self._handler.getRowsWithColumnsTs(args.tableName, args.rows, args.columns, args.timestamp) + except IOError, io: + result.io = io + oprot.writeMessageBegin("getRowsWithColumnsTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_mutateRow(self, seqid, iprot, oprot): + args = mutateRow_args() + args.read(iprot) + iprot.readMessageEnd() + result = mutateRow_result() + try: + self._handler.mutateRow(args.tableName, args.row, args.mutations) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + oprot.writeMessageBegin("mutateRow", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_mutateRowTs(self, seqid, iprot, oprot): + args = mutateRowTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = mutateRowTs_result() + try: + self._handler.mutateRowTs(args.tableName, args.row, args.mutations, args.timestamp) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + oprot.writeMessageBegin("mutateRowTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_mutateRows(self, seqid, iprot, oprot): + args = mutateRows_args() + args.read(iprot) + iprot.readMessageEnd() + result = mutateRows_result() + try: + self._handler.mutateRows(args.tableName, args.rowBatches) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + oprot.writeMessageBegin("mutateRows", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_mutateRowsTs(self, seqid, iprot, oprot): + args = mutateRowsTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = mutateRowsTs_result() + try: + self._handler.mutateRowsTs(args.tableName, args.rowBatches, args.timestamp) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + oprot.writeMessageBegin("mutateRowsTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_atomicIncrement(self, seqid, iprot, oprot): + args = atomicIncrement_args() + args.read(iprot) + iprot.readMessageEnd() + result = atomicIncrement_result() + try: + result.success = self._handler.atomicIncrement(args.tableName, args.row, args.column, args.value) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + oprot.writeMessageBegin("atomicIncrement", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_deleteAll(self, seqid, iprot, oprot): + args = deleteAll_args() + args.read(iprot) + iprot.readMessageEnd() + result = deleteAll_result() + try: + self._handler.deleteAll(args.tableName, args.row, args.column) + except IOError, io: + result.io = io + oprot.writeMessageBegin("deleteAll", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_deleteAllTs(self, seqid, iprot, oprot): + args = deleteAllTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = deleteAllTs_result() + try: + self._handler.deleteAllTs(args.tableName, args.row, args.column, args.timestamp) + except IOError, io: + result.io = io + oprot.writeMessageBegin("deleteAllTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_deleteAllRow(self, seqid, iprot, oprot): + args = deleteAllRow_args() + args.read(iprot) + iprot.readMessageEnd() + result = deleteAllRow_result() + try: + self._handler.deleteAllRow(args.tableName, args.row) + except IOError, io: + result.io = io + oprot.writeMessageBegin("deleteAllRow", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_deleteAllRowTs(self, seqid, iprot, oprot): + args = deleteAllRowTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = deleteAllRowTs_result() + try: + self._handler.deleteAllRowTs(args.tableName, args.row, args.timestamp) + except IOError, io: + result.io = io + oprot.writeMessageBegin("deleteAllRowTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerOpenWithScan(self, seqid, iprot, oprot): + args = scannerOpenWithScan_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerOpenWithScan_result() + try: + result.success = self._handler.scannerOpenWithScan(args.tableName, args.scan) + except IOError, io: + result.io = io + oprot.writeMessageBegin("scannerOpenWithScan", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerOpen(self, seqid, iprot, oprot): + args = scannerOpen_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerOpen_result() + try: + result.success = self._handler.scannerOpen(args.tableName, args.startRow, args.columns) + except IOError, io: + result.io = io + oprot.writeMessageBegin("scannerOpen", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerOpenWithStop(self, seqid, iprot, oprot): + args = scannerOpenWithStop_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerOpenWithStop_result() + try: + result.success = self._handler.scannerOpenWithStop(args.tableName, args.startRow, args.stopRow, args.columns) + except IOError, io: + result.io = io + oprot.writeMessageBegin("scannerOpenWithStop", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerOpenWithPrefix(self, seqid, iprot, oprot): + args = scannerOpenWithPrefix_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerOpenWithPrefix_result() + try: + result.success = self._handler.scannerOpenWithPrefix(args.tableName, args.startAndPrefix, args.columns) + except IOError, io: + result.io = io + oprot.writeMessageBegin("scannerOpenWithPrefix", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerOpenTs(self, seqid, iprot, oprot): + args = scannerOpenTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerOpenTs_result() + try: + result.success = self._handler.scannerOpenTs(args.tableName, args.startRow, args.columns, args.timestamp) + except IOError, io: + result.io = io + oprot.writeMessageBegin("scannerOpenTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerOpenWithStopTs(self, seqid, iprot, oprot): + args = scannerOpenWithStopTs_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerOpenWithStopTs_result() + try: + result.success = self._handler.scannerOpenWithStopTs(args.tableName, args.startRow, args.stopRow, args.columns, args.timestamp) + except IOError, io: + result.io = io + oprot.writeMessageBegin("scannerOpenWithStopTs", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerGet(self, seqid, iprot, oprot): + args = scannerGet_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerGet_result() + try: + result.success = self._handler.scannerGet(args.id) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + oprot.writeMessageBegin("scannerGet", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerGetList(self, seqid, iprot, oprot): + args = scannerGetList_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerGetList_result() + try: + result.success = self._handler.scannerGetList(args.id, args.nbRows) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + oprot.writeMessageBegin("scannerGetList", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_scannerClose(self, seqid, iprot, oprot): + args = scannerClose_args() + args.read(iprot) + iprot.readMessageEnd() + result = scannerClose_result() + try: + self._handler.scannerClose(args.id) + except IOError, io: + result.io = io + except IllegalArgument, ia: + result.ia = ia + oprot.writeMessageBegin("scannerClose", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + +# HELPER FUNCTIONS AND STRUCTURES + +class enableTable_args: + """ + Attributes: + - tableName: name of the table + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + ) + + def __init__(self, tableName=None,): + self.tableName = tableName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('enableTable_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class enableTable_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('enableTable_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class disableTable_args: + """ + Attributes: + - tableName: name of the table + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + ) + + def __init__(self, tableName=None,): + self.tableName = tableName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('disableTable_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class disableTable_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('disableTable_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class isTableEnabled_args: + """ + Attributes: + - tableName: name of the table to check + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + ) + + def __init__(self, tableName=None,): + self.tableName = tableName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('isTableEnabled_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class isTableEnabled_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.BOOL: + self.success = iprot.readBool(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('isTableEnabled_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class compact_args: + """ + Attributes: + - tableNameOrRegionName + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableNameOrRegionName', None, None, ), # 1 + ) + + def __init__(self, tableNameOrRegionName=None,): + self.tableNameOrRegionName = tableNameOrRegionName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableNameOrRegionName = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('compact_args') + if self.tableNameOrRegionName is not None: + oprot.writeFieldBegin('tableNameOrRegionName', TType.STRING, 1) + oprot.writeString(self.tableNameOrRegionName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class compact_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('compact_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class majorCompact_args: + """ + Attributes: + - tableNameOrRegionName + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableNameOrRegionName', None, None, ), # 1 + ) + + def __init__(self, tableNameOrRegionName=None,): + self.tableNameOrRegionName = tableNameOrRegionName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableNameOrRegionName = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('majorCompact_args') + if self.tableNameOrRegionName is not None: + oprot.writeFieldBegin('tableNameOrRegionName', TType.STRING, 1) + oprot.writeString(self.tableNameOrRegionName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class majorCompact_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('majorCompact_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTableNames_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTableNames_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTableNames_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype26, _size23) = iprot.readListBegin() + for _i27 in xrange(_size23): + _elem28 = iprot.readString(); + self.success.append(_elem28) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTableNames_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRING, len(self.success)) + for iter29 in self.success: + oprot.writeString(iter29) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getColumnDescriptors_args: + """ + Attributes: + - tableName: table name + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + ) + + def __init__(self, tableName=None,): + self.tableName = tableName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getColumnDescriptors_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getColumnDescriptors_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(ColumnDescriptor, ColumnDescriptor.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.MAP: + self.success = {} + (_ktype31, _vtype32, _size30 ) = iprot.readMapBegin() + for _i34 in xrange(_size30): + _key35 = iprot.readString(); + _val36 = ColumnDescriptor() + _val36.read(iprot) + self.success[_key35] = _val36 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getColumnDescriptors_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.MAP, 0) + oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success)) + for kiter37,viter38 in self.success.items(): + oprot.writeString(kiter37) + viter38.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTableRegions_args: + """ + Attributes: + - tableName: table name + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + ) + + def __init__(self, tableName=None,): + self.tableName = tableName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTableRegions_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getTableRegions_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRegionInfo, TRegionInfo.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype42, _size39) = iprot.readListBegin() + for _i43 in xrange(_size39): + _elem44 = TRegionInfo() + _elem44.read(iprot) + self.success.append(_elem44) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getTableRegions_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter45 in self.success: + iter45.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class createTable_args: + """ + Attributes: + - tableName: name of table to create + - columnFamilies: list of column family descriptors + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.LIST, 'columnFamilies', (TType.STRUCT,(ColumnDescriptor, ColumnDescriptor.thrift_spec)), None, ), # 2 + ) + + def __init__(self, tableName=None, columnFamilies=None,): + self.tableName = tableName + self.columnFamilies = columnFamilies + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.columnFamilies = [] + (_etype49, _size46) = iprot.readListBegin() + for _i50 in xrange(_size46): + _elem51 = ColumnDescriptor() + _elem51.read(iprot) + self.columnFamilies.append(_elem51) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('createTable_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.columnFamilies is not None: + oprot.writeFieldBegin('columnFamilies', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.columnFamilies)) + for iter52 in self.columnFamilies: + iter52.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class createTable_result: + """ + Attributes: + - io + - ia + - exist + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + (3, TType.STRUCT, 'exist', (AlreadyExists, AlreadyExists.thrift_spec), None, ), # 3 + ) + + def __init__(self, io=None, ia=None, exist=None,): + self.io = io + self.ia = ia + self.exist = exist + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.exist = AlreadyExists() + self.exist.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('createTable_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + if self.exist is not None: + oprot.writeFieldBegin('exist', TType.STRUCT, 3) + self.exist.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteTable_args: + """ + Attributes: + - tableName: name of table to delete + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + ) + + def __init__(self, tableName=None,): + self.tableName = tableName + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteTable_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteTable_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteTable_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_args: + """ + Attributes: + - tableName: name of table + - row: row key + - column: column name + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.STRING, 'column', None, None, ), # 3 + ) + + def __init__(self, tableName=None, row=None, column=None,): + self.tableName = tableName + self.row = row + self.column = column + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.column = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.column is not None: + oprot.writeFieldBegin('column', TType.STRING, 3) + oprot.writeString(self.column) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TCell, TCell.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype56, _size53) = iprot.readListBegin() + for _i57 in xrange(_size53): + _elem58 = TCell() + _elem58.read(iprot) + self.success.append(_elem58) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter59 in self.success: + iter59.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getVer_args: + """ + Attributes: + - tableName: name of table + - row: row key + - column: column name + - numVersions: number of versions to retrieve + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.STRING, 'column', None, None, ), # 3 + (4, TType.I32, 'numVersions', None, None, ), # 4 + ) + + def __init__(self, tableName=None, row=None, column=None, numVersions=None,): + self.tableName = tableName + self.row = row + self.column = column + self.numVersions = numVersions + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.column = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.numVersions = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getVer_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.column is not None: + oprot.writeFieldBegin('column', TType.STRING, 3) + oprot.writeString(self.column) + oprot.writeFieldEnd() + if self.numVersions is not None: + oprot.writeFieldBegin('numVersions', TType.I32, 4) + oprot.writeI32(self.numVersions) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getVer_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TCell, TCell.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype63, _size60) = iprot.readListBegin() + for _i64 in xrange(_size60): + _elem65 = TCell() + _elem65.read(iprot) + self.success.append(_elem65) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getVer_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter66 in self.success: + iter66.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getVerTs_args: + """ + Attributes: + - tableName: name of table + - row: row key + - column: column name + - timestamp: timestamp + - numVersions: number of versions to retrieve + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.STRING, 'column', None, None, ), # 3 + (4, TType.I64, 'timestamp', None, None, ), # 4 + (5, TType.I32, 'numVersions', None, None, ), # 5 + ) + + def __init__(self, tableName=None, row=None, column=None, timestamp=None, numVersions=None,): + self.tableName = tableName + self.row = row + self.column = column + self.timestamp = timestamp + self.numVersions = numVersions + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.column = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.numVersions = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getVerTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.column is not None: + oprot.writeFieldBegin('column', TType.STRING, 3) + oprot.writeString(self.column) + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 4) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + if self.numVersions is not None: + oprot.writeFieldBegin('numVersions', TType.I32, 5) + oprot.writeI32(self.numVersions) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getVerTs_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TCell, TCell.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype70, _size67) = iprot.readListBegin() + for _i71 in xrange(_size67): + _elem72 = TCell() + _elem72.read(iprot) + self.success.append(_elem72) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getVerTs_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter73 in self.success: + iter73.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRow_args: + """ + Attributes: + - tableName: name of table + - row: row key + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + ) + + def __init__(self, tableName=None, row=None,): + self.tableName = tableName + self.row = row + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRow_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRow_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype77, _size74) = iprot.readListBegin() + for _i78 in xrange(_size74): + _elem79 = TRowResult() + _elem79.read(iprot) + self.success.append(_elem79) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRow_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter80 in self.success: + iter80.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowWithColumns_args: + """ + Attributes: + - tableName: name of table + - row: row key + - columns: List of columns to return, null for all columns + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRING,None), None, ), # 3 + ) + + def __init__(self, tableName=None, row=None, columns=None,): + self.tableName = tableName + self.row = row + self.columns = columns + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype84, _size81) = iprot.readListBegin() + for _i85 in xrange(_size81): + _elem86 = iprot.readString(); + self.columns.append(_elem86) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowWithColumns_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter87 in self.columns: + oprot.writeString(iter87) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowWithColumns_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype91, _size88) = iprot.readListBegin() + for _i92 in xrange(_size88): + _elem93 = TRowResult() + _elem93.read(iprot) + self.success.append(_elem93) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowWithColumns_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter94 in self.success: + iter94.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowTs_args: + """ + Attributes: + - tableName: name of the table + - row: row key + - timestamp: timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.I64, 'timestamp', None, None, ), # 3 + ) + + def __init__(self, tableName=None, row=None, timestamp=None,): + self.tableName = tableName + self.row = row + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 3) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowTs_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype98, _size95) = iprot.readListBegin() + for _i99 in xrange(_size95): + _elem100 = TRowResult() + _elem100.read(iprot) + self.success.append(_elem100) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowTs_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter101 in self.success: + iter101.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowWithColumnsTs_args: + """ + Attributes: + - tableName: name of table + - row: row key + - columns: List of columns to return, null for all columns + - timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRING,None), None, ), # 3 + (4, TType.I64, 'timestamp', None, None, ), # 4 + ) + + def __init__(self, tableName=None, row=None, columns=None, timestamp=None,): + self.tableName = tableName + self.row = row + self.columns = columns + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype105, _size102) = iprot.readListBegin() + for _i106 in xrange(_size102): + _elem107 = iprot.readString(); + self.columns.append(_elem107) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowWithColumnsTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter108 in self.columns: + oprot.writeString(iter108) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 4) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowWithColumnsTs_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype112, _size109) = iprot.readListBegin() + for _i113 in xrange(_size109): + _elem114 = TRowResult() + _elem114.read(iprot) + self.success.append(_elem114) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowWithColumnsTs_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter115 in self.success: + iter115.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRows_args: + """ + Attributes: + - tableName: name of table + - rows: row keys + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.LIST, 'rows', (TType.STRING,None), None, ), # 2 + ) + + def __init__(self, tableName=None, rows=None,): + self.tableName = tableName + self.rows = rows + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.rows = [] + (_etype119, _size116) = iprot.readListBegin() + for _i120 in xrange(_size116): + _elem121 = iprot.readString(); + self.rows.append(_elem121) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRows_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.rows is not None: + oprot.writeFieldBegin('rows', TType.LIST, 2) + oprot.writeListBegin(TType.STRING, len(self.rows)) + for iter122 in self.rows: + oprot.writeString(iter122) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRows_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype126, _size123) = iprot.readListBegin() + for _i127 in xrange(_size123): + _elem128 = TRowResult() + _elem128.read(iprot) + self.success.append(_elem128) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRows_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter129 in self.success: + iter129.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowsWithColumns_args: + """ + Attributes: + - tableName: name of table + - rows: row keys + - columns: List of columns to return, null for all columns + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.LIST, 'rows', (TType.STRING,None), None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRING,None), None, ), # 3 + ) + + def __init__(self, tableName=None, rows=None, columns=None,): + self.tableName = tableName + self.rows = rows + self.columns = columns + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.rows = [] + (_etype133, _size130) = iprot.readListBegin() + for _i134 in xrange(_size130): + _elem135 = iprot.readString(); + self.rows.append(_elem135) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype139, _size136) = iprot.readListBegin() + for _i140 in xrange(_size136): + _elem141 = iprot.readString(); + self.columns.append(_elem141) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowsWithColumns_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.rows is not None: + oprot.writeFieldBegin('rows', TType.LIST, 2) + oprot.writeListBegin(TType.STRING, len(self.rows)) + for iter142 in self.rows: + oprot.writeString(iter142) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter143 in self.columns: + oprot.writeString(iter143) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowsWithColumns_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype147, _size144) = iprot.readListBegin() + for _i148 in xrange(_size144): + _elem149 = TRowResult() + _elem149.read(iprot) + self.success.append(_elem149) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowsWithColumns_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter150 in self.success: + iter150.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowsTs_args: + """ + Attributes: + - tableName: name of the table + - rows: row keys + - timestamp: timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.LIST, 'rows', (TType.STRING,None), None, ), # 2 + (3, TType.I64, 'timestamp', None, None, ), # 3 + ) + + def __init__(self, tableName=None, rows=None, timestamp=None,): + self.tableName = tableName + self.rows = rows + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.rows = [] + (_etype154, _size151) = iprot.readListBegin() + for _i155 in xrange(_size151): + _elem156 = iprot.readString(); + self.rows.append(_elem156) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowsTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.rows is not None: + oprot.writeFieldBegin('rows', TType.LIST, 2) + oprot.writeListBegin(TType.STRING, len(self.rows)) + for iter157 in self.rows: + oprot.writeString(iter157) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 3) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowsTs_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype161, _size158) = iprot.readListBegin() + for _i162 in xrange(_size158): + _elem163 = TRowResult() + _elem163.read(iprot) + self.success.append(_elem163) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowsTs_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter164 in self.success: + iter164.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowsWithColumnsTs_args: + """ + Attributes: + - tableName: name of table + - rows: row keys + - columns: List of columns to return, null for all columns + - timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.LIST, 'rows', (TType.STRING,None), None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRING,None), None, ), # 3 + (4, TType.I64, 'timestamp', None, None, ), # 4 + ) + + def __init__(self, tableName=None, rows=None, columns=None, timestamp=None,): + self.tableName = tableName + self.rows = rows + self.columns = columns + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.rows = [] + (_etype168, _size165) = iprot.readListBegin() + for _i169 in xrange(_size165): + _elem170 = iprot.readString(); + self.rows.append(_elem170) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype174, _size171) = iprot.readListBegin() + for _i175 in xrange(_size171): + _elem176 = iprot.readString(); + self.columns.append(_elem176) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowsWithColumnsTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.rows is not None: + oprot.writeFieldBegin('rows', TType.LIST, 2) + oprot.writeListBegin(TType.STRING, len(self.rows)) + for iter177 in self.rows: + oprot.writeString(iter177) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter178 in self.columns: + oprot.writeString(iter178) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 4) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class getRowsWithColumnsTs_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype182, _size179) = iprot.readListBegin() + for _i183 in xrange(_size179): + _elem184 = TRowResult() + _elem184.read(iprot) + self.success.append(_elem184) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getRowsWithColumnsTs_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter185 in self.success: + iter185.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class mutateRow_args: + """ + Attributes: + - tableName: name of table + - row: row key + - mutations: list of mutation commands + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.LIST, 'mutations', (TType.STRUCT,(Mutation, Mutation.thrift_spec)), None, ), # 3 + ) + + def __init__(self, tableName=None, row=None, mutations=None,): + self.tableName = tableName + self.row = row + self.mutations = mutations + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.mutations = [] + (_etype189, _size186) = iprot.readListBegin() + for _i190 in xrange(_size186): + _elem191 = Mutation() + _elem191.read(iprot) + self.mutations.append(_elem191) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('mutateRow_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.mutations is not None: + oprot.writeFieldBegin('mutations', TType.LIST, 3) + oprot.writeListBegin(TType.STRUCT, len(self.mutations)) + for iter192 in self.mutations: + iter192.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class mutateRow_result: + """ + Attributes: + - io + - ia + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + ) + + def __init__(self, io=None, ia=None,): + self.io = io + self.ia = ia + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('mutateRow_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class mutateRowTs_args: + """ + Attributes: + - tableName: name of table + - row: row key + - mutations: list of mutation commands + - timestamp: timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.LIST, 'mutations', (TType.STRUCT,(Mutation, Mutation.thrift_spec)), None, ), # 3 + (4, TType.I64, 'timestamp', None, None, ), # 4 + ) + + def __init__(self, tableName=None, row=None, mutations=None, timestamp=None,): + self.tableName = tableName + self.row = row + self.mutations = mutations + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.mutations = [] + (_etype196, _size193) = iprot.readListBegin() + for _i197 in xrange(_size193): + _elem198 = Mutation() + _elem198.read(iprot) + self.mutations.append(_elem198) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('mutateRowTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.mutations is not None: + oprot.writeFieldBegin('mutations', TType.LIST, 3) + oprot.writeListBegin(TType.STRUCT, len(self.mutations)) + for iter199 in self.mutations: + iter199.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 4) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class mutateRowTs_result: + """ + Attributes: + - io + - ia + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + ) + + def __init__(self, io=None, ia=None,): + self.io = io + self.ia = ia + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('mutateRowTs_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class mutateRows_args: + """ + Attributes: + - tableName: name of table + - rowBatches: list of row batches + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.LIST, 'rowBatches', (TType.STRUCT,(BatchMutation, BatchMutation.thrift_spec)), None, ), # 2 + ) + + def __init__(self, tableName=None, rowBatches=None,): + self.tableName = tableName + self.rowBatches = rowBatches + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.rowBatches = [] + (_etype203, _size200) = iprot.readListBegin() + for _i204 in xrange(_size200): + _elem205 = BatchMutation() + _elem205.read(iprot) + self.rowBatches.append(_elem205) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('mutateRows_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.rowBatches is not None: + oprot.writeFieldBegin('rowBatches', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.rowBatches)) + for iter206 in self.rowBatches: + iter206.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class mutateRows_result: + """ + Attributes: + - io + - ia + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + ) + + def __init__(self, io=None, ia=None,): + self.io = io + self.ia = ia + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('mutateRows_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class mutateRowsTs_args: + """ + Attributes: + - tableName: name of table + - rowBatches: list of row batches + - timestamp: timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.LIST, 'rowBatches', (TType.STRUCT,(BatchMutation, BatchMutation.thrift_spec)), None, ), # 2 + (3, TType.I64, 'timestamp', None, None, ), # 3 + ) + + def __init__(self, tableName=None, rowBatches=None, timestamp=None,): + self.tableName = tableName + self.rowBatches = rowBatches + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.rowBatches = [] + (_etype210, _size207) = iprot.readListBegin() + for _i211 in xrange(_size207): + _elem212 = BatchMutation() + _elem212.read(iprot) + self.rowBatches.append(_elem212) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('mutateRowsTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.rowBatches is not None: + oprot.writeFieldBegin('rowBatches', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.rowBatches)) + for iter213 in self.rowBatches: + iter213.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 3) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class mutateRowsTs_result: + """ + Attributes: + - io + - ia + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + ) + + def __init__(self, io=None, ia=None,): + self.io = io + self.ia = ia + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('mutateRowsTs_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class atomicIncrement_args: + """ + Attributes: + - tableName: name of table + - row: row to increment + - column: name of column + - value: amount to increment by + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.STRING, 'column', None, None, ), # 3 + (4, TType.I64, 'value', None, None, ), # 4 + ) + + def __init__(self, tableName=None, row=None, column=None, value=None,): + self.tableName = tableName + self.row = row + self.column = column + self.value = value + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.column = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I64: + self.value = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('atomicIncrement_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.column is not None: + oprot.writeFieldBegin('column', TType.STRING, 3) + oprot.writeString(self.column) + oprot.writeFieldEnd() + if self.value is not None: + oprot.writeFieldBegin('value', TType.I64, 4) + oprot.writeI64(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class atomicIncrement_result: + """ + Attributes: + - success + - io + - ia + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + ) + + def __init__(self, success=None, io=None, ia=None,): + self.success = success + self.io = io + self.ia = ia + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('atomicIncrement_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteAll_args: + """ + Attributes: + - tableName: name of table + - row: Row to update + - column: name of column whose value is to be deleted + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.STRING, 'column', None, None, ), # 3 + ) + + def __init__(self, tableName=None, row=None, column=None,): + self.tableName = tableName + self.row = row + self.column = column + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.column = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteAll_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.column is not None: + oprot.writeFieldBegin('column', TType.STRING, 3) + oprot.writeString(self.column) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteAll_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteAll_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteAllTs_args: + """ + Attributes: + - tableName: name of table + - row: Row to update + - column: name of column whose value is to be deleted + - timestamp: timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.STRING, 'column', None, None, ), # 3 + (4, TType.I64, 'timestamp', None, None, ), # 4 + ) + + def __init__(self, tableName=None, row=None, column=None, timestamp=None,): + self.tableName = tableName + self.row = row + self.column = column + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.column = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteAllTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.column is not None: + oprot.writeFieldBegin('column', TType.STRING, 3) + oprot.writeString(self.column) + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 4) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteAllTs_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteAllTs_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteAllRow_args: + """ + Attributes: + - tableName: name of table + - row: key of the row to be completely deleted. + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + ) + + def __init__(self, tableName=None, row=None,): + self.tableName = tableName + self.row = row + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteAllRow_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteAllRow_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteAllRow_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteAllRowTs_args: + """ + Attributes: + - tableName: name of table + - row: key of the row to be completely deleted. + - timestamp: timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.I64, 'timestamp', None, None, ), # 3 + ) + + def __init__(self, tableName=None, row=None, timestamp=None,): + self.tableName = tableName + self.row = row + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteAllRowTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 3) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class deleteAllRowTs_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('deleteAllRowTs_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenWithScan_args: + """ + Attributes: + - tableName: name of table + - scan: Scan instance + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRUCT, 'scan', (TScan, TScan.thrift_spec), None, ), # 2 + ) + + def __init__(self, tableName=None, scan=None,): + self.tableName = tableName + self.scan = scan + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.scan = TScan() + self.scan.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenWithScan_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.scan is not None: + oprot.writeFieldBegin('scan', TType.STRUCT, 2) + self.scan.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenWithScan_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenWithScan_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpen_args: + """ + Attributes: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'startRow', None, None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRING,None), None, ), # 3 + ) + + def __init__(self, tableName=None, startRow=None, columns=None,): + self.tableName = tableName + self.startRow = startRow + self.columns = columns + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.startRow = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype217, _size214) = iprot.readListBegin() + for _i218 in xrange(_size214): + _elem219 = iprot.readString(); + self.columns.append(_elem219) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpen_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.startRow is not None: + oprot.writeFieldBegin('startRow', TType.STRING, 2) + oprot.writeString(self.startRow) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter220 in self.columns: + oprot.writeString(iter220) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpen_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpen_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenWithStop_args: + """ + Attributes: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - stopRow: row to stop scanning on. This row is *not* included in the + scanner's results + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'startRow', None, None, ), # 2 + (3, TType.STRING, 'stopRow', None, None, ), # 3 + (4, TType.LIST, 'columns', (TType.STRING,None), None, ), # 4 + ) + + def __init__(self, tableName=None, startRow=None, stopRow=None, columns=None,): + self.tableName = tableName + self.startRow = startRow + self.stopRow = stopRow + self.columns = columns + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.startRow = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.stopRow = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.LIST: + self.columns = [] + (_etype224, _size221) = iprot.readListBegin() + for _i225 in xrange(_size221): + _elem226 = iprot.readString(); + self.columns.append(_elem226) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenWithStop_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.startRow is not None: + oprot.writeFieldBegin('startRow', TType.STRING, 2) + oprot.writeString(self.startRow) + oprot.writeFieldEnd() + if self.stopRow is not None: + oprot.writeFieldBegin('stopRow', TType.STRING, 3) + oprot.writeString(self.stopRow) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 4) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter227 in self.columns: + oprot.writeString(iter227) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenWithStop_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenWithStop_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenWithPrefix_args: + """ + Attributes: + - tableName: name of table + - startAndPrefix: the prefix (and thus start row) of the keys you want + - columns: the columns you want returned + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'startAndPrefix', None, None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRING,None), None, ), # 3 + ) + + def __init__(self, tableName=None, startAndPrefix=None, columns=None,): + self.tableName = tableName + self.startAndPrefix = startAndPrefix + self.columns = columns + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.startAndPrefix = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype231, _size228) = iprot.readListBegin() + for _i232 in xrange(_size228): + _elem233 = iprot.readString(); + self.columns.append(_elem233) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenWithPrefix_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.startAndPrefix is not None: + oprot.writeFieldBegin('startAndPrefix', TType.STRING, 2) + oprot.writeString(self.startAndPrefix) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter234 in self.columns: + oprot.writeString(iter234) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenWithPrefix_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenWithPrefix_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenTs_args: + """ + Attributes: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + - timestamp: timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'startRow', None, None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRING,None), None, ), # 3 + (4, TType.I64, 'timestamp', None, None, ), # 4 + ) + + def __init__(self, tableName=None, startRow=None, columns=None, timestamp=None,): + self.tableName = tableName + self.startRow = startRow + self.columns = columns + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.startRow = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype238, _size235) = iprot.readListBegin() + for _i239 in xrange(_size235): + _elem240 = iprot.readString(); + self.columns.append(_elem240) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.startRow is not None: + oprot.writeFieldBegin('startRow', TType.STRING, 2) + oprot.writeString(self.startRow) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter241 in self.columns: + oprot.writeString(iter241) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 4) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenTs_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenTs_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenWithStopTs_args: + """ + Attributes: + - tableName: name of table + - startRow: Starting row in table to scan. + Send "" (empty string) to start at the first row. + - stopRow: row to stop scanning on. This row is *not* included in the + scanner's results + - columns: columns to scan. If column name is a column family, all + columns of the specified column family are returned. It's also possible + to pass a regex in the column qualifier. + - timestamp: timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'startRow', None, None, ), # 2 + (3, TType.STRING, 'stopRow', None, None, ), # 3 + (4, TType.LIST, 'columns', (TType.STRING,None), None, ), # 4 + (5, TType.I64, 'timestamp', None, None, ), # 5 + ) + + def __init__(self, tableName=None, startRow=None, stopRow=None, columns=None, timestamp=None,): + self.tableName = tableName + self.startRow = startRow + self.stopRow = stopRow + self.columns = columns + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.tableName = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.startRow = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.stopRow = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.LIST: + self.columns = [] + (_etype245, _size242) = iprot.readListBegin() + for _i246 in xrange(_size242): + _elem247 = iprot.readString(); + self.columns.append(_elem247) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenWithStopTs_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.startRow is not None: + oprot.writeFieldBegin('startRow', TType.STRING, 2) + oprot.writeString(self.startRow) + oprot.writeFieldEnd() + if self.stopRow is not None: + oprot.writeFieldBegin('stopRow', TType.STRING, 3) + oprot.writeString(self.stopRow) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 4) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter248 in self.columns: + oprot.writeString(iter248) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 5) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerOpenWithStopTs_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerOpenWithStopTs_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerGet_args: + """ + Attributes: + - id: id of a scanner returned by scannerOpen + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'id', None, None, ), # 1 + ) + + def __init__(self, id=None,): + self.id = id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.id = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerGet_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.I32, 1) + oprot.writeI32(self.id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerGet_result: + """ + Attributes: + - success + - io + - ia + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + ) + + def __init__(self, success=None, io=None, ia=None,): + self.success = success + self.io = io + self.ia = ia + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype252, _size249) = iprot.readListBegin() + for _i253 in xrange(_size249): + _elem254 = TRowResult() + _elem254.read(iprot) + self.success.append(_elem254) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerGet_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter255 in self.success: + iter255.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerGetList_args: + """ + Attributes: + - id: id of a scanner returned by scannerOpen + - nbRows: number of results to return + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'id', None, None, ), # 1 + (2, TType.I32, 'nbRows', None, None, ), # 2 + ) + + def __init__(self, id=None, nbRows=None,): + self.id = id + self.nbRows = nbRows + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.id = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.nbRows = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerGetList_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.I32, 1) + oprot.writeI32(self.id) + oprot.writeFieldEnd() + if self.nbRows is not None: + oprot.writeFieldBegin('nbRows', TType.I32, 2) + oprot.writeI32(self.nbRows) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerGetList_result: + """ + Attributes: + - success + - io + - ia + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + ) + + def __init__(self, success=None, io=None, ia=None,): + self.success = success + self.io = io + self.ia = ia + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype259, _size256) = iprot.readListBegin() + for _i260 in xrange(_size256): + _elem261 = TRowResult() + _elem261.read(iprot) + self.success.append(_elem261) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerGetList_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter262 in self.success: + iter262.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerClose_args: + """ + Attributes: + - id: id of a scanner returned by scannerOpen + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'id', None, None, ), # 1 + ) + + def __init__(self, id=None,): + self.id = id + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.id = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerClose_args') + if self.id is not None: + oprot.writeFieldBegin('id', TType.I32, 1) + oprot.writeI32(self.id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class scannerClose_result: + """ + Attributes: + - io + - ia + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 + ) + + def __init__(self, io=None, ia=None,): + self.io = io + self.ia = ia + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('scannerClose_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git a/happybase/hbase/__init__.py b/happybase/hbase/__init__.py new file mode 100644 index 0000000..31dc15c --- /dev/null +++ b/happybase/hbase/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants', 'Hbase'] diff --git a/happybase/hbase/constants.py b/happybase/hbase/constants.py new file mode 100644 index 0000000..73f07fe --- /dev/null +++ b/happybase/hbase/constants.py @@ -0,0 +1,11 @@ +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException +from ttypes import * + diff --git a/happybase/hbase/ttypes.py b/happybase/hbase/ttypes.py new file mode 100644 index 0000000..406b598 --- /dev/null +++ b/happybase/hbase/ttypes.py @@ -0,0 +1,948 @@ +# +# Autogenerated by Thrift Compiler (0.8.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException + +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + + +class TCell: + """ + TCell - Used to transport a cell value (byte[]) and the timestamp it was + stored with together as a result for get and getRow methods. This promotes + the timestamp of a cell to a first-class value, making it easy to take + note of temporal data. Cell is used all the way from HStore up to HTable. + + Attributes: + - value + - timestamp + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'value', None, None, ), # 1 + (2, TType.I64, 'timestamp', None, None, ), # 2 + ) + + def __init__(self, value=None, timestamp=None,): + self.value = value + self.timestamp = timestamp + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.value = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TCell') + if self.value is not None: + oprot.writeFieldBegin('value', TType.STRING, 1) + oprot.writeString(self.value) + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 2) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class ColumnDescriptor: + """ + An HColumnDescriptor contains information about a column family + such as the number of versions, compression settings, etc. It is + used as input when creating a table or adding a column. + + Attributes: + - name + - maxVersions + - compression + - inMemory + - bloomFilterType + - bloomFilterVectorSize + - bloomFilterNbHashes + - blockCacheEnabled + - timeToLive + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', None, None, ), # 1 + (2, TType.I32, 'maxVersions', None, 3, ), # 2 + (3, TType.STRING, 'compression', None, "NONE", ), # 3 + (4, TType.BOOL, 'inMemory', None, False, ), # 4 + (5, TType.STRING, 'bloomFilterType', None, "NONE", ), # 5 + (6, TType.I32, 'bloomFilterVectorSize', None, 0, ), # 6 + (7, TType.I32, 'bloomFilterNbHashes', None, 0, ), # 7 + (8, TType.BOOL, 'blockCacheEnabled', None, False, ), # 8 + (9, TType.I32, 'timeToLive', None, -1, ), # 9 + ) + + def __init__(self, name=None, maxVersions=thrift_spec[2][4], compression=thrift_spec[3][4], inMemory=thrift_spec[4][4], bloomFilterType=thrift_spec[5][4], bloomFilterVectorSize=thrift_spec[6][4], bloomFilterNbHashes=thrift_spec[7][4], blockCacheEnabled=thrift_spec[8][4], timeToLive=thrift_spec[9][4],): + self.name = name + self.maxVersions = maxVersions + self.compression = compression + self.inMemory = inMemory + self.bloomFilterType = bloomFilterType + self.bloomFilterVectorSize = bloomFilterVectorSize + self.bloomFilterNbHashes = bloomFilterNbHashes + self.blockCacheEnabled = blockCacheEnabled + self.timeToLive = timeToLive + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.name = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.maxVersions = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.compression = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.BOOL: + self.inMemory = iprot.readBool(); + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.bloomFilterType = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.I32: + self.bloomFilterVectorSize = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.I32: + self.bloomFilterNbHashes = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.BOOL: + self.blockCacheEnabled = iprot.readBool(); + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.I32: + self.timeToLive = iprot.readI32(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('ColumnDescriptor') + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 1) + oprot.writeString(self.name) + oprot.writeFieldEnd() + if self.maxVersions is not None: + oprot.writeFieldBegin('maxVersions', TType.I32, 2) + oprot.writeI32(self.maxVersions) + oprot.writeFieldEnd() + if self.compression is not None: + oprot.writeFieldBegin('compression', TType.STRING, 3) + oprot.writeString(self.compression) + oprot.writeFieldEnd() + if self.inMemory is not None: + oprot.writeFieldBegin('inMemory', TType.BOOL, 4) + oprot.writeBool(self.inMemory) + oprot.writeFieldEnd() + if self.bloomFilterType is not None: + oprot.writeFieldBegin('bloomFilterType', TType.STRING, 5) + oprot.writeString(self.bloomFilterType) + oprot.writeFieldEnd() + if self.bloomFilterVectorSize is not None: + oprot.writeFieldBegin('bloomFilterVectorSize', TType.I32, 6) + oprot.writeI32(self.bloomFilterVectorSize) + oprot.writeFieldEnd() + if self.bloomFilterNbHashes is not None: + oprot.writeFieldBegin('bloomFilterNbHashes', TType.I32, 7) + oprot.writeI32(self.bloomFilterNbHashes) + oprot.writeFieldEnd() + if self.blockCacheEnabled is not None: + oprot.writeFieldBegin('blockCacheEnabled', TType.BOOL, 8) + oprot.writeBool(self.blockCacheEnabled) + oprot.writeFieldEnd() + if self.timeToLive is not None: + oprot.writeFieldBegin('timeToLive', TType.I32, 9) + oprot.writeI32(self.timeToLive) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class TRegionInfo: + """ + A TRegionInfo contains information about an HTable region. + + Attributes: + - startKey + - endKey + - id + - name + - version + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'startKey', None, None, ), # 1 + (2, TType.STRING, 'endKey', None, None, ), # 2 + (3, TType.I64, 'id', None, None, ), # 3 + (4, TType.STRING, 'name', None, None, ), # 4 + (5, TType.BYTE, 'version', None, None, ), # 5 + ) + + def __init__(self, startKey=None, endKey=None, id=None, name=None, version=None,): + self.startKey = startKey + self.endKey = endKey + self.id = id + self.name = name + self.version = version + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.startKey = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.endKey = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.id = iprot.readI64(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.name = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.BYTE: + self.version = iprot.readByte(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TRegionInfo') + if self.startKey is not None: + oprot.writeFieldBegin('startKey', TType.STRING, 1) + oprot.writeString(self.startKey) + oprot.writeFieldEnd() + if self.endKey is not None: + oprot.writeFieldBegin('endKey', TType.STRING, 2) + oprot.writeString(self.endKey) + oprot.writeFieldEnd() + if self.id is not None: + oprot.writeFieldBegin('id', TType.I64, 3) + oprot.writeI64(self.id) + oprot.writeFieldEnd() + if self.name is not None: + oprot.writeFieldBegin('name', TType.STRING, 4) + oprot.writeString(self.name) + oprot.writeFieldEnd() + if self.version is not None: + oprot.writeFieldBegin('version', TType.BYTE, 5) + oprot.writeByte(self.version) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class Mutation: + """ + A Mutation object is used to either update or delete a column-value. + + Attributes: + - isDelete + - column + - value + """ + + thrift_spec = ( + None, # 0 + (1, TType.BOOL, 'isDelete', None, False, ), # 1 + (2, TType.STRING, 'column', None, None, ), # 2 + (3, TType.STRING, 'value', None, None, ), # 3 + ) + + def __init__(self, isDelete=thrift_spec[1][4], column=None, value=None,): + self.isDelete = isDelete + self.column = column + self.value = value + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.BOOL: + self.isDelete = iprot.readBool(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.column = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.value = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('Mutation') + if self.isDelete is not None: + oprot.writeFieldBegin('isDelete', TType.BOOL, 1) + oprot.writeBool(self.isDelete) + oprot.writeFieldEnd() + if self.column is not None: + oprot.writeFieldBegin('column', TType.STRING, 2) + oprot.writeString(self.column) + oprot.writeFieldEnd() + if self.value is not None: + oprot.writeFieldBegin('value', TType.STRING, 3) + oprot.writeString(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class BatchMutation: + """ + A BatchMutation object is used to apply a number of Mutations to a single row. + + Attributes: + - row + - mutations + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'row', None, None, ), # 1 + (2, TType.LIST, 'mutations', (TType.STRUCT,(Mutation, Mutation.thrift_spec)), None, ), # 2 + ) + + def __init__(self, row=None, mutations=None,): + self.row = row + self.mutations = mutations + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.mutations = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in xrange(_size0): + _elem5 = Mutation() + _elem5.read(iprot) + self.mutations.append(_elem5) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('BatchMutation') + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 1) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.mutations is not None: + oprot.writeFieldBegin('mutations', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.mutations)) + for iter6 in self.mutations: + iter6.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class TRowResult: + """ + Holds row name and then a map of columns to cells. + + Attributes: + - row + - columns + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'row', None, None, ), # 1 + (2, TType.MAP, 'columns', (TType.STRING,None,TType.STRUCT,(TCell, TCell.thrift_spec)), None, ), # 2 + ) + + def __init__(self, row=None, columns=None,): + self.row = row + self.columns = columns + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.row = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.MAP: + self.columns = {} + (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin() + for _i11 in xrange(_size7): + _key12 = iprot.readString(); + _val13 = TCell() + _val13.read(iprot) + self.columns[_key12] = _val13 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TRowResult') + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 1) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.MAP, 2) + oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.columns)) + for kiter14,viter15 in self.columns.items(): + oprot.writeString(kiter14) + viter15.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class TScan: + """ + A Scan object is used to specify scanner parameters when opening a scanner. + + Attributes: + - startRow + - stopRow + - timestamp + - columns + - caching + - filterString + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'startRow', None, None, ), # 1 + (2, TType.STRING, 'stopRow', None, None, ), # 2 + (3, TType.I64, 'timestamp', None, None, ), # 3 + (4, TType.LIST, 'columns', (TType.STRING,None), None, ), # 4 + (5, TType.I32, 'caching', None, None, ), # 5 + (6, TType.STRING, 'filterString', None, None, ), # 6 + ) + + def __init__(self, startRow=None, stopRow=None, timestamp=None, columns=None, caching=None, filterString=None,): + self.startRow = startRow + self.stopRow = stopRow + self.timestamp = timestamp + self.columns = columns + self.caching = caching + self.filterString = filterString + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.startRow = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.stopRow = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.timestamp = iprot.readI64(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.LIST: + self.columns = [] + (_etype19, _size16) = iprot.readListBegin() + for _i20 in xrange(_size16): + _elem21 = iprot.readString(); + self.columns.append(_elem21) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.caching = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.filterString = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('TScan') + if self.startRow is not None: + oprot.writeFieldBegin('startRow', TType.STRING, 1) + oprot.writeString(self.startRow) + oprot.writeFieldEnd() + if self.stopRow is not None: + oprot.writeFieldBegin('stopRow', TType.STRING, 2) + oprot.writeString(self.stopRow) + oprot.writeFieldEnd() + if self.timestamp is not None: + oprot.writeFieldBegin('timestamp', TType.I64, 3) + oprot.writeI64(self.timestamp) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 4) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter22 in self.columns: + oprot.writeString(iter22) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.caching is not None: + oprot.writeFieldBegin('caching', TType.I32, 5) + oprot.writeI32(self.caching) + oprot.writeFieldEnd() + if self.filterString is not None: + oprot.writeFieldBegin('filterString', TType.STRING, 6) + oprot.writeString(self.filterString) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class IOError(TException): + """ + An IOError exception signals that an error occurred communicating + to the Hbase master or an Hbase region server. Also used to return + more general Hbase error conditions. + + Attributes: + - message + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'message', None, None, ), # 1 + ) + + def __init__(self, message=None,): + self.message = message + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.message = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('IOError') + if self.message is not None: + oprot.writeFieldBegin('message', TType.STRING, 1) + oprot.writeString(self.message) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class IllegalArgument(TException): + """ + An IllegalArgument exception indicates an illegal or invalid + argument was passed into a procedure. + + Attributes: + - message + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'message', None, None, ), # 1 + ) + + def __init__(self, message=None,): + self.message = message + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.message = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('IllegalArgument') + if self.message is not None: + oprot.writeFieldBegin('message', TType.STRING, 1) + oprot.writeString(self.message) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class AlreadyExists(TException): + """ + An AlreadyExists exceptions signals that a table with the specified + name already exists + + Attributes: + - message + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'message', None, None, ), # 1 + ) + + def __init__(self, message=None,): + self.message = message + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.message = iprot.readString(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('AlreadyExists') + if self.message is not None: + oprot.writeFieldBegin('message', TType.STRING, 1) + oprot.writeString(self.message) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __str__(self): + return repr(self) + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) diff --git a/happybase/util.py b/happybase/util.py new file mode 100644 index 0000000..a4044fe --- /dev/null +++ b/happybase/util.py @@ -0,0 +1,39 @@ +""" +HappyBase utility module. +""" + +import re + +__all__ = ['thrift_attrs', 'thrift_type_to_dict'] + +CAPITALS = re.compile('([A-Z])') + + +def camel_case_to_pep8(name): + """Converts a camel cased name to PEP8 style.""" + converted = CAPITALS.sub(lambda m: '_' + m.groups()[0].lower(), name) + if converted[0] == '_': + return converted[1:] + else: + return converted + + +def pep8_to_camel_case(name, initial=False): + """Converts a PEP8 style name to camel case.""" + chunks = name.split('_') + converted = [s[0].upper() + s[1:].lower() for s in chunks] + if initial: + return ''.join(converted) + else: + return chunks[0].lower() + ''.join(converted[1:]) + + +def thrift_attrs(obj_or_cls): + """Obtains Thrift data type attribute names for an instance or class.""" + return [v[2] for v in obj_or_cls.thrift_spec[1:]] + + +def thrift_type_to_dict(obj): + """Converts a Thrift data type to a regular dictionary.""" + return dict((camel_case_to_pep8(attr), getattr(obj, attr)) + for attr in thrift_attrs(obj)) |