/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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 "pulsar-common/src/main/proto/PulsarApi.proto";
package pulsar.proto.pendingack;
option java_package = "org.apache.pulsar.broker.transaction.pendingack.proto";
option optimize_for = LITE_RUNTIME;

enum PendingAckOp {
    ACK    = 1;
    COMMIT = 2;
    ABORT  = 3;
}

message PendingAckMetadata {
    required uint64 ledgerId = 1;
    required uint64 entryId  = 2;
    repeated int64 ack_set = 3;
    optional int32 batch_size = 4;
}

message PendingAckMetadataEntry {
    optional PendingAckOp pending_ack_op = 1;
    optional pulsar.proto.CommandAck.AckType ack_type = 2;
    optional uint64 txnid_least_bits = 3;
    optional uint64 txnid_most_bits = 4;
    repeated PendingAckMetadata pending_ack_metadata = 5;
}

message BatchedPendingAckMetadataEntry{
    // Array for buffer pending ack data.
    repeated PendingAckMetadataEntry pending_ack_logs = 1;
}
