// Copyright 2021 PingCAP, Inc.
//
// 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,
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";
package benchmark;

option java_package = "io.tidb.bigdata.cdc.craft";
option java_outer_classname = "CraftBenchmark";
option optimize_for = SPEED;

message Key {
	uint64 ts = 1;
  string schema = 2;
  string table = 3;
  int64 row_id = 4;
  uint32 type = 5;
  int64 partition = 6;
}

message Column {
  string name = 1;
  uint32 type = 2;
  uint32 flag = 3;
  bytes value = 4;
}

message RowChanged {
  repeated Column old_value = 1;
  repeated Column new_value = 2;
}

message KeysColumnar {
  repeated uint64 ts = 1;
  repeated string schema = 2;
  repeated string table = 3;
  repeated int64 row_id = 4;
  repeated uint32 type = 5;
  repeated int64 partition = 6;
}

message ColumnsColumnar {
  repeated string name = 1;
  repeated uint32 type = 2;
  repeated bool where_handle = 3;
  repeated uint32 flag = 4;
  repeated bytes value = 5;
}

message RowChangedColumnar {
  repeated ColumnsColumnar old_value = 1;
  repeated ColumnsColumnar new_value = 2;
}
