diff --git a/gcloud/bigtable/happybase/connection.py b/gcloud/bigtable/happybase/connection.py index 7391d170472d..384d80efa0ad 100644 --- a/gcloud/bigtable/happybase/connection.py +++ b/gcloud/bigtable/happybase/connection.py @@ -263,3 +263,51 @@ def tables(self): if name.startswith(prefix)] return table_names + + def enable_table(self, name): + """Enable the specified table. + + Cloud Bigtable has no concept of enabled / disabled tables so this + method does not work. It is provided simply for compatibility. + + :raises: :class:`NotImplementedError ` + always + """ + raise NotImplementedError('The Cloud Bigtable API has no concept of ' + 'enabled or disabled tables.') + + def disable_table(self, name): + """Disable the specified table. + + Cloud Bigtable has no concept of enabled / disabled tables so this + method does not work. It is provided simply for compatibility. + + :raises: :class:`NotImplementedError ` + always + """ + raise NotImplementedError('The Cloud Bigtable API has no concept of ' + 'enabled or disabled tables.') + + def is_table_enabled(self, name): + """Return whether the specified table is enabled. + + Cloud Bigtable has no concept of enabled / disabled tables so this + method does not work. It is provided simply for compatibility. + + :raises: :class:`NotImplementedError ` + always + """ + raise NotImplementedError('The Cloud Bigtable API has no concept of ' + 'enabled or disabled tables.') + + def compact_table(self, name, major=False): + """Compact the specified table. + + Cloud Bigtable does not support compacting a table, so this + method does not work. It is provided simply for compatibility. + + :raises: :class:`NotImplementedError ` + always + """ + raise NotImplementedError('The Cloud Bigtable API does not support ' + 'compacting a table.') diff --git a/gcloud/bigtable/happybase/table.py b/gcloud/bigtable/happybase/table.py index d1f82eaad4c9..c650245bb1d8 100644 --- a/gcloud/bigtable/happybase/table.py +++ b/gcloud/bigtable/happybase/table.py @@ -91,3 +91,16 @@ def __init__(self, name, connection): def __repr__(self): return '' % (self.name,) + + def regions(self): + """Retrieve the regions for this table. + + Cloud Bigtable does not give information about how a table is laid + out in memory, so regions so this method does not work. It is + provided simply for compatibility. + + :raises: :class:`NotImplementedError ` + always + """ + raise NotImplementedError('The Cloud Bigtable API does not have a ' + 'concept of splitting a table into regions.') diff --git a/gcloud/bigtable/happybase/test_connection.py b/gcloud/bigtable/happybase/test_connection.py index ef1ac49298d3..17094f437d93 100644 --- a/gcloud/bigtable/happybase/test_connection.py +++ b/gcloud/bigtable/happybase/test_connection.py @@ -311,6 +311,39 @@ def test_tables_with_prefix(self): result = connection.tables() self.assertEqual(result, [unprefixed_table_name1]) + def test_enable_table(self): + cluster = _Cluster() # Avoid implicit environ check. + connection = self._makeOne(autoconnect=False, cluster=cluster) + + name = 'table-name' + with self.assertRaises(NotImplementedError): + connection.enable_table(name) + + def test_disable_table(self): + cluster = _Cluster() # Avoid implicit environ check. + connection = self._makeOne(autoconnect=False, cluster=cluster) + + name = 'table-name' + with self.assertRaises(NotImplementedError): + connection.disable_table(name) + + def test_is_table_enabled(self): + cluster = _Cluster() # Avoid implicit environ check. + connection = self._makeOne(autoconnect=False, cluster=cluster) + + name = 'table-name' + with self.assertRaises(NotImplementedError): + connection.is_table_enabled(name) + + def test_compact_table(self): + cluster = _Cluster() # Avoid implicit environ check. + connection = self._makeOne(autoconnect=False, cluster=cluster) + + name = 'table-name' + major = True + with self.assertRaises(NotImplementedError): + connection.compact_table(name, major=major) + class _Client(object): diff --git a/gcloud/bigtable/happybase/test_table.py b/gcloud/bigtable/happybase/test_table.py index 29f33469e4ce..1343b7fb20f0 100644 --- a/gcloud/bigtable/happybase/test_table.py +++ b/gcloud/bigtable/happybase/test_table.py @@ -83,6 +83,14 @@ def test___repr__(self): table = self._makeOne(name, None) self.assertEqual(repr(table), '') + def test_regions(self): + name = 'table-name' + connection = None + table = self._makeOne(name, connection) + + with self.assertRaises(NotImplementedError): + table.regions() + class _Connection(object):