[email protected] has posted comments on this change. ( http://gerrit.cloudera.org:8080/18098 )
Change subject: KUDU-3197 [tserver] optimal Schema's memory used ...................................................................... Patch Set 5: (2 comments) http://gerrit.cloudera.org:8080/#/c/18098/4//COMMIT_MSG Commit Message: PS4: > Started looking briefly into this, but it seems like a lot of the test-only Yes, I agree with you. And that's my thought when start the work. But changes out of control. If we use std::shared_ptr<Schema>, the changes will be less than scoped_refptr<Schema>. And Kudu recommends scoped_refptr<Schema>. Once we choose Schema extends RefCountedThreadSafe, the commits are the result, the changes are accumulated little by little. Another way is wangningito's way, that's a simple method but not strict, maybe small proability core. wangningito's commit at: https://gerrit.cloudera.org/c/16508/ http://gerrit.cloudera.org:8080/#/c/18098/4/src/kudu/client/schema.h File src/kudu/client/schema.h: http://gerrit.cloudera.org:8080/#/c/18098/4/src/kudu/client/schema.h@732 PS4, Line 732: /// Convert a KuduSchema to a Schema. : /// : /// Private API. : /// : /// @param[in] kudu_schema : /// The KuduSchema to convert : /// @return The converted Schema : static scoped_refptr<Schema> ToSchema(const KuduSchema& kudu_schema) KUDU_NO_EXPORT; > This change doesn't seem necessary to address KUDU-3197 Yes. But Schema extends RefCountedThreadSafe, then the Schema's usage is changed. I have to change it. Schema s; is not valid because deconstruction will check fail. So Schema should use it like this scoped_refptr<Schema> s(new Schema), or use Schema&. The functions which return Schema would cause the problem when deconstruction. A few functions below has changed like this. -- To view, visit http://gerrit.cloudera.org:8080/18098 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4c9cf24475de0b787542761522915a86db6564d7 Gerrit-Change-Number: 18098 Gerrit-PatchSet: 5 Gerrit-Owner: Anonymous Coward <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Anonymous Coward <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Yingchun Lai <[email protected]> Gerrit-Comment-Date: Wed, 22 Dec 2021 11:58:32 +0000 Gerrit-HasComments: Yes
