You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by da...@apache.org on 2016/06/30 17:23:00 UTC

[2/2] incubator-kudu git commit: add table name field to GetTableSchemaResponsePB

add table name field to GetTableSchemaResponsePB

It is possible for clients to send a GetTableSchema RPC with only the table ID
specified, in which case it is useful to have the table name as part of the
response (in case the client does not know it).

Change-Id: I30c4742274f8946794f6af0f407c8a63804cece6
Reviewed-on: http://gerrit.cloudera.org:8080/3542
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/e0257ea4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/e0257ea4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/e0257ea4

Branch: refs/heads/master
Commit: e0257ea41193694259342859ca10bd710953cdb6
Parents: 6583dff
Author: Dan Burkert <da...@cloudera.com>
Authored: Thu Jun 30 00:07:45 2016 -0700
Committer: Dan Burkert <da...@cloudera.com>
Committed: Thu Jun 30 17:22:42 2016 +0000

----------------------------------------------------------------------
 src/kudu/master/catalog_manager.cc | 1 +
 src/kudu/master/master-test.cc     | 1 +
 src/kudu/master/master.proto       | 3 +++
 3 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/e0257ea4/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 6be1409..0c4bacc 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -1385,6 +1385,7 @@ Status CatalogManager::GetTableSchema(const GetTableSchemaRequestPB* req,
   resp->set_table_id(table->id());
   resp->mutable_partition_schema()->CopyFrom(l.data().pb.partition_schema());
   resp->set_create_table_done(!table->IsCreateInProgress());
+  resp->set_table_name(l.data().pb.name());
 
   return Status::OK();
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/e0257ea4/src/kudu/master/master-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index f3414d5..48dcc67 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -654,6 +654,7 @@ static void LoopGetTableSchema(const char* kTableName,
       CHECK(kSchema->Equals(receivedSchema)) <<
           strings::Substitute("$0 not equal to $1",
                               kSchema->ToString(), receivedSchema.ToString());
+      CHECK_EQ(kTableName, resp.table_name());
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/e0257ea4/src/kudu/master/master.proto
----------------------------------------------------------------------
diff --git a/src/kudu/master/master.proto b/src/kudu/master/master.proto
index 4289bda..4045e4f 100644
--- a/src/kudu/master/master.proto
+++ b/src/kudu/master/master.proto
@@ -506,6 +506,9 @@ message GetTableSchemaResponsePB {
 
   // True if the create operation is completed, false otherwise.
   optional bool create_table_done = 6;
+
+  // The table name.
+  optional string table_name = 7;
 }
 
 // ============================================================================