github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/pingcap/go-hbase/protobuf/ZooKeeper.proto (about)

     1  package proto;
     2  /**
     3   * Licensed to the Apache Software Foundation (ASF) under one
     4   * or more contributor license agreements.  See the NOTICE file
     5   * distributed with this work for additional information
     6   * regarding copyright ownership.  The ASF licenses this file
     7   * to you under the Apache License, Version 2.0 (the
     8   * "License"); you may not use this file except in compliance
     9   * with the License.  You may obtain a copy of the License at
    10   *
    11   *     http://www.apache.org/licenses/LICENSE-2.0
    12   *
    13   * Unless required by applicable law or agreed to in writing, software
    14   * distributed under the License is distributed on an "AS IS" BASIS,
    15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    16   * See the License for the specific language governing permissions and
    17   * limitations under the License.
    18   */
    19  
    20  // ZNode data in hbase are serialized protobufs with a four byte
    21  // 'magic' 'PBUF' prefix.
    22  
    23  option java_package = "org.apache.hadoop.hbase.protobuf.generated";
    24  option java_outer_classname = "ZooKeeperProtos";
    25  option java_generic_services = true;
    26  option java_generate_equals_and_hash = true;
    27  option optimize_for = SPEED;
    28  
    29  import "HBase.proto";
    30  import "ClusterStatus.proto";
    31  
    32  /**
    33   * Content of the meta-region-server znode.
    34   */
    35  message MetaRegionServer {
    36    // The ServerName hosting the meta region currently.
    37    required ServerName server = 1;
    38    // The major version of the rpc the server speaks.  This is used so that
    39    // clients connecting to the cluster can have prior knowledge of what version
    40    // to send to a RegionServer.  AsyncHBase will use this to detect versions.
    41    optional uint32 rpc_version = 2;
    42    // State of the region transition. OPEN means fully operational 'hbase:meta'
    43    optional RegionState.State state = 3;
    44  }
    45  
    46  /**
    47   * Content of the master znode.
    48   */
    49  message Master {
    50    // The ServerName of the current Master
    51    required ServerName master = 1;
    52    // Major RPC version so that clients can know what version the master can accept.
    53    optional uint32 rpc_version = 2;
    54  }
    55  
    56  /**
    57   * Content of the '/hbase/running', cluster state, znode.
    58   */
    59  message ClusterUp {
    60    // If this znode is present, cluster is up.  Currently
    61    // the data is cluster start_date.
    62    required string start_date = 1;
    63  }
    64  
    65  /**
    66   * What we write under unassigned up in zookeeper as a region moves through
    67   * open/close, etc., regions.  Details a region in transition.
    68   */
    69  message RegionTransition {
    70    // Code for EventType gotten by doing o.a.h.h.EventHandler.EventType.getCode()
    71    required uint32 event_type_code = 1;
    72    // Full regionname in bytes
    73    required bytes region_name = 2;
    74    required uint64 create_time = 3;
    75    // The region server where the transition will happen or is happening
    76    required ServerName server_name = 4;
    77    optional bytes payload = 5;
    78  }
    79  
    80  /**
    81   * WAL SplitLog directory znodes have this for content.  Used doing distributed
    82   * WAL splitting.  Holds current state and name of server that originated split.
    83   */
    84  message SplitLogTask {
    85    enum State {
    86      UNASSIGNED = 0;
    87      OWNED = 1;
    88      RESIGNED = 2;
    89      DONE = 3;
    90      ERR = 4;
    91    }
    92    enum RecoveryMode {
    93      UNKNOWN = 0;
    94      LOG_SPLITTING = 1;
    95      LOG_REPLAY = 2;
    96    }
    97    required State state = 1;
    98    required ServerName server_name = 2;
    99    optional RecoveryMode mode = 3 [default = UNKNOWN];
   100  }
   101  
   102  /**
   103   * The znode that holds state of table.
   104   */
   105  message Table {
   106    // Table's current state
   107    enum State {
   108      ENABLED = 0;
   109      DISABLED = 1;
   110      DISABLING = 2;
   111      ENABLING = 3;
   112    }
   113    // This is the table's state.  If no znode for a table,
   114    // its state is presumed enabled.  See o.a.h.h.zookeeper.ZKTable class
   115    // for more.
   116    required State state = 1 [default = ENABLED];
   117  }
   118  
   119  /**
   120   * Used by replication. Holds a replication peer key.
   121   */
   122  message ReplicationPeer {
   123    // clusterkey is the concatenation of the slave cluster's
   124    // hbase.zookeeper.quorum:hbase.zookeeper.property.clientPort:zookeeper.znode.parent
   125    required string clusterkey = 1;
   126    optional string replicationEndpointImpl = 2;
   127    repeated BytesBytesPair data = 3;
   128    repeated NameStringPair configuration = 4;
   129  }
   130  
   131  /**
   132   * Used by replication. Holds whether enabled or disabled
   133   */
   134  message ReplicationState {
   135    enum State {
   136      ENABLED = 0;
   137      DISABLED = 1;
   138    }
   139    required State state = 1;
   140  }
   141  
   142  /**
   143   * Used by replication. Holds the current position in an HLog file.
   144   */
   145  message ReplicationHLogPosition {
   146    required int64 position = 1;
   147  }
   148  
   149  /**
   150   * Used by replication. Used to lock a region server during failover.
   151   */
   152  message ReplicationLock {
   153    required string lock_owner = 1;
   154  }
   155  
   156  /**
   157   * Metadata associated with a table lock in zookeeper
   158   */
   159  message TableLock {
   160    optional TableName table_name = 1;
   161    optional ServerName lock_owner = 2;
   162    optional int64 thread_id = 3;
   163    optional bool is_shared = 4;
   164    optional string purpose = 5;
   165    optional int64 create_time = 6;
   166  }
   167  
   168  /**
   169   * sequence Id of a store
   170   */
   171  message StoreSequenceId {
   172    required bytes family_name = 1;
   173    required uint64 sequence_id = 2;
   174  }
   175  
   176  /**
   177   * contains a sequence id of a region which should be the minimum of its store sequence ids and 
   178   * list sequence ids of the region's stores
   179   */
   180  message RegionStoreSequenceIds {
   181    required uint64 last_flushed_sequence_id = 1;
   182    repeated StoreSequenceId store_sequence_id = 2;
   183  }