Alexey Serbin has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/17890


Change subject: WIP KUDU-2671 introduce PartitionKey
......................................................................

WIP KUDU-2671 introduce PartitionKey

This changelist introduces a dedicated PartitionKey data structure to
represent a table's partition key.  The crux is in keeping the hash and
the range part of the key separately, so it's possible to properly work
with such an entity without the context of a particular range or tablet.
Before this patch, encoded partition keys were represented as strings that
had the hash and the range parts concatenated: it was always possible to
properly decode such a key having only table-wide information in the
context because every range has the same hash schema.  However, once
custom hash schemas per range were introduced, now it's impossible to
properly decode such a compound key without knowing the particular hash
schema that was used to encode the key.

The ordering of PartitionKeys in this changelist follows the legacy
notation of comparing the hash part of the key first and then the range
part, but it's going to change in a follow-up changelist because that's
the proper way to do so w.r.t. the logic of the PartitionPruner.
Also, the updated comparison operator for PartitionKey requires
corresponding changes in the catalog manager and client's meta-cache.
I decided to split the changes for easier tracking and reviewing.

As a result, a few new tests scenarios related to using custom hash
schemas per range partition is not working as expected yet because they
require the comparison operator for PartitionKey to be updated.  That
is going to be addressed in a follow-up changelist as well.

WIP:
  * address TODOs to verify that the catalog manager properly reports
    an error to a client for GetTableLocations RPC when a table has
    custom hash partition schema per range, but client doesn't populate
    the newly introduced fields
  * either introduce an extra field to ScanTokenPB (similar to the newly
    added GetTableLocationsRequestPB::partition_key_range field) or rely
    on the ScanTokenPB::tablet_metadata field to extract the hash and
    the range parts out of the strings representing lower and upper scan
    boundaries

Change-Id: I00255ec404beeb999117f5265de0d5d8deaf0d68
---
M src/kudu/client/batcher.cc
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/flex_partitioning_client-test.cc
M src/kudu/client/meta_cache.cc
M src/kudu/client/meta_cache.h
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/partitioner-internal.h
M src/kudu/client/scan_configuration.cc
M src/kudu/client/scan_configuration.h
M src/kudu/client/scan_token-internal.cc
M src/kudu/client/scanner-internal.cc
M src/kudu/client/scanner-internal.h
M src/kudu/common/common.proto
M src/kudu/common/partition-test.cc
M src/kudu/common/partition.cc
M src/kudu/common/partition.h
M src/kudu/common/partition_pruner-test.cc
M src/kudu/common/partition_pruner.cc
M src/kudu/common/partition_pruner.h
M src/kudu/common/scan_spec.cc
M src/kudu/common/scan_spec.h
M src/kudu/integration-tests/table_locations-itest.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/master/catalog_manager.h
M src/kudu/master/master.proto
M src/kudu/master/master_path_handlers.cc
M src/kudu/tools/table_scanner.cc
M src/kudu/tools/tool_action_table.cc
29 files changed, 996 insertions(+), 688 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/17890/3
--
To view, visit http://gerrit.cloudera.org:8080/17890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I00255ec404beeb999117f5265de0d5d8deaf0d68
Gerrit-Change-Number: 17890
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Mahesh Reddy <[email protected]>

Reply via email to