[jira] [Commented] (HBASE-18174) Implement Table#checkAndPut()
[ https://issues.apache.org/jira/browse/HBASE-18174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16045249#comment-16045249 ] Ted Yu commented on HBASE-18174: bq. You are not using the new method BoolFromMutateResponse Okay. I will use it. > Implement Table#checkAndPut() > - > > Key: HBASE-18174 > URL: https://issues.apache.org/jira/browse/HBASE-18174 > Project: HBase > Issue Type: Sub-task >Reporter: Ted Yu > Attachments: 18174.v10.txt, 18174.v11.txt, 18174.v12.txt, > 18174.v1.txt, 18174.v7.lambda.txt, 18174.v9.txt > > > This task is to implement Table#checkAndPut() method -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HBASE-18174) Implement Table#checkAndPut()
[ https://issues.apache.org/jira/browse/HBASE-18174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16045241#comment-16045241 ] Enis Soztutar commented on HBASE-18174: --- Thanks Ted. A nit, but you can use this convenience method: {code} RequestConverter::SetRegion(region_name, pb_msg->mutable_region()); {code} Please run format-patch.sh and address make lint errors if any. - You are not using the new method BoolFromMutateResponse. Do you need to use instead of the lambda? Other than these, looks good. > Implement Table#checkAndPut() > - > > Key: HBASE-18174 > URL: https://issues.apache.org/jira/browse/HBASE-18174 > Project: HBase > Issue Type: Sub-task >Reporter: Ted Yu > Attachments: 18174.v10.txt, 18174.v11.txt, 18174.v12.txt, > 18174.v1.txt, 18174.v7.lambda.txt, 18174.v9.txt > > > This task is to implement Table#checkAndPut() method -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HBASE-18174) Implement Table#checkAndPut()
[ https://issues.apache.org/jira/browse/HBASE-18174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16044759#comment-16044759 ] Ted Yu commented on HBASE-18174: bq. Maybe name this ProcessedFromMutateResponse I choose Bool since it indicates the data type. In this JIRA, the Processed method returns bool. In other patches, a different method may return bool and we may reuse the same response converter. > Implement Table#checkAndPut() > - > > Key: HBASE-18174 > URL: https://issues.apache.org/jira/browse/HBASE-18174 > Project: HBase > Issue Type: Sub-task >Reporter: Ted Yu > Attachments: 18174.v1.txt, 18174.v7.lambda.txt, 18174.v9.txt > > > This task is to implement Table#checkAndPut() method -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HBASE-18174) Implement Table#checkAndPut()
[ https://issues.apache.org/jira/browse/HBASE-18174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16044737#comment-16044737 ] Enis Soztutar commented on HBASE-18174: --- - Can we do the version of checkAndPut that takes the compareOp? This version just delegates to the one that uses equals. We can keep both overloaded versions. {code} + folly::Future CheckAndPut(const std::string &row, const std::string &family, + const std::string &qualifier, const std::string &value, const hbase::Put &put); {code} - This should be named {{CheckAndPutToMutateRequest}}, because we will also do CheckAndMutate, CheckAndDelete, etc. {code} RequestConverter::CheckToMutateRequest {code} - Maybe name this {{ProcessedFromMutateResponse}}. {code} BoolFromMutateResponse {code} - These lines: {code} auto pb_msg = std::static_pointer_cast(checkReq->req_msg()); + pb::RegionSpecifier *region_specifier = pb_msg->mutable_region(); + region_specifier->set_type( + pb::RegionSpecifier_RegionSpecifierType::RegionSpecifier_RegionSpecifierType_REGION_NAME); + region_specifier->set_value(region_name); {code} should go inside the CheckToMutateRequest, no? > Implement Table#checkAndPut() > - > > Key: HBASE-18174 > URL: https://issues.apache.org/jira/browse/HBASE-18174 > Project: HBase > Issue Type: Sub-task >Reporter: Ted Yu > Attachments: 18174.v1.txt, 18174.v7.lambda.txt, 18174.v9.txt > > > This task is to implement Table#checkAndPut() method -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HBASE-18174) Implement Table#checkAndPut()
[ https://issues.apache.org/jira/browse/HBASE-18174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16043430#comment-16043430 ] Ted Yu commented on HBASE-18174: Experimented with the following modification but still got linker error: * changed return type from bool to std::shared_ptr * inlining RequestConverter::CheckToMutateRequest() in the lambda > Implement Table#checkAndPut() > - > > Key: HBASE-18174 > URL: https://issues.apache.org/jira/browse/HBASE-18174 > Project: HBase > Issue Type: Sub-task >Reporter: Ted Yu > Attachments: 18174.v1.txt, 18174.v7.lambda.txt > > > This task is to implement Table#checkAndPut() method -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HBASE-18174) Implement Table#checkAndPut()
[ https://issues.apache.org/jira/browse/HBASE-18174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16042010#comment-16042010 ] Ted Yu commented on HBASE-18174: I was searching for clue and stumbled on: https://stackoverflow.com/questions/35131734/undefined-reference-when-using-lambda > Implement Table#checkAndPut() > - > > Key: HBASE-18174 > URL: https://issues.apache.org/jira/browse/HBASE-18174 > Project: HBase > Issue Type: Sub-task >Reporter: Ted Yu > Attachments: 18174.v1.txt, 18174.v7.lambda.txt > > > This task is to implement Table#checkAndPut() method -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HBASE-18174) Implement Table#checkAndPut()
[ https://issues.apache.org/jira/browse/HBASE-18174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16041710#comment-16041710 ] Ted Yu commented on HBASE-18174: With patch v7 where I use lambda inside RawAsyncTable::CheckAndPut(), I got linker error: {code} /usr/src/hbase/hbase-native-client/buck-out/gen/core/core#default,static/libcore.a(raw-async-table.cc.o): In function `hbase::RawAsyncTable::CheckAndPut(std::string const&, std::string const&, std::string const&, std::string const&, hbase::Put const&)': /usr/src/hbase/hbase-native-client/core/raw-async-table.cc:135: undefined reference to `hbase::AsyncSingleRequestRpcRetryingCaller::Call()' /usr/src/hbase/hbase-native-client/buck-out/gen/core/core#default,static/libcore.a(raw-async-table.cc.o): In function `void __gnu_cxx::new_allocator >::construct, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::string&, hbase::RegionLocateType&, std::function (std::shared_ptr, std::shared_ptr, std::shared_ptr)>&, std::chrono::duration >&, unsigned int&, std::chrono::duration >&, std::chrono::duration >&, unsigned int&>(hbase::AsyncSingleRequestRpcRetryingCaller*, std::shared_ptr&, std::shared_ptr&, std::shared_ptr&, std::string&, hbase::RegionLocateType&, std::function (std::shared_ptr, std::shared_ptr, std::shared_ptr)>&, std::chrono::duration >&, unsigned int&, std::chrono::duration >&, std::chrono::duration >&, unsigned int&)': /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/ext/new_allocator.h:120: undefined reference to `hbase::AsyncSingleRequestRpcRetryingCaller::AsyncSingleRequestRpcRetryingCaller(std::shared_ptr, std::shared_ptr, std::shared_ptr, std::string const&, hbase::RegionLocateType, std::function (std::shared_ptr, std::shared_ptr, std::shared_ptr)>, std::chrono::duration >, unsigned int, std::chrono::duration >, std::chrono::duration >, unsigned int)' {code} > Implement Table#checkAndPut() > - > > Key: HBASE-18174 > URL: https://issues.apache.org/jira/browse/HBASE-18174 > Project: HBase > Issue Type: Sub-task >Reporter: Ted Yu > Attachments: 18174.v1.txt, 18174.v7.lambda.txt > > > This task is to implement Table#checkAndPut() method -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (HBASE-18174) Implement Table#checkAndPut()
[ https://issues.apache.org/jira/browse/HBASE-18174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16041201#comment-16041201 ] Ted Yu commented on HBASE-18174: For RequestConverter::SetRegionToMutateRequest(), when I declare first parameter as {{const std::unique_ptr}}, I got the following compilation error: {code} core/request-converter.cc:302:10: error: call to deleted constructor of 'std::unique_ptr' return std::move( ^~ /usr/bin/../lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/bits/unique_ptr.h:356:7: note: 'unique_ptr' has been explicitly marked deleted here unique_ptr(const unique_ptr&) = delete; ^ 1 error generated. {code} > Implement Table#checkAndPut() > - > > Key: HBASE-18174 > URL: https://issues.apache.org/jira/browse/HBASE-18174 > Project: HBase > Issue Type: Sub-task >Reporter: Ted Yu > Attachments: 18174.v1.txt > > > This task is to implement Table#checkAndPut() method -- This message was sent by Atlassian JIRA (v6.3.15#6346)