github.com/tsuna/gohbase@v0.0.0-20250731002811-4ffcadfba63e/pb/ZooKeeper.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  
    19  // ZNode data in hbase are serialized protobufs with a four byte
    20  // 'magic' 'PBUF' prefix.
    21  syntax = "proto2";
    22  package pb;
    23  
    24  option java_package = "org.apache.hadoop.hbase.protobuf.generated";
    25  option java_outer_classname = "ZooKeeperProtos";
    26  option java_generic_services = true;
    27  option java_generate_equals_and_hash = true;
    28  option optimize_for = SPEED;
    29  option go_package = "../pb";
    30  
    31  import "HBase.proto";
    32  import "ClusterStatus.proto";
    33  
    34  /**
    35   * Content of the meta-region-server znode.
    36   */
    37  message MetaRegionServer {
    38    // The ServerName hosting the meta region currently, or destination server,
    39    // if meta region is in transition.
    40    required ServerName server = 1;
    41    // The major version of the rpc the server speaks.  This is used so that
    42    // clients connecting to the cluster can have prior knowledge of what version
    43    // to send to a RegionServer.  AsyncHBase will use this to detect versions.
    44    optional uint32 rpc_version = 2;
    45  
    46    // State of the region transition. OPEN means fully operational 'hbase:meta'
    47    optional RegionState.State state = 3;
    48  }
    49  
    50  /**
    51   * Content of the master znode.
    52   */
    53  message Master {
    54    // The ServerName of the current Master
    55    required ServerName master = 1;
    56    // Major RPC version so that clients can know what version the master can accept.
    57    optional uint32 rpc_version = 2;
    58    optional uint32 info_port = 3;
    59  }
    60  
    61  /**
    62   * Content of the '/hbase/running', cluster state, znode.
    63   */
    64  message ClusterUp {
    65    // If this znode is present, cluster is up.  Currently
    66    // the data is cluster start_date.
    67    required string start_date = 1;
    68  }
    69  
    70  /**
    71   * What we write under unassigned up in zookeeper as a region moves through
    72   * open/close, etc., regions.  Details a region in transition.
    73   */
    74  message RegionTransition {
    75    // Code for EventType gotten by doing o.a.h.h.EventHandler.EventType.getCode()
    76    required uint32 event_type_code = 1;
    77    // Full regionname in bytes
    78    required bytes region_name = 2;
    79    required uint64 create_time = 3;
    80    // The region server where the transition will happen or is happening
    81    required ServerName server_name = 4;
    82    optional bytes payload = 5;
    83  }
    84  
    85  /**
    86   * WAL SplitLog directory znodes have this for content.  Used doing distributed
    87   * WAL splitting.  Holds current state and name of server that originated split.
    88   */
    89  message SplitLogTask {
    90    enum State {
    91      UNASSIGNED = 0;
    92      OWNED = 1;
    93      RESIGNED = 2;
    94      DONE = 3;
    95      ERR = 4;
    96    }
    97    enum RecoveryMode {
    98      UNKNOWN = 0;
    99      LOG_SPLITTING = 1;
   100      LOG_REPLAY = 2;
   101    }
   102    required State state = 1;
   103    required ServerName server_name = 2;
   104    optional RecoveryMode mode = 3 [default = UNKNOWN];
   105  }
   106  
   107  /**
   108   * The znode that holds state of table.
   109   */
   110  message Table {
   111    // Table's current state
   112    enum State {
   113      ENABLED = 0;
   114      DISABLED = 1;
   115      DISABLING = 2;
   116      ENABLING = 3;
   117    }
   118    // This is the table's state.  If no znode for a table,
   119    // its state is presumed enabled.  See o.a.h.h.zookeeper.ZKTable class
   120    // for more.
   121    required State state = 1 [default = ENABLED];
   122  }
   123  
   124  /**
   125   * Used by replication. Holds a replication peer key.
   126   */
   127  message ReplicationPeer {
   128    // clusterkey is the concatenation of the slave cluster's
   129    // hbase.zookeeper.quorum:hbase.zookeeper.property.clientPort:zookeeper.znode.parent
   130    required string clusterkey = 1;
   131    optional string replicationEndpointImpl = 2;
   132    repeated BytesBytesPair data = 3;
   133    repeated NameStringPair configuration = 4;
   134  }
   135  
   136  /**
   137   * Used by replication. Holds whether enabled or disabled
   138   */
   139  message ReplicationState {
   140    enum State {
   141      ENABLED = 0;
   142      DISABLED = 1;
   143    }
   144    required State state = 1;
   145  }
   146  
   147  /**
   148   * Used by replication. Holds the current position in an WAL file.
   149   */
   150  message ReplicationHLogPosition {
   151    required int64 position = 1;
   152  }
   153  
   154  /**
   155   * Used by replication. Used to lock a region server during failover.
   156   */
   157  message ReplicationLock {
   158    required string lock_owner = 1;
   159  }
   160  
   161  /**
   162   * Metadata associated with a table lock in zookeeper
   163   */
   164  message TableLock {
   165    optional TableName table_name = 1;
   166    optional ServerName lock_owner = 2;
   167    optional int64 thread_id = 3;
   168    optional bool is_shared = 4;
   169    optional string purpose = 5;
   170    optional int64 create_time = 6;
   171  }
   172  
   173  /**
   174   * State of the switch.
   175   */
   176  message SwitchState {
   177    optional bool enabled = 1;
   178  }