import "mapreduce/yt/interface/protos/extension.proto";
import "saas/protos/rtyserver.proto";

package NSaas;

message TYTBlobBase {
    optional uint32 ShardMin    = 1 [(NYT.column_name) = "shard_min"];
    optional uint32 ShardMax    = 2 [(NYT.column_name) = "shard_max"];
    optional string Name        = 3 [(NYT.column_name) = "name"];
    optional uint32 PartIndex   = 4 [(NYT.column_name) = "part_index"];
    optional bytes  Data        = 5 [(NYT.column_name) = "data"];
    optional uint32 DataLength  = 6 [(NYT.column_name) = "data_length"];
    optional uint32 SegmentId   = 7 [(NYT.column_name) = "segment_id"];
}

message TYTNewBlobBase {
    optional uint32 ShardMin    = 1 [(NYT.column_name) = "shard_min"];
    optional uint32 ShardMax    = 2 [(NYT.column_name) = "shard_max"];
    optional string Filename    = 3 [(NYT.column_name) = "filename"];
    optional int64  PartIndex   = 4 [(NYT.column_name) = "part_index"];
    optional bytes  Data        = 5 [(NYT.column_name) = "data"];
    optional int64  DataSize    = 6 [(NYT.column_name) = "data_size"];
    optional uint32 SegmentId   = 7 [(NYT.column_name) = "segment_id"];
}

message TYTDocumentBase {
    optional uint32 ShardIndex  = 1 [(NYT.column_name) = "shard_index"];
    optional uint32 ShardMin    = 2 [(NYT.column_name) = "shard_min"];
    optional uint64 ShardMax    = 3 [(NYT.column_name) = "shard_max"];
    optional NRTYServer.TMessage.TDocument Document = 4 [(NYT.column_name) = "document"];
    optional uint32 SegmentId   = 5 [(NYT.column_name) = "segment_id"];
    optional bool   IsDeleted   = 6 [(NYT.column_name) = "is_deleted"];
}

message TYTIndexError {
    option (NYT.default_field_flags) = SERIALIZATION_YT;

    optional string Url = 1;
    optional NRTYServer.TMessage.TDocument Document = 2;
    optional string Error = 3;
}

message TYTReqansRecord {
    option (NYT.default_field_flags) = SERIALIZATION_YT;
    optional string Query = 1 [(NYT.column_name) = "query"];
    optional string Region = 2 [(NYT.column_name) = "user-region"];
    optional string Service = 3 [(NYT.column_name) = "service"];
    optional string Grouping = 4 [(NYT.column_name) = "grouping"];
    optional string Pron = 5 [(NYT.column_name) = "pron"];
    optional string Relev = 6 [(NYT.column_name) = "relev"];
    optional string Rearr = 7 [(NYT.column_name) = "rearr"];
    optional string ReqId = 8 [(NYT.column_name) = "reqid"];
    optional string Kps = 9 [(NYT.column_name) = "kps"];
    optional string How  = 10 [(NYT.column_name) = "how"];
    optional bytes SerializedEvent = 11 [(NYT.column_name) = "reqans_event"];
    optional string Page = 12 [(NYT.column_name) = "page"];
    optional string NumDocs = 13 [(NYT.column_name) = "doccount"];
}
