Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/15042 )
Change subject: cfile: change BlockBuilder API to yield a vector of Slices ...................................................................... Patch Set 1: (9 comments) http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/binary_dict_block.cc File src/kudu/cfile/binary_dict_block.cc: http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/binary_dict_block.cc@65 PS1, Line 65: void BinaryDictBlockBuilder::Reset() { Is it necessary to clear the buffer_ member as well? http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/binary_dict_block.cc@85 PS1, Line 85: data_slices.insert(data_slices.begin(), Slice(buffer_)); : *slices = std::move(data_slices); Inserting into the beginning of a vector is not the best option from the performance perspective. Maybe, replace with: vector<Slice> ret{ Slice(buffer_) }; std::move(data_slices.begin(), data_slices.end(), std::back_inserter(ret)); *slices = std::move(ret); http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/binary_plain_block.h File src/kudu/cfile/binary_plain_block.h: http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/binary_plain_block.h@85 PS1, Line 85: static const size_t kHeaderSize = sizeof(uint32_t) * 3; nit: would it benefit from adding constexpr ? http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/binary_plain_block.cc File src/kudu/cfile/binary_plain_block.cc: http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/binary_plain_block.cc@59 PS1, Line 59: buffer_.resize(kHeaderSize); : buffer_.reserve(options_->storage_attributes.cfile_block_size); Would it be more optimal to switch these two lines? http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/bshuf_block.h File src/kudu/cfile/bshuf_block.h: http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/bshuf_block.h@53 PS1, Line 53: using std::vector; Is it really needed? In general, adding 'using' into headers is not a good idea. http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/cfile_writer.cc File src/kudu/cfile/cfile_writer.cc: http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/cfile_writer.cc@399 PS1, Line 399: null_bitmap nit: wrap into std::move() ? http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/cfile_writer.cc@401 PS1, Line 401: for (const auto& s : data_slices) { : v.emplace_back(s); : } nit: consider instead std::move(data_slices.begin(), data_slices.end(), std::back_inserter(v)); http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/encoding-test.cc File src/kudu/cfile/encoding-test.cc: http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/encoding-test.cc@127 PS1, Line 127: contiguous_buf_ Is it possible to use just a local variable instead this member field and make this method static? http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/rle_block.h File src/kudu/cfile/rle_block.h: http://gerrit.cloudera.org:8080/#/c/15042/1/src/kudu/cfile/rle_block.h@78 PS1, Line 78: buf_ Slice(buf_) ? Or the compiler is smart enough to wrap it into a Slice itself? -- To view, visit http://gerrit.cloudera.org:8080/15042 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifc7a5f148a4a43cedac2428f4c1a18d0f93a10db Gerrit-Change-Number: 15042 Gerrit-PatchSet: 1 Gerrit-Owner: Todd Lipcon <t...@apache.org> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Thu, 16 Jan 2020 01:50:57 +0000 Gerrit-HasComments: Yes