Zoltan Martonka has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/22420 )

Change subject: [KUDU-3639] Add REST-compatible table operation functions
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/22420/1/src/kudu/master/catalog_manager-test.cc
File src/kudu/master/catalog_manager-test.cc:

http://gerrit.cloudera.org:8080/#/c/22420/1/src/kudu/master/catalog_manager-test.cc@339
PS1, Line 339: TEST_F(CatalogManagerTest, TestCreateTableRpc) {
             :   CreateTableRequestPB req;
             :   CreateTableResponsePB resp;
             :   SchemaPB* schema = req.mutable_schema();
             :   ColumnSchemaPB* col = schema->add_columns();
             :   col->set_name("key");
             :   col->set_type(INT32);
             :   col->set_is_key(true);
             :   ColumnSchemaPB* col2 = schema->add_columns();
             :   col2->set_name("int_val");
             :   col2->set_type(INT32);
             :   req.set_name("test_table");
             :   req.set_owner("default");
             :   req.set_num_replicas(1);
             :   CatalogManager::ScopedLeaderSharedLock 
l(master_->catalog_manager());
             :   ASSERT_OK(master_->catalog_manager()->CreateTable(&req, &resp, 
nullptr));
             : }
             :
             : TEST_F(CatalogManagerTest, TestCreateTableWithUser) {
             :   CreateTableRequestPB req;
             :   CreateTableResponsePB resp;
             :   SchemaPB* schema = req.mutable_schema();
             :   ColumnSchemaPB* col = schema->add_columns();
             :   col->set_name("key");
             :   col->set_type(INT32);
             :   col->set_is_key(true);
             :   ColumnSchemaPB* col2 = schema->add_columns();
             :   col2->set_name("int_val");
             :   col2->set_type(INT32);
             :   req.set_name("test_table");
             :   req.set_owner("default");
             :   req.set_num_replicas(1);
             :   CatalogManager::ScopedLeaderSharedLock 
l(master_->catalog_manager());
             :   const string user = "test_user";
             :   
ASSERT_OK(master_->catalog_manager()->CreateTableWithUser(&req, &resp, user));
             : }
Please make a shared function.
This level of code duplication feels bad even in a test file.


http://gerrit.cloudera.org:8080/#/c/22420/1/src/kudu/master/catalog_manager.h
File src/kudu/master/catalog_manager.h:

http://gerrit.cloudera.org:8080/#/c/22420/1/src/kudu/master/catalog_manager.h@1056
PS1, Line 1056:                           std::optional<rpc::RpcContext*> rpc,
Please leave a sort comment why do u need an optional pointer, when do we have 
+ nullopt (New REST Api??)
+ nullptr (Current RPC API??)
+ a proper object (Current RPC??)

Nothing too serious, but an std::optional<something*> worth a comment.


http://gerrit.cloudera.org:8080/#/c/22420/1/src/kudu/master/catalog_manager.cc
File src/kudu/master/catalog_manager.cc:

http://gerrit.cloudera.org:8080/#/c/22420/1/src/kudu/master/catalog_manager.cc@1909
PS1, Line 1909:     LOG(INFO) << "rpc exists but might be empty: " << 
rpc.value();
Is this log needed?


http://gerrit.cloudera.org:8080/#/c/22420/1/src/kudu/master/catalog_manager.cc@1949
PS1, Line 1949: MonoTime::Max()
Is it ok to wait forever here?


http://gerrit.cloudera.org:8080/#/c/22420/1/src/kudu/master/catalog_manager.cc@3453
PS1, Line 3453:   LOG(INFO) << "rpc value" << rpc.value();
Is this important to log on INFO level?



--
To view, visit http://gerrit.cloudera.org:8080/22420
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If52359603e3aa8af2dedc41ecc5eb78d03151fe5
Gerrit-Change-Number: 22420
Gerrit-PatchSet: 1
Gerrit-Owner: Gabriella Lotz <[email protected]>
Gerrit-Reviewer: Gabriella Lotz <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Zoltan Chovan <[email protected]>
Gerrit-Reviewer: Zoltan Martonka <[email protected]>
Gerrit-Comment-Date: Wed, 29 Jan 2025 17:18:41 +0000
Gerrit-HasComments: Yes

Reply via email to