Google Cloud Bigtable HappyBase package.
This package is intended to emulate the HappyBase library using Google Cloud Bigtable as the backing store.
Differences in Public API#
Some concepts from HBase/Thrift do not map directly to the Cloud Bigtable API. As a result
Table.regions()could not be implemented since tables in Cloud Bigtable do not expose internal storage details
Connection.enable_table()does nothing since Cloud Bigtable has no concept of enabled/disabled
Connection.disable_table()does nothing since Cloud Bigtable has no concept of enabled/disabled
Truesince Cloud Bigtable has no concept of enabled/disabled
Connection.compact_table()does nothing since Cloud Bigtable handles table compactions automatically and does not expose an API for it
__version__value for the HappyBase package is
None. However, it’s worth nothing this implementation was based off HappyBase 0.9.
Two of these
DEFAULT_PORT, are even imported in
Finally, we do not provide the
util module. Though it is public in the
HappyBase library, it provides no core functionality.
API Behavior Changes#
Since there is no concept of an enabled / disabled table, calling
disable=Truecan’t be supported. Using that argument will result in a warning.
Connectionconstructor disables the use of several arguments and will print a warning if any of them are passed in as keyword arguments. The arguments are:
In order to make
Connectioncompatible with Cloud Bigtable, we add a
instancekeyword argument to allow users to pass in their own
Instance(which they can construct beforehand).
from google.cloud.bigtable.client import Client client = Client(project=PROJECT_ID, admin=True) instance = client.instance(instance_id, location_id) instance.reload() from google.cloud.happybase import Connection connection = Connection(instance=instance)
Any uses of the
wal(Write Ahead Log) argument will result in a warning as well. This includes uses in:
Connection.create_table(), the majority of HBase column family options cannot be used. Among
In addition to using a dictionary for specifying column family options, we also accept instances of
Table.scan()no longer accepts the following arguments (which will result in a warning):
Table.delete()) will fail with a
ValueErrorwhen either a row or column family delete is attempted with a
timestamp. This is because the Cloud Bigtable API uses the
DeleteFromRowmutations for these deletes, and neither of these mutations support a timestamp.