diff options
author | Wouter Bolsterlee <uws@xs4all.nl> | 2014-01-25 21:44:37 +0100 |
---|---|---|
committer | Wouter Bolsterlee <uws@xs4all.nl> | 2014-01-25 21:44:37 +0100 |
commit | 9f95019aa65b1448302f29c54e825a62caac160c (patch) | |
tree | bceb99500fd0f63ba5f67007a8553e5251d1b0e3 | |
parent | 8481d317804e060b12839b571ef22306074fba9c (diff) | |
download | happybase-9f95019aa65b1448302f29c54e825a62caac160c.tar.gz |
Use 'argument' instead of 'parameter' in docstrings
-rw-r--r-- | happybase/connection.py | 90 | ||||
-rw-r--r-- | happybase/pool.py | 2 | ||||
-rw-r--r-- | happybase/table.py | 12 |
3 files changed, 54 insertions, 50 deletions
diff --git a/happybase/connection.py b/happybase/connection.py index 8e729f0..aba5a12 100644 --- a/happybase/connection.py +++ b/happybase/connection.py @@ -32,43 +32,46 @@ DEFAULT_COMPAT = '0.96' class Connection(object): """Connection to an HBase Thrift server. - The `host` and `port` parameters specify the host name and TCP port + The `host` and `port` argumetsn 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 - specifed, the `timeout` parameter specifies the socket timeout in + specifed, the `timeout` argument specifies the socket timeout in milliseconds. - 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` and `table_prefix_separator` arguments specify - a prefix and a separator string to be prepended to all table names, e.g. - when :py:meth:`Connection.table` is invoked. For example, if `table_prefix` - is ``myproject``, all tables tables will have names like ``myproject_XYZ``. - - The optional `compat` parameter sets the compatibility level for this - connection. Older HBase versions have slightly different Thrift interfaces, - and using the wrong protocol can lead to crashes caused by communication - errors, so make sure to use the correct one. This value can be either the - string ``0.90``, ``0.92``, ``0.94``, or ``0.96`` (the default). - - The optional `transport` parameter specifies the Thrift transport mode to - use. Supported values for this parameter are ``buffered`` (the default) and - ``framed``. Make sure to choose the right one, since otherwise you might - see non-obvious connection errors or program hangs when making - a connection. HBase versions before 0.94 always use the buffered transport. - Starting with HBase 0.94, the Thrift server optionally uses a framed - transport, depending on the parameter passed to the ``hbase-daemon.sh start - thrift`` command. The default ``-threadpool`` mode uses the buffered - transport; the ``-hsha``, ``-nonblocking``, and ``-threadedselector`` modes - use the framed transport. + 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` and `table_prefix_separator` arguments + specify a prefix and a separator string to be prepended to all table + names, e.g. when :py:meth:`Connection.table` is invoked. For + example, if `table_prefix` is ``myproject``, all tables tables will + have names like ``myproject_XYZ``. + + The optional `compat` argument sets the compatibility level for + this connection. Older HBase versions have slightly different Thrift + interfaces, and using the wrong protocol can lead to crashes caused + by communication errors, so make sure to use the correct one. This + value can be either the string ``0.90``, ``0.92``, ``0.94``, or + ``0.96`` (the default). + + The optional `transport` argument specifies the Thrift transport + mode to use. Supported values for this argument are ``buffered`` + (the default) and ``framed``. Make sure to choose the right one, + since otherwise you might see non-obvious connection errors or + program hangs when making a connection. HBase versions before 0.94 + always use the buffered transport. Starting with HBase 0.94, the + Thrift server optionally uses a framed transport, depending on the + argument passed to the ``hbase-daemon.sh start thrift`` command. + The default ``-threadpool`` mode uses the buffered transport; the + ``-hsha``, ``-nonblocking``, and ``-threadedselector`` modes use the + framed transport. .. versionadded:: 0.5 - `timeout` parameter + `timeout` argument .. versionadded:: 0.4 - `table_prefix_separator` parameter + `table_prefix_separator` argument .. versionadded:: 0.4 support for framed Thrift transports @@ -176,16 +179,17 @@ class Connection(object): def table(self, name, use_prefix=True): """Return 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. + 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. + The optional `use_prefix` argument 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` + argument 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) @@ -225,7 +229,7 @@ class Connection(object): :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 + The `families` argument is a dictionary mapping column family names to a dictionary containing the options for this column family, e.g. @@ -282,11 +286,11 @@ class Connection(object): """Delete the specified table. .. versionadded:: 0.5 - the `disable` parameter + `disable` argument - In HBase, a table always needs to be disabled before it can be deleted. - If the `disable` parameter is `True`, this method first disables the - table if it wasn't already and then deletes it. + In HBase, a table always needs to be disabled before it can be + deleted. If the `disable` argument is `True`, this method first + disables the table if it wasn't already and then deletes it. :param str name: The table name :param bool disable: Whether to first disable the table if needed diff --git a/happybase/pool.py b/happybase/pool.py index faad6bf..9cc9f69 100644 --- a/happybase/pool.py +++ b/happybase/pool.py @@ -40,7 +40,7 @@ class ConnectionPool(object): .. versionadded:: 0.5 - The `size` parameter specifies how many connections this pool + The `size` argument specifies how many connections this pool manages. Additional keyword arguments are passed unmodified to the :py:class:`happybase.Connection` constructor, with the exception of the `autoconnect` argument, since maintaining connections is the diff --git a/happybase/table.py b/happybase/table.py index c81f4ce..abcceb0 100644 --- a/happybase/table.py +++ b/happybase/table.py @@ -193,10 +193,10 @@ class Table(object): 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") + raise TypeError("'versions' argument must be a number or None") elif versions < 1: raise ValueError( - "'versions' parameter must be at least 1 (or None)") + "'versions' argument must be at least 1 (or None)") if timestamp is None: cells = self.connection.client.getVer( @@ -273,7 +273,7 @@ class Table(object): HBase 0.96 (or up). .. versionadded:: 0.8 - `sorted_columns` parameter + `sorted_columns` argument :param str row_start: the row key to start at (inclusive) :param str row_stop: the row key to stop at (exclusive) @@ -409,7 +409,7 @@ class Table(object): method to manipulate data. .. versionadded:: 0.7 - `wal` parameter + `wal` argument :param str row: the row key :param dict data: the data to store @@ -429,7 +429,7 @@ class Table(object): method to manipulate data. .. versionadded:: 0.7 - `wal` parameter + `wal` argument :param str row: the row key :param list_or_tuple columns: list of columns (optional) @@ -465,7 +465,7 @@ class Table(object): :py:meth:`Batch.delete`. .. versionadded:: 0.7 - `wal` parameter + `wal` argument :param bool transaction: whether this batch should behave like a transaction (only useful when used as a |