[ https://issues.apache.org/jira/browse/KUDU-388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Grant Henke updated KUDU-388: ----------------------------- Summary: Simplify C++ KuduScanner iteration API (was: Simplify KuduScanner iteration API) > Simplify C++ KuduScanner iteration API > -------------------------------------- > > Key: KUDU-388 > URL: https://issues.apache.org/jira/browse/KUDU-388 > Project: Kudu > Issue Type: Improvement > Components: api, client > Affects Versions: M5 > Reporter: Vladimir Feinberg > Priority: Major > > Currently, the {{KuduScanner}} for the C++ client has an iteration API that > always results in the following (verbose) code pattern: > {code} > vector<KuduRowResult> rows; > while (scanner.HasMoreRows()) { > CHECK_OK(scanner.NextBatch(&rows)); > BOOST_FOREACH(const KuduRowResult& row, rows) { > DoStuffWithRow(row); > } > rows.clear(); > } > {code} > On top of the extra avoidable LOCs, the client has to manage individual > batches and clear the vector. This batching should be done internally by the > scanner, probably in the same manner above, but only exposing a {{bool > HasNext()}} and {{const KuduRowResult& GetNext()}} interface. The simpler > interface has another advantage in that it would allow us to change the way > we gather rows while keeping the implementation details away from the client. > See discussion below for further API considerations. -- This message was sent by Atlassian Jira (v8.3.4#803005)