Todd Lipcon has submitted this change and it was merged. ( )

Change subject: wire_protocol: some simplification and optimization for rowwise 

wire_protocol: some simplification and optimization for rowwise encoding

* Re-implement GetSelectedRows based on the new ForEachSetBit(...)
  utility, which operates word-by-word instead of byte-by-byte.

* use a boolean return value which indicates the common case of "all
  rows are selected". Currently the rowwise serialization code path
  doesn't use this special value (and just reproduces the old
  std::iota() call to generate the sequence of all indexes), but the
  columnar code path will special case this as a memcpy.

* Avoid one call to CountSelected() in SerializeRowBlock() by calculating
  num_rows from the size of the row index vector.

* Change SerializeRowBlock() to return an int indicating the number of
  rows selected, instead of accumulating it into the protobuf. This
  value can then be re-used to eliminate one extra call to CountSelected
  in ScanResultCopier::HandleRowBlock().

  After this change, the protobuf is no longer used by
  SerializeRowBlock, so I removed the parameter, which required a bit of
  fixup in the tests.

Change-Id: I24dfb1bd036fde514ca6494bae0ddc171dd225dd
Reviewed-by: Grant Henke <>
Tested-by: Todd Lipcon <>
M src/kudu/common/
M src/kudu/common/
M src/kudu/common/rowblock.h
M src/kudu/common/
M src/kudu/common/
M src/kudu/common/wire_protocol.h
M src/kudu/tserver/
7 files changed, 89 insertions(+), 67 deletions(-)

  Grant Henke: Looks good to me, approved
  Todd Lipcon: Verified

To view, visit
To unsubscribe, visit

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I24dfb1bd036fde514ca6494bae0ddc171dd225dd
Gerrit-Change-Number: 15550
Gerrit-PatchSet: 4
Gerrit-Owner: Todd Lipcon <>
Gerrit-Reviewer: Andrew Wong <>
Gerrit-Reviewer: Andrew Wong <>
Gerrit-Reviewer: Grant Henke <>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Todd Lipcon <>

Reply via email to