| // Copyright 2011-2015 Quickstep Technologies LLC. |
| // Copyright 2015-2016 Pivotal Software, Inc. |
| // Copyright 2016, Quickstep Research Group, Computer Sciences Department, |
| // University of Wisconsin—Madison. |
| // |
| // Licensed 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. |
| |
| syntax = "proto2"; |
| |
| package quickstep.serialization; |
| |
| import "storage/StorageBlockLayout.proto"; |
| import "types/Type.proto"; |
| import "types/TypedValue.proto"; |
| |
| message CatalogAttribute { |
| required string name = 1; |
| required Type type = 2; |
| optional string display_name = 3; |
| } |
| |
| // TODO(zuyu): Move PartitionScheme to a dedicate proto file. |
| message PartitionSchemeHeader { |
| enum PartitionType { |
| HASH = 0; |
| RANGE = 1; |
| } |
| |
| required PartitionType partition_type = 1; |
| |
| required uint64 num_partitions = 2; |
| required uint32 partition_attribute_id = 3; |
| |
| // The convention for extension numbering is that extensions for a particular |
| // PartitionType should begin from (partition_type + 1) * 16. |
| extensions 16 to max; |
| } |
| |
| message RangePartitionSchemeHeader { |
| extend PartitionSchemeHeader { |
| // All required. |
| repeated TypedValue partition_range_boundaries = 32; |
| } |
| } |
| |
| message Partition { |
| repeated fixed64 blocks = 1 [packed=true]; |
| } |
| |
| message PartitionScheme { |
| required PartitionSchemeHeader header = 1; |
| repeated Partition partitions = 2; |
| } |
| |
| message NUMAPlacementScheme { |
| required uint32 num_numa_nodes = 1; |
| |
| message BlockToNUMANodeEntry { |
| required fixed64 block_id = 1; |
| required int32 numa_node = 2; |
| } |
| repeated BlockToNUMANodeEntry block_to_numa_node_map = 2; |
| } |
| |
| message IndexScheme { |
| message IndexEntry { |
| required string index_name = 1; |
| required IndexSubBlockDescription index_description = 2; |
| } |
| repeated IndexEntry index_entries = 1; |
| } |
| |
| message CatalogRelationSchema { |
| required int32 relation_id = 1; |
| required string name = 2; |
| required bool temporary = 3; |
| |
| repeated CatalogAttribute attributes = 4; |
| |
| extensions 16 to max; |
| } |
| |
| message CatalogRelation { |
| extend CatalogRelationSchema { |
| // Required. |
| optional StorageBlockLayoutDescription default_layout = 16; |
| |
| repeated fixed64 blocks = 17 [packed=true]; |
| optional IndexScheme index_scheme = 18; |
| optional PartitionScheme partition_scheme = 19; |
| optional NUMAPlacementScheme placement_scheme = 20; |
| } |
| } |
| |
| message CatalogDatabase { |
| required string name = 1; |
| repeated CatalogRelationSchema relations = 2; |
| repeated int32 null_relations = 3; |
| } |
| |
| message Catalog { |
| repeated CatalogDatabase databases = 1; |
| } |