2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 option java_package = "org.apache.hadoop.hbase.shaded.protobuf.generated";
22 option java_outer_classname = "ProcedureProtos";
23 option java_generic_services = true;
24 option java_generate_equals_and_hash = true;
25 option optimize_for = SPEED;
27 import "google/protobuf/any.proto";
28 import "ErrorHandling.proto";
31 INITIALIZING = 1; // Procedure in construction, not yet added to the executor
32 RUNNABLE = 2; // Procedure added to the executor, and ready to be executed
33 WAITING = 3; // The procedure is waiting on children to be completed
34 WAITING_TIMEOUT = 4; // The procedure is waiting a timout or an external event
35 ROLLEDBACK = 5; // The procedure failed and was rolledback
36 SUCCESS = 6; // The procedure execution is completed successfully.
37 FAILED = 7; // The procedure execution is failed, may need to rollback
41 * Procedure metadata, serialized by the ProcedureStore to be able to recover the old state.
44 // internal "static" state
45 required string class_name = 1; // full classname to be able to instantiate the procedure
46 optional uint64 parent_id = 2; // parent if not a root-procedure otherwise not set
47 required uint64 proc_id = 3;
48 required uint64 submitted_time = 4;
49 optional string owner = 5;
51 // internal "runtime" state
52 required ProcedureState state = 6;
53 repeated uint32 stack_id = 7; // stack indices in case the procedure was running
54 required uint64 last_update = 8;
55 optional uint32 timeout = 9;
58 optional ForeignExceptionMessage exception = 10;
59 optional bytes result = 11; // opaque (user) result structure
60 optional bytes state_data = 12; // opaque (user) procedure internal-state - OBSOLATE
61 repeated google.protobuf.Any state_message = 15; // opaque (user) procedure internal-state
63 // Nonce to prevent same procedure submit by multiple times
64 optional uint64 nonce_group = 13 [default = 0];
65 optional uint64 nonce = 14 [default = 0];
67 // whether the procedure has held the lock
68 optional bool locked = 16 [default = false];
70 // whether the procedure need to be bypassed
71 optional bool bypass = 17 [default = false];
75 * SequentialProcedure data
77 message SequentialProcedureData {
78 required bool executed = 1;
82 * StateMachineProcedure data
84 message StateMachineProcedureData {
85 repeated uint32 state = 1;
89 * Procedure WAL header
91 message ProcedureWALHeader {
92 required uint32 version = 1;
93 required uint32 type = 2;
94 required uint64 log_id = 3;
95 required uint64 min_proc_id = 4;
99 * Procedure WAL trailer
101 message ProcedureWALTrailer {
102 required uint32 version = 1;
103 required uint64 tracker_pos = 2;
106 message ProcedureStoreTracker {
107 message TrackerNode {
108 required uint64 start_id = 1;
109 repeated uint64 updated = 2;
110 repeated uint64 deleted = 3;
113 repeated TrackerNode node = 1;
116 message ProcedureWALEntry {
118 PROCEDURE_WAL_EOF = 1;
119 PROCEDURE_WAL_INIT = 2;
120 PROCEDURE_WAL_INSERT = 3;
121 PROCEDURE_WAL_UPDATE = 4;
122 PROCEDURE_WAL_DELETE = 5;
123 PROCEDURE_WAL_COMPACT = 6;
126 required Type type = 1;
127 repeated Procedure procedure = 2;
128 optional uint64 proc_id = 3;
129 repeated uint64 child_id = 4;