github.com/tsuna/gohbase@v0.0.0-20250731002811-4ffcadfba63e/pb/Procedure.proto (about)

     1  /**
     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
     9   *
    10   *     http://www.apache.org/licenses/LICENSE-2.0
    11   *
    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.
    17   */
    18  syntax = "proto2";
    19  package pb;
    20  
    21  option java_package = "org.apache.hadoop.hbase.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;
    26  option go_package = "../pb";
    27  
    28  import "ErrorHandling.proto";
    29  
    30  enum ProcedureState {
    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    FINISHED = 6;             // The procedure execution is completed. may need a rollback if failed.
    37  }
    38  
    39  /**
    40   * Procedure metadata, serialized by the ProcedureStore to be able to recover the old state.
    41   */
    42  message Procedure {
    43    // internal "static" state
    44    required string class_name = 1;        // full classname to be able to instantiate the procedure
    45    optional uint64 parent_id = 2;         // parent if not a root-procedure otherwise not set
    46    required uint64 proc_id = 3;
    47    required uint64 start_time = 4;
    48    optional string owner = 5;
    49  
    50    // internal "runtime" state
    51    required ProcedureState state = 6;
    52    repeated uint32 stack_id = 7;          // stack indices in case the procedure was running
    53    required uint64 last_update = 8;
    54    optional uint32 timeout = 9;
    55  
    56    // user state/results
    57    optional ForeignExceptionMessage exception = 10;
    58    optional bytes result = 11;           // opaque (user) result structure
    59    optional bytes state_data = 12;       // opaque (user) procedure internal-state
    60  
    61    // Nonce to prevent same procedure submit by multiple times
    62    optional uint64 nonce_group = 13 [default = 0];
    63    optional uint64 nonce = 14 [default = 0];
    64  }
    65  
    66  /**
    67   * SequentialProcedure data
    68   */
    69  message SequentialProcedureData {
    70    required bool executed = 1;
    71  }
    72  
    73  /**
    74   * StateMachineProcedure data
    75   */
    76  message StateMachineProcedureData {
    77    repeated uint32 state = 1;
    78  }
    79  
    80  /**
    81   * Procedure WAL header
    82   */
    83  message ProcedureWALHeader {
    84    required uint32 version = 1;
    85    required uint32 type = 2;
    86    required uint64 log_id = 3;
    87    required uint64 min_proc_id = 4;
    88  }
    89  
    90  /**
    91   * Procedure WAL trailer
    92   */
    93  message ProcedureWALTrailer {
    94    required uint32 version = 1;
    95    required uint64 tracker_pos = 2;
    96  }
    97  
    98  message ProcedureStoreTracker {
    99    message TrackerNode {
   100      required uint64 start_id = 1;
   101      repeated uint64 updated = 2;
   102      repeated uint64 deleted = 3;
   103    }
   104  
   105    repeated TrackerNode node = 1;
   106  }
   107  
   108  message ProcedureWALEntry {
   109    enum Type {
   110      PROCEDURE_WAL_EOF     = 1;
   111      PROCEDURE_WAL_INIT    = 2;
   112      PROCEDURE_WAL_INSERT  = 3;
   113      PROCEDURE_WAL_UPDATE  = 4;
   114      PROCEDURE_WAL_DELETE  = 5;
   115      PROCEDURE_WAL_COMPACT = 6;
   116    }
   117  
   118    required Type type = 1;
   119    repeated Procedure procedure = 2;
   120    optional uint64 proc_id = 3;
   121  }