kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/8] kudu git commit: KUDU-1113 pushed predicates not displaying on scans web page
Date Wed, 07 Sep 2016 00:22:00 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 346b63d9c -> 6a12ba3f7


KUDU-1113 pushed predicates not displaying on scans web page

This fixes Scanner so it will display predicates in /scanz. A Scanner
is constructed with a reference to its ScanSpec, but the predicates
in the ScanSpec are removed by the Scanner's iterator as they are
pushed down to lower iterators.

The Scanner now holds a copy of the ScanSpec, from just before the
ScanSpec is pass to the iterator and (potentially) modified.

Change-Id: I21821a1f7b5e4d5e5e1bdec17353ae5f3ef8e408
Reviewed-on: http://gerrit.cloudera.org:8080/4206
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <dan@cloudera.com>
Reviewed-by: Todd Lipcon <todd@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/55167611
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/55167611
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/55167611

Branch: refs/heads/master
Commit: 551676116a5d15cdbce06c98821a69bc3e5df1b5
Parents: 346b63d
Author: Will Berkeley <wdberkeley@gmail.com>
Authored: Sat Aug 20 19:18:34 2016 -0400
Committer: Todd Lipcon <todd@apache.org>
Committed: Tue Sep 6 18:10:43 2016 +0000

----------------------------------------------------------------------
 src/kudu/tserver/scanners.cc       | 2 +-
 src/kudu/tserver/tablet_service.cc | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/55167611/src/kudu/tserver/scanners.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/scanners.cc b/src/kudu/tserver/scanners.cc
index e698b61..9786c65 100644
--- a/src/kudu/tserver/scanners.cc
+++ b/src/kudu/tserver/scanners.cc
@@ -110,7 +110,7 @@ void ScannerManager::NewScanner(const scoped_refptr<TabletPeer>&
tablet_peer,
   while (!success) {
     // TODO(security): are these UUIDs predictable? If so, we should
     // probably generate random numbers instead, since we can safely
-    // just retry until we avoid a collission.
+    // just retry until we avoid a collision.
     string id = oid_generator_.Next();
     scanner->reset(new Scanner(id, tablet_peer, requestor_string, metrics_.get()));
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/55167611/src/kudu/tserver/tablet_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/tablet_service.cc b/src/kudu/tserver/tablet_service.cc
index fb3443e..34013a8 100644
--- a/src/kudu/tserver/tablet_service.cc
+++ b/src/kudu/tserver/tablet_service.cc
@@ -1484,6 +1484,12 @@ Status TabletServiceImpl::HandleNewScanRequest(TabletPeer* tablet_peer,
     }
   }
 
+  // Make a copy of the optimized spec before it's passed to the iterator.
+  // This copy will be given to the Scanner so it can report its predicates to
+  // /scans. The copy is necessary because the original spec will be modified
+  // as its predicates are pushed into lower-level iterators.
+  gscoped_ptr<ScanSpec> orig_spec(new ScanSpec(*spec));
+
   if (PREDICT_TRUE(s.ok())) {
     TRACE_EVENT0("tserver", "iter->Init");
     s = iter->Init(spec.get());
@@ -1511,7 +1517,7 @@ Status TabletServiceImpl::HandleNewScanRequest(TabletPeer* tablet_peer,
     return Status::OK();
   }
 
-  scanner->Init(std::move(iter), std::move(spec));
+  scanner->Init(std::move(iter), std::move(orig_spec));
   unreg_scanner.Cancel();
   *scanner_id = scanner->id();
 


Mime
View raw message