kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject [1/2] incubator-kudu git commit: KUDU-1312: scan token protobuf message format
Date Sat, 16 Apr 2016 15:00:20 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 8a3e461f8 -> 22160e33c


KUDU-1312: scan token protobuf message format

Adds a protobuf message format for scan tokens, so that clients from different
platforms have a shared serialization format. Integrating scan tokens into the
Java and C++ clients is left to a follow-up commit.

Change-Id: I09983d71c81a383cf4e0e24a49367c64960bbd4d
Reviewed-on: http://gerrit.cloudera.org:8080/2622
Reviewed-by: Adar Dembo <adar@cloudera.com>
Tested-by: Kudu Jenkins
Reviewed-by: Jean-Daniel Cryans


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

Branch: refs/heads/master
Commit: 2d3b64365d4ab27ac603b4e4c7722fc1d737ac3a
Parents: 8a3e461
Author: Dan Burkert <dan@cloudera.com>
Authored: Thu Mar 24 15:18:46 2016 -0700
Committer: Jean-Daniel Cryans <jdcryans@gerrit.cloudera.org>
Committed: Fri Apr 15 03:15:17 2016 +0000

----------------------------------------------------------------------
 src/kudu/client/CMakeLists.txt | 21 +++++++--
 src/kudu/client/client.proto   | 93 +++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/2d3b6436/src/kudu/client/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/kudu/client/CMakeLists.txt b/src/kudu/client/CMakeLists.txt
index 48625b2..8716622 100644
--- a/src/kudu/client/CMakeLists.txt
+++ b/src/kudu/client/CMakeLists.txt
@@ -15,6 +15,18 @@
 # specific language governing permissions and limitations
 # under the License.
 
+PROTOBUF_GENERATE_CPP(
+  CLIENT_PROTO_SRCS CLIENT_PROTO_HDRS CLIENT_PROTO_TGTS
+  SOURCE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..
+  BINARY_ROOT ${CMAKE_CURRENT_BINARY_DIR}/../..
+  PROTO_FILES client.proto)
+set(CLIENT_PROTO_LIBS
+  kudu_common_proto)
+ADD_EXPORTABLE_LIBRARY(client_proto
+  SRCS ${CLIENT_PROTO_SRCS}
+  DEPS ${CLIENT_PROTO_LIBS}
+  NONLINK_DEPS ${CLIENT_PROTO_TGTS})
+
 set(CLIENT_SRCS
   batcher.cc
   client.cc
@@ -38,14 +50,15 @@ set(CLIENT_SRCS
 )
 
 set(CLIENT_LIBS
+  client_proto
+  gutil
+  krpc
   kudu_common
+  kudu_util
   master_proto
   master_rpc
   tserver_proto
-  tserver_service_proto
-  kudu_util
-  gutil
-  krpc)
+  tserver_service_proto)
 
 # Make sure we exclude tcmalloc from the exported library; we want the library
 # code to use the linking application's malloc implementation.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/2d3b6436/src/kudu/client/client.proto
----------------------------------------------------------------------
diff --git a/src/kudu/client/client.proto b/src/kudu/client/client.proto
new file mode 100644
index 0000000..8a2bdd0
--- /dev/null
+++ b/src/kudu/client/client.proto
@@ -0,0 +1,93 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// Protobufs which are specific to client implementations.
+
+package kudu.client;
+
+option java_package = "org.kududb.client";
+
+import "kudu/common/common.proto";
+
+// Serialization format for client scan tokens. Scan tokens are serializable
+// scan descriptors that are used by query engines to plan a set of parallizable
+// scanners that are executed on remote task runners. The scan token protobuf
+// format includes all of the information necessary to recreate a scanner in the
+// remote task.
+message ScanTokenPB {
+
+  // Features used by the scan token message. Every time the ScanTokenPB message
+  // is updated with a new feature, the feature should be added to this enum, so
+  // that clients that lack the feature can recognize when they receive a token
+  // that uses unknown features.
+  enum Feature {
+    Unknown = 0;
+  }
+
+  // The feature set used by this scan token.
+  repeated Feature feature_flags = 1;
+
+  // The table to scan.
+  optional string table_name = 2;
+
+  // Which columns to select.
+  // if this is an empty list, no data will be returned, but the num_rows
+  // field of the returned RowBlock will indicate how many rows passed
+  // the predicates. Note that in some cases, the scan may still require
+  // multiple round-trips, and the caller must aggregate the counts.
+  repeated ColumnSchemaPB projected_columns = 3;
+
+  // Any column predicates to enforce.
+  repeated ColumnPredicatePB column_predicates = 4;
+
+  // Encoded primary key to begin scanning at (inclusive).
+  optional bytes lower_bound_primary_key = 5;
+
+  // Encoded primary key to stop scanning at (exclusive).
+  optional bytes upper_bound_primary_key = 6;
+
+  // Encoded partition key to begin scanning at (inclusive).
+  optional bytes lower_bound_partition_key = 7;
+
+  // Encoded partition key to stop scanning at (exclusive).
+  optional bytes upper_bound_partition_key = 8;
+
+  // The maximum number of rows to scan.
+  // The scanner will automatically stop yielding results and close
+  // itself after reaching this number of result rows.
+  optional uint64 limit = 9;
+
+  // The read mode for this scan request.
+  // See common.proto for further information about read modes.
+  optional ReadMode read_mode = 10 [default = READ_LATEST];
+
+  // The requested snapshot timestamp. This is only used
+  // when the read mode is set to READ_AT_SNAPSHOT.
+  optional fixed64 snap_timestamp = 11;
+
+  // Sent by clients which previously executed CLIENT_PROPAGATED writes.
+  // This updates the server's time so that no transaction will be assigned
+  // a timestamp lower than or equal to 'previous_known_timestamp'
+  optional fixed64 propagated_timestamp = 12;
+
+  // Whether data blocks will be cached when read from the files or discarded after use.
+  // Disable this to lower cache churn when doing large scans.
+  optional bool cache_blocks = 13 [default = true];
+
+  // Whether the scan should be fault tolerant.
+  optional bool fault_tolerant = 14 [default = false];
+}


Mime
View raw message