You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by jd...@apache.org on 2016/02/05 21:53:49 UTC
[5/5] incubator-kudu git commit: [c++ client] - Remove KuduSchema
from KuduScanBatch::RowPtr
[c++ client] - Remove KuduSchema from KuduScanBatch::RowPtr
Todd manifested concern that this was making the pointer less like a pure
pointer, i.e. more bloated.
The main reason this was made available here at all was that the python
client was still using KuduRowResult and thus needed it. Since that is
no longer the case this field (and its accessors) can be removed.
Change-Id: I8aff27ac92babf4dc8b917cbe01c04e23b15de2a
Reviewed-on: http://gerrit.cloudera.org:8080/2065
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <to...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/c68509b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/c68509b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/c68509b4
Branch: refs/heads/master
Commit: c68509b4d29d050d6264f5ef189f86e3fe221997
Parents: 8581923
Author: David Alves <da...@cloudera.com>
Authored: Thu Feb 4 20:34:50 2016 -0800
Committer: David Ribeiro Alves <da...@cloudera.com>
Committed: Fri Feb 5 20:44:11 2016 +0000
----------------------------------------------------------------------
src/kudu/client/scan_batch.cc | 4 ----
src/kudu/client/scan_batch.h | 5 -----
src/kudu/client/scanner-internal.cc | 2 +-
src/kudu/client/scanner-internal.h | 2 +-
4 files changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c68509b4/src/kudu/client/scan_batch.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/scan_batch.cc b/src/kudu/client/scan_batch.cc
index fef9c98..f2ad8ce 100644
--- a/src/kudu/client/scan_batch.cc
+++ b/src/kudu/client/scan_batch.cc
@@ -217,10 +217,6 @@ const void* KuduScanBatch::RowPtr::cell(int col_idx) const {
return row_data_ + schema_->column_offset(col_idx);
}
-const KuduSchema* KuduScanBatch::RowPtr::row_schema() const {
- return client_schema_;
-}
-
//------------------------------------------------------------
// Template instantiations: We instantiate all possible templates to avoid linker issues.
// see: https://isocpp.org/wiki/faq/templates#separate-template-fn-defn-from-decl
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c68509b4/src/kudu/client/scan_batch.h
----------------------------------------------------------------------
diff --git a/src/kudu/client/scan_batch.h b/src/kudu/client/scan_batch.h
index 073b5e3..9ca593e 100644
--- a/src/kudu/client/scan_batch.h
+++ b/src/kudu/client/scan_batch.h
@@ -143,8 +143,6 @@ class KUDU_EXPORT KuduScanBatch::RowPtr {
// Raw cell access. Should be avoided unless absolutely necessary.
const void* cell(int col_idx) const;
- const KuduSchema* row_schema() const;
-
std::string ToString() const;
private:
@@ -154,10 +152,8 @@ class KUDU_EXPORT KuduScanBatch::RowPtr {
// Only invoked by KuduScanner.
RowPtr(const Schema* schema,
- const KuduSchema* client_projection,
const uint8_t* row_data)
: schema_(schema),
- client_schema_(client_projection),
row_data_(row_data) {
}
@@ -168,7 +164,6 @@ class KUDU_EXPORT KuduScanBatch::RowPtr {
Status Get(int col_idx, typename T::cpp_type* val) const;
const Schema* schema_;
- const KuduSchema* client_schema_;
const uint8_t* row_data_;
};
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c68509b4/src/kudu/client/scanner-internal.cc
----------------------------------------------------------------------
diff --git a/src/kudu/client/scanner-internal.cc b/src/kudu/client/scanner-internal.cc
index 68b1ca8..aad99e4 100644
--- a/src/kudu/client/scanner-internal.cc
+++ b/src/kudu/client/scanner-internal.cc
@@ -528,7 +528,7 @@ void KuduScanBatch::Data::ExtractRows(vector<KuduScanBatch::RowPtr>* rows) {
const uint8_t* src = direct_data_.data();
KuduScanBatch::RowPtr* dst = &(*rows)[0];
while (n_rows > 0) {
- *dst = KuduScanBatch::RowPtr(projection_, client_projection_,src);
+ *dst = KuduScanBatch::RowPtr(projection_, src);
dst++;
src += projected_row_size_;
n_rows--;
http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/c68509b4/src/kudu/client/scanner-internal.h
----------------------------------------------------------------------
diff --git a/src/kudu/client/scanner-internal.h b/src/kudu/client/scanner-internal.h
index 0c53005..9cf5ad2 100644
--- a/src/kudu/client/scanner-internal.h
+++ b/src/kudu/client/scanner-internal.h
@@ -186,7 +186,7 @@ class KuduScanBatch::Data {
DCHECK_GE(idx, 0);
DCHECK_LT(idx, num_rows());
int offset = idx * projected_row_size_;
- return KuduRowResult(projection_, client_projection_, &direct_data_[offset]);
+ return KuduRowResult(projection_, &direct_data_[offset]);
}
void ExtractRows(vector<KuduScanBatch::RowPtr>* rows);