blob: 042ab9ce3d980d7c42dbf2fc2609943c2c831e2e [file] [log] [blame]
// 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";
package kudu.transactions;
option java_package = "org.apache.kudu.transactions";
enum TxnStatePB {
UNKNOWN = 0;
OPEN = 1;
ABORTED = 2;
COMMIT_IN_PROGRESS = 3;
COMMITTED = 4;
}
// TODO(awong): this is a bare-bones implementation so far. We'll certainly
// need more fields as we build out the rest of the transaction workflow (e.g.
// commmit timestamps, etc).
//
// Metadata encapsulating the status of a transaction.
message TxnStatusEntryPB {
optional TxnStatePB state = 1;
optional string user = 2;
}
// Metadata encapsulating the existence of a transaction participant.
message TxnParticipantEntryPB {
optional TxnStatePB state = 1;
}
// High-level metadata about a transaction. Serialized messages of this type
// are used to pass information on an already opened transaction among multiple
// Kudu clients (even if residing on different nodes), so they can issue write
// operations in the context of the same multi-row distributed transaction.
message TxnTokenPB {
// Transaction identifier assigned to the transaction.
optional int64 txn_id = 1;
// The keep-alive interval (in milliseconds) to keep the transaction alive.
// To avoid auto-aborting the transaction, TxnManager should receive
// keep-alive heartbeats spaced by intervals equal or shorter than
// 'keepalive_millis' milliseconds in duration.
optional uint32 keepalive_millis = 2;
// Whether the client should automatically send keepalive messages once
// this token is deserialized into a runtime transaction handle.
optional bool enable_keepalive = 3;
}