/* * Copyright 2021 4Paradigm * * 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"; import "type.proto"; package openmldb.common; option cc_generic_services = false; option java_package = "com._4paradigm.openmldb.proto"; option java_outer_classname = "Common"; message KvPair { optional int64 time = 1; optional bytes value = 2; } message KvList { optional string pk = 1; repeated KvPair pairs = 2; } message VersionPair { optional int32 id = 1; optional int32 field_count = 2; } message DbTableNamePair { required string db_name = 1; required string table_name = 2; } message TableColumnSchema { optional string name = 1; optional openmldb.type.DataType type = 2; repeated TableColumnSchema type_fields = 3; optional bool not_null = 4 [default = false]; } message ColumnDesc { required string name = 1; optional openmldb.type.DataType data_type = 2; optional bool not_null = 3 [default = false]; optional bool is_constant = 4 [default = false]; optional string default_value = 5; // replacing ColumnDesc::data_type and ColumnDesc::not_null optional TableColumnSchema schema = 6; } message TTLSt { optional openmldb.type.TTLType ttl_type = 1 [default = kAbsoluteTime]; optional uint64 abs_ttl = 2 [default = 0]; // unit: min optional uint64 lat_ttl = 3 [default = 0]; } enum IndexType { kCovering = 0; kClustered = 1; kSecondary = 2; } message ColumnKey { optional string index_name = 1; repeated string col_name = 2; optional string ts_name = 3; optional uint32 flag = 4 [default = 0]; // 0 mean index exist, 1 mean index has been deleted optional TTLSt ttl = 5; optional IndexType type = 6 [default = kCovering]; } message EndpointAndTid { optional string endpoint = 1; optional uint32 tid = 2; } message PartitionMeta { optional string endpoint = 1; optional bool is_leader = 2; optional bool is_alive = 3 [default = true]; } message TablePartition { optional uint32 pid = 1; repeated PartitionMeta partition_meta = 2; } message CatalogInfo { optional uint64 version = 1; optional string endpoint = 2; } enum StorageMode { kUnknown = 0; kMemory = 1; kSSD = 2; kHDD = 3; } message ExternalFun { optional string name = 1; optional openmldb.type.DataType return_type = 2; repeated openmldb.type.DataType arg_type = 3; optional bool is_aggregate = 4 [default = false]; optional string file = 5; optional bool return_nullable = 6 [default = false]; optional bool arg_nullable = 7 [default = false]; }