[ 
https://issues.apache.org/jira/browse/HBASE-18507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16112083#comment-16112083
 ] 

Enis Soztutar commented on HBASE-18507:
---------------------------------------

Thanks Sudeep for the patch. 
- Since you are doing templating for the response, would it be cleaner to do 
templating for the Get / Put as well. Within a batch, it will never be more 
than 1 type of requests, so maybe we can see whether that is better than doing 
{{shared_ptr<Row>}}. If not, we can stick with {{shared_ptr<Row>}}. 
- You should use std::make_shared<>() instead. 
{code}
+      Row *rowp = new hbase::Put(put);
{code}
- This is not needed: 
{code}
+  std::vector<folly::Unit> results{};
{code}
- If we can do this logic with the templates, I think it will be better: 
{code}
+      auto getp = dynamic_cast<hbase::Get *>(pget.get());
+      if (getp == nullptr) {
+        auto putp = dynamic_cast<hbase::Put *>(pget.get());
+        if (putp == nullptr) {
+          //TODO throw exception ???
+          LOG(ERROR)<< "This is not Get/Put";
+        } else {
+          
pb_action->set_allocated_mutation(RequestConverter::ToMutation(MutationType::MutationProto_MutationType_PUT,
 *putp, -1).release());
+          pb_action->set_index(action_num);
+        }
+      } else {
+        pb_action->set_allocated_get(RequestConverter::ToGet(*getp).release());
+        pb_action->set_index(action_num);
+      }
{code}
If not, instead you should use {{typeid}} to check the type, instead of using 
dynamic_cast directly. 


> [C++] Support for MultiPuts in AsyncBatchRpcRetryingCaller class
> ----------------------------------------------------------------
>
>                 Key: HBASE-18507
>                 URL: https://issues.apache.org/jira/browse/HBASE-18507
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Sudeep Sunthankar
>            Assignee: Sudeep Sunthankar
>         Attachments: HBASE-18507.HBASE-14850.v1.patch
>
>
> We will be addressing Multi Puts changes to AsyncBatchRpcRetryingCaller class 
> here



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to