Dan Burkert has posted comments on this change.

Change subject: [c++-client] implement scan token API
......................................................................


Patch Set 9:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/2757/9/src/kudu/client/scanner-internal.h
File src/kudu/client/scanner-internal.h:

Line 187:   sp::shared_ptr<KuduTable> table_;
> What's the motivation for this change? KuduScanner's constructor explains h
The motivation is that when deserializing a scan token into a scanner, there is 
no owner for the KuduTable, so when the deserialization is done the table would 
otherwise be destructed, leaving the scanner with a pointer to a deallocated 
KuduTable.

I can update the doc on KuduScanner's constructor, but I didn't want to 'change 
the contract' without a bit more thought going into it.  The shared_from_this 
shenanigans is done so that the ctor arguments don't need to change type.

Finally, (in my opinion) this seems like a good change design wise.  The 
KuduTable is a child of the client used to create it, and thus holds a strong 
reference to it.  The KuduScanner has a similar relationship with the 
KuduTable, so it makes sense for it to hold a strong reference.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If28e653a9b28164741a3c6f36097f0b7c72e8162
Gerrit-PatchSet: 9
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Dan Burkert <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-HasComments: Yes

Reply via email to