Sailesh Mukil has posted comments on this change. Change subject: IMPALA-5744: Add dummy 'use_krpc' flag and create DataStream interface ......................................................................
Patch Set 3: > (1 comment) > > Quick question before I get stuck in - did you evaluate the > complexity of building this class hierarchy vs having the users of > the datastream interfaces keeping a pointer to both possible > implementations, and using FLAGS_use_krpc to decide which one to > call into? > > It would be a bit tedious in, e.g. exchange-node.cc - but it would > be self-contained, and it would be easy to undo the changes when we > standardize on one solution. With the class hierarchy approach, I'm > a bit concerned about the amount of code we introduce that will > ultimately be removed. That's a good question. Fortunately, the short answer is that it's easy to undo the changes with this class hierarchy approach. If you have a look at the files, most of the changes are whole file diffs. The users of the interface have almost no code change except for specifying which DataStream* class to use (Thrift or KRPC). When we plan to undo these changes, we can follow these steps: - Completely remove thrift-data-stream-* files. - De-virtualize the DataStream* abstract classes functions. - Move the KRPCDataStream* specific members and functions into the DataStream* class. - Remove the 'use_krpc' flag and the places it's being used in. - Create DataStream* objects always instead of choosing between ThriftDataStream* or KRPCDataStream*. If we choose to not have the abstract classes and just have the users have 2 pointers, one to each implementation, the steps will remain the same except for the 'de-virtualize DataStream*' and 'move KRPCDataStream* into DataStream*' steps, which IMO is not saving us a lot of work. Moreover, the abstract class way seems cleaner. So, I would opt to keep it this way but I'm open to suggestions as well. -- To view, visit http://gerrit.cloudera.org:8080/7542 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d52245154e910529a68f53049520238eca16241 Gerrit-PatchSet: 3 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Sailesh Mukil <[email protected]> Gerrit-Reviewer: Henry Robinson <[email protected]> Gerrit-Reviewer: Michael Ho <[email protected]> Gerrit-Reviewer: Sailesh Mukil <[email protected]> Gerrit-HasComments: No
