Skip to content

Commit

Permalink
Removing methods from TableConnection already implemented in Table.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Jul 28, 2015
1 parent 87f5300 commit b9117af
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 84 deletions.
61 changes: 0 additions & 61 deletions gcloud_bigtable/table_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,67 +97,6 @@ def create_table(self, cluster_name, table_id, initial_split_keys=None,

return result_pb

def list_tables(self, cluster_name, timeout_seconds=TIMEOUT_SECONDS):
"""List tables in an existing cluster.
:type cluster_name: string
:param cluster_name: The name of the cluster containing the list of
tables. Must be of the form
"projects/../zones/../clusters/.."
Since this is a low-level class, we don't check
this, rather we expect callers to pass correctly
formatted data.
:type timeout_seconds: integer
:param timeout_seconds: Number of seconds for request time-out.
If not passed, defaults to ``TIMEOUT_SECONDS``.
:rtype: :class:`messages_pb2.ListTablesResponse`
:returns: The list of tables retrieved.
"""
request_pb = messages_pb2.ListTablesRequest(name=cluster_name)
result_pb = None
stub = make_stub(self._credentials, TABLE_STUB_FACTORY,
TABLE_ADMIN_HOST, PORT)
with stub:
response = stub.ListTables.async(request_pb, timeout_seconds)
result_pb = response.result()

return result_pb

def get_table(self, cluster_name, table_id,
timeout_seconds=TIMEOUT_SECONDS):
"""Gets table metadata.
:type cluster_name: string
:param cluster_name: The name of the cluster where the table will be
created. Must be of the form
"projects/../zones/../clusters/.."
Since this is a low-level class, we don't check
this, rather we expect callers to pass correctly
formatted data.
:type table_id: string
:param table_id: The name of the table within the cluster.
:type timeout_seconds: integer
:param timeout_seconds: Number of seconds for request time-out.
If not passed, defaults to ``TIMEOUT_SECONDS``.
:rtype: :class:`._generated.bigtable_table_data_pb2.Table`
:returns: The response object for the get table request.
"""
table_name = '%s/tables/%s' % (cluster_name, table_id)
request_pb = messages_pb2.GetTableRequest(name=table_name)
result_pb = None
stub = make_stub(self._credentials, TABLE_STUB_FACTORY,
TABLE_ADMIN_HOST, PORT)
with stub:
response = stub.GetTable.async(request_pb, timeout_seconds)
result_pb = response.result()

return result_pb

def delete_table(self, cluster_name, table_id,
timeout_seconds=TIMEOUT_SECONDS):
"""Deletes a table.
Expand Down
23 changes: 0 additions & 23 deletions gcloud_bigtable/test_table_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,6 @@ def test_create_table(self):
def test_create_table_without_split_keys(self):
self._create_table_test_helper()

def test_list_tables(self):
from gcloud_bigtable._generated import (
bigtable_table_service_messages_pb2 as messages_pb2)

request_obj = messages_pb2.ListTablesRequest(name=CLUSTER_NAME)

def call_method(connection):
return connection.list_tables(CLUSTER_NAME)

self._grpc_call_helper(call_method, 'ListTables', request_obj)

def test_get_table(self):
from gcloud_bigtable._generated import (
bigtable_table_service_messages_pb2 as messages_pb2)

table_name = '%s/tables/%s' % (CLUSTER_NAME, TABLE_ID)
request_obj = messages_pb2.GetTableRequest(name=table_name)

def call_method(connection):
return connection.get_table(CLUSTER_NAME, TABLE_ID)

self._grpc_call_helper(call_method, 'GetTable', request_obj)

def test_delete_table(self):
from gcloud_bigtable._generated import (
bigtable_table_service_messages_pb2 as messages_pb2)
Expand Down

0 comments on commit b9117af

Please sign in to comment.