You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ec...@apache.org on 2012/11/21 00:26:04 UTC

svn commit: r1411922 [21/21] - in /hbase/trunk: ./ hbase-protocol/ hbase-protocol/src/ hbase-protocol/src/main/ hbase-protocol/src/main/java/ hbase-protocol/src/main/java/org/ hbase-protocol/src/main/java/org/apache/ hbase-protocol/src/main/java/org/ap...

Added: hbase/trunk/hbase-protocol/src/main/protobuf/AccessControl.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/AccessControl.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/AccessControl.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/AccessControl.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,99 @@
+/**
+ * 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.
+ */
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "AccessControlProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message Permission {
+    enum Action {
+        READ = 0;
+        WRITE = 1;
+        EXEC = 2;
+        CREATE = 3;
+        ADMIN = 4;
+    }
+    repeated Action action = 1;
+    optional bytes table = 2;
+    optional bytes family = 3;
+    optional bytes qualifier = 4;
+}
+
+message UserPermission {
+    required bytes user = 1;
+    required Permission permission = 2;
+}
+
+/**
+ * Content of the /hbase/acl/<table> znode.
+ */
+message UserTablePermissions {
+  message UserPermissions {
+    required bytes user = 1;
+    repeated Permission permissions = 2;
+  }
+
+  repeated UserPermissions permissions = 1;
+}
+
+message GrantRequest {
+    required UserPermission permission = 1;
+}
+
+message GrantResponse {
+}
+
+message RevokeRequest {
+    required UserPermission permission = 1;
+
+}
+
+message RevokeResponse {
+}
+
+
+message UserPermissionsRequest {
+    required bytes table = 1;
+}
+
+message UserPermissionsResponse {
+    repeated UserPermission permission = 1;
+}
+
+message CheckPermissionsRequest {
+    repeated Permission permission = 1;
+}
+
+message CheckPermissionsResponse {
+}
+
+service AccessControlService {
+    rpc grant(GrantRequest)
+      returns (GrantResponse);
+
+    rpc revoke(RevokeRequest)
+      returns (RevokeResponse);
+
+    rpc getUserPermissions(UserPermissionsRequest)
+      returns (UserPermissionsResponse);
+
+    rpc checkPermissions(CheckPermissionsRequest)
+      returns (CheckPermissionsResponse);
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/Admin.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/Admin.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/Admin.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/Admin.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,255 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for Admin service.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "AdminProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "hbase.proto";
+
+message GetRegionInfoRequest {
+  required RegionSpecifier region = 1;
+  optional bool compactionState = 2;
+}
+
+message GetRegionInfoResponse {
+  required RegionInfo regionInfo = 1;
+  optional CompactionState compactionState = 2;
+
+  enum CompactionState {
+    NONE = 0;
+    MINOR = 1;
+    MAJOR = 2;
+    MAJOR_AND_MINOR = 3;
+  }
+}
+
+/**
+ * Get a list of store files for a set of column families in a particular region.
+ * If no column family is specified, get the store files for all column families.
+ */
+message GetStoreFileRequest {
+  required RegionSpecifier region = 1;
+  repeated bytes family = 2;
+}
+
+message GetStoreFileResponse {
+  repeated string storeFile = 1;
+}
+
+message GetOnlineRegionRequest {
+}
+
+message GetOnlineRegionResponse {
+  repeated RegionInfo regionInfo = 1;
+}
+
+message OpenRegionRequest {
+  repeated RegionOpenInfo openInfo = 1;
+
+  message RegionOpenInfo {
+    required RegionInfo region = 1;
+    optional uint32 versionOfOfflineNode = 2;
+  }
+}
+
+message OpenRegionResponse {
+  repeated RegionOpeningState openingState = 1;
+
+  enum RegionOpeningState {
+    OPENED = 0;
+    ALREADY_OPENED = 1;
+    FAILED_OPENING = 2;
+  }
+}
+
+/**
+ * Closes the specified region and will use or not use ZK during the close
+ * according to the specified flag.
+ */
+message CloseRegionRequest {
+  required RegionSpecifier region = 1;
+  optional uint32 versionOfClosingNode = 2;
+  optional bool transitionInZK = 3 [default = true];
+  optional ServerName destinationServer = 4;
+}
+
+message CloseRegionResponse {
+  required bool closed = 1;
+}
+
+/**
+ * Flushes the MemStore of the specified region.
+ * <p>
+ * This method is synchronous.
+ */
+message FlushRegionRequest {
+  required RegionSpecifier region = 1;
+  optional uint64 ifOlderThanTs = 2;
+}
+
+message FlushRegionResponse {
+  required uint64 lastFlushTime = 1;
+  optional bool flushed = 2;
+}
+
+/**
+ * Splits the specified region.
+ * <p>
+ * This method currently flushes the region and then forces a compaction which
+ * will then trigger a split.  The flush is done synchronously but the
+ * compaction is asynchronous.
+ */
+message SplitRegionRequest {
+  required RegionSpecifier region = 1;
+  optional bytes splitPoint = 2;
+}
+
+message SplitRegionResponse {
+}
+
+/**
+ * Compacts the specified region.  Performs a major compaction if specified.
+ * <p>
+ * This method is asynchronous.
+ */
+message CompactRegionRequest {
+  required RegionSpecifier region = 1;
+  optional bool major = 2;
+  optional bytes family = 3;
+}
+
+message CompactRegionResponse {
+}
+
+message UUID {
+  required uint64 leastSigBits = 1;
+  required uint64 mostSigBits = 2;
+}
+
+// Protocol buffer version of HLog
+message WALEntry {
+  required WALKey key = 1;
+  required WALEdit edit = 2;
+
+  // Protocol buffer version of HLogKey
+  message WALKey {
+    required bytes encodedRegionName = 1;
+    required bytes tableName = 2;
+    required uint64 logSequenceNumber = 3;
+    required uint64 writeTime = 4;
+    optional UUID clusterId = 5;
+  }
+
+  message WALEdit {
+    repeated bytes keyValueBytes = 1;
+    repeated FamilyScope familyScope = 2;
+
+    enum ScopeType {
+      REPLICATION_SCOPE_LOCAL = 0;
+      REPLICATION_SCOPE_GLOBAL = 1;
+    }
+
+    message FamilyScope {
+      required bytes family = 1;
+      required ScopeType scopeType = 2;
+    }
+  }
+}
+
+/**
+ * Replicates the given entries. The guarantee is that the given entries
+ * will be durable on the slave cluster if this method returns without
+ * any exception.
+ * hbase.replication has to be set to true for this to work.
+ */
+message ReplicateWALEntryRequest {
+  repeated WALEntry entry = 1;
+}
+
+message ReplicateWALEntryResponse {
+}
+
+message RollWALWriterRequest {
+}
+
+message RollWALWriterResponse {
+  // A list of encoded name of regions to flush
+  repeated bytes regionToFlush = 1;
+}
+
+message StopServerRequest {
+  required string reason = 1;
+}
+
+message StopServerResponse {
+}
+
+message GetServerInfoRequest {
+}
+
+message ServerInfo {
+  required ServerName serverName = 1;
+  optional uint32 webuiPort = 2;
+}
+
+message GetServerInfoResponse {
+  required ServerInfo serverInfo = 1;
+}
+
+service AdminService {
+  rpc getRegionInfo(GetRegionInfoRequest)
+    returns(GetRegionInfoResponse);
+
+  rpc getStoreFile(GetStoreFileRequest)
+    returns(GetStoreFileResponse);
+
+  rpc getOnlineRegion(GetOnlineRegionRequest)
+    returns(GetOnlineRegionResponse);
+
+  rpc openRegion(OpenRegionRequest)
+    returns(OpenRegionResponse);
+
+  rpc closeRegion(CloseRegionRequest)
+    returns(CloseRegionResponse);
+
+  rpc flushRegion(FlushRegionRequest)
+    returns(FlushRegionResponse);
+
+  rpc splitRegion(SplitRegionRequest)
+    returns(SplitRegionResponse);
+
+  rpc compactRegion(CompactRegionRequest)
+    returns(CompactRegionResponse);
+
+  rpc replicateWALEntry(ReplicateWALEntryRequest)
+    returns(ReplicateWALEntryResponse);
+
+  rpc rollWALWriter(RollWALWriterRequest)
+    returns(RollWALWriterResponse);
+
+  rpc getServerInfo(GetServerInfoRequest)
+    returns(GetServerInfoResponse);
+
+  rpc stopServer(StopServerRequest)
+    returns(StopServerResponse);
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/Aggregate.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/Aggregate.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/Aggregate.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/Aggregate.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,62 @@
+/**
+ * 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.
+ */
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "AggregateProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "Client.proto";
+
+message AggregateArgument {
+  /** The argument passed to the AggregateService consists of three parts
+   *  (1) the (canonical) classname of the ColumnInterpreter implementation
+   *  (2) the Scan query
+   *  (3) any bytes required to construct the ColumnInterpreter object
+   *      properly
+   */
+  required string interpreterClassName = 1;
+  required Scan scan = 2;
+  optional bytes  interpreterSpecificBytes = 3;
+}
+
+message AggregateResponse {
+  /**
+   * The AggregateService methods all have a response that either is a Pair
+   * or a simple object. When it is a Pair both firstPart and secondPart
+   * have defined values (and the secondPart is not present in the response 
+   * when the response is not a pair). Refer to the AggregateImplementation 
+   * class for an overview of the AggregateResponse object constructions. 
+   */ 
+  repeated bytes firstPart = 1;
+  optional bytes secondPart = 2;  
+}
+
+/** Refer to the AggregateImplementation class for an overview of the 
+ *  AggregateService method implementations and their functionality.
+ */
+service AggregateService {
+  rpc getMax (AggregateArgument) returns (AggregateResponse);
+  rpc getMin (AggregateArgument) returns (AggregateResponse);
+  rpc getSum (AggregateArgument) returns (AggregateResponse);
+  rpc getRowNum (AggregateArgument) returns (AggregateResponse);
+  rpc getAvg (AggregateArgument) returns (AggregateResponse);
+  rpc getStd (AggregateArgument) returns (AggregateResponse);
+  rpc getMedian (AggregateArgument) returns (AggregateResponse);
+}
\ No newline at end of file

Added: hbase/trunk/hbase-protocol/src/main/protobuf/BulkDelete.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/BulkDelete.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/BulkDelete.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/BulkDelete.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,49 @@
+/**
+ * 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.
+ */
+
+option java_package = "org.apache.hadoop.hbase.coprocessor.example.generated";
+option java_outer_classname = "BulkDeleteProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "Client.proto";
+
+message BulkDeleteRequest {
+  required Scan scan = 1;
+  required DeleteType deleteType = 2;
+  optional uint64 timestamp = 3;
+  required uint32 rowBatchSize = 4;
+  
+  enum DeleteType {
+    ROW = 0;
+    FAMILY = 1;
+    COLUMN = 2;
+    VERSION = 3;
+  }
+}
+
+message BulkDeleteResponse {
+  required uint64 rowsDeleted = 1; 
+  optional uint64 versionsDeleted = 2;
+}
+
+service BulkDeleteService {
+  rpc delete(BulkDeleteRequest)
+    returns (BulkDeleteResponse);
+}
\ No newline at end of file

Added: hbase/trunk/hbase-protocol/src/main/protobuf/Client.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/Client.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/Client.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/Client.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,385 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for Client service.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ClientProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "hbase.proto";
+import "Comparator.proto";
+
+/**
+ * Container for a list of column qualifier names of a family.
+ */
+message Column {
+  required bytes family = 1;
+  repeated bytes qualifier = 2;
+}
+
+/**
+ * The protocol buffer version of Get
+ */
+message Get {
+  required bytes row = 1;
+  repeated Column column = 2;
+  repeated NameBytesPair attribute = 3;
+  optional uint64 lockId = 4;
+  optional Filter filter = 5;
+  optional TimeRange timeRange = 6;
+  optional uint32 maxVersions = 7 [default = 1];
+  optional bool cacheBlocks = 8 [default = true];
+  optional uint32 storeLimit = 9;
+  optional uint32 storeOffset = 10;
+}
+
+/**
+ * For performance reason, we don't use KeyValue
+ * here. We use the actual KeyValue bytes.
+ */
+message Result {
+  repeated bytes keyValueBytes = 1;
+}
+
+/**
+ * The get request. Perform a single Get operation.
+ * Unless existenceOnly is specified, return all the requested data
+ * for the row that matches exactly, or the one that immediately
+ * precedes it if closestRowBefore is specified.
+ *
+ * If existenceOnly is set, only the existence will be returned.
+ */
+message GetRequest {
+  required RegionSpecifier region = 1;
+  required Get get = 2;
+
+  // If the row to get doesn't exist, return the
+  // closest row before.
+  optional bool closestRowBefore = 3;
+
+  // The result isn't asked for, just check for
+  // the existence. If specified, closestRowBefore
+  // will be ignored
+  optional bool existenceOnly = 4;
+}
+
+message GetResponse {
+  optional Result result = 1;
+
+  // used for Get to check existence only
+  optional bool exists = 2;
+}
+
+/**
+ * Condition to check if the value of a given cell (row,
+ * family, qualifier) matches a value via a given comparator.
+ *
+ * Condition is used in check and mutate operations.
+ */
+message Condition {
+  required bytes row = 1;
+  required bytes family = 2;
+  required bytes qualifier = 3;
+  required CompareType compareType = 4;
+  required Comparator comparator = 5;
+}
+
+/**
+ * A specific mutate inside a mutate request.
+ * It can be an append, increment, put or delete based
+ * on the mutate type.
+ */
+message Mutate {
+  required bytes row = 1;
+  required MutateType mutateType = 2;
+  repeated ColumnValue columnValue = 3;
+  repeated NameBytesPair attribute = 4;
+  optional uint64 timestamp = 5;
+  optional uint64 lockId = 6;
+  optional bool writeToWAL = 7 [default = true];
+
+  // For some mutate, result may be returned, in which case,
+  // time range can be specified for potential performance gain
+  optional TimeRange timeRange = 10;
+
+  enum MutateType {
+    APPEND = 0;
+    INCREMENT = 1;
+    PUT = 2;
+    DELETE = 3;
+  }
+
+  enum DeleteType {
+    DELETE_ONE_VERSION = 0;
+    DELETE_MULTIPLE_VERSIONS = 1;
+    DELETE_FAMILY = 2;
+  }
+
+  message ColumnValue {
+    required bytes family = 1;
+    repeated QualifierValue qualifierValue = 2;
+
+    message QualifierValue {
+      optional bytes qualifier = 1;
+      optional bytes value = 2;
+      optional uint64 timestamp = 3;
+      optional DeleteType deleteType = 4;
+    }
+  }
+}
+
+/**
+ * The mutate request. Perform a single Mutate operation.
+ *
+ * Optionally, you can specify a condition. The mutate
+ * will take place only if the condition is met.  Otherwise,
+ * the mutate will be ignored.  In the response result,
+ * parameter processed is used to indicate if the mutate
+ * actually happened.
+ */
+message MutateRequest {
+  required RegionSpecifier region = 1;
+  required Mutate mutate = 2;
+  optional Condition condition = 3;
+}
+
+message MutateResponse {
+  optional Result result = 1;
+
+  // used for mutate to indicate processed only
+  optional bool processed = 2;
+}
+
+/**
+ * Instead of get from a table, you can scan it with optional filters.
+ * You can specify the row key range, time range, the columns/families
+ * to scan and so on.
+ *
+ * This scan is used the first time in a scan request. The response of
+ * the initial scan will return a scanner id, which should be used to
+ * fetch result batches later on before it is closed.
+ */
+message Scan {
+  repeated Column column = 1;
+  repeated NameBytesPair attribute = 2;
+  optional bytes startRow = 3;
+  optional bytes stopRow = 4;
+  optional Filter filter = 5;
+  optional TimeRange timeRange = 6;
+  optional uint32 maxVersions = 7 [default = 1];
+  optional bool cacheBlocks = 8 [default = true];
+  optional uint32 batchSize = 9;
+  optional uint64 maxResultSize = 10;
+  optional uint32 storeLimit = 11;
+  optional uint32 storeOffset = 12;
+}
+
+/**
+ * A scan request. Initially, it should specify a scan. Later on, you
+ * can use the scanner id returned to fetch result batches with a different
+ * scan request.
+ *
+ * The scanner will remain open if there are more results, and it's not
+ * asked to be closed explicitly.
+ *
+ * You can fetch the results and ask the scanner to be closed to save
+ * a trip if you are not interested in remaining results.
+ */
+message ScanRequest {
+  optional RegionSpecifier region = 1;
+  optional Scan scan = 2;
+  optional uint64 scannerId = 3;
+  optional uint32 numberOfRows = 4;
+  optional bool closeScanner = 5;
+  optional uint64 nextCallSeq = 6;
+}
+
+/**
+ * The scan response. If there are no more results, moreResults will
+ * be false.  If it is not specified, it means there are more.
+ */
+message ScanResponse {
+  repeated Result result = 1;
+  optional uint64 scannerId = 2;
+  optional bool moreResults = 3;
+  optional uint32 ttl = 4;
+}
+
+message LockRowRequest {
+  required RegionSpecifier region = 1;
+  repeated bytes row = 2;
+}
+
+message LockRowResponse {
+  required uint64 lockId = 1;
+  optional uint32 ttl = 2;
+}
+
+message UnlockRowRequest {
+  required RegionSpecifier region = 1;
+  required uint64 lockId = 2;
+}
+
+message UnlockRowResponse {
+}
+
+/**
+ * Atomically bulk load multiple HFiles (say from different column families)
+ * into an open region.
+ */
+message BulkLoadHFileRequest {
+  required RegionSpecifier region = 1;
+  repeated FamilyPath familyPath = 2;
+  optional bool assignSeqNum = 3;
+
+  message FamilyPath {
+    required bytes family = 1;
+    required string path = 2;
+  }
+}
+
+message BulkLoadHFileResponse {
+  required bool loaded = 1;
+}
+
+/**
+ * An individual coprocessor call. You must specify the protocol,
+ * the method, and the row to which the call will be executed.
+ *
+ * You can specify the configuration settings in the property list.
+ *
+ * The parameter list has the parameters used for the method.
+ * A parameter is a pair of parameter name and the binary parameter
+ * value. The name is the parameter class name.  The value is the
+ * binary format of the parameter, for example, protocol buffer
+ * encoded value.
+ */
+message Exec {
+  required bytes row = 1;
+  required string protocolName = 2;
+  required string methodName = 3;
+  repeated NameStringPair property = 4;
+  repeated NameBytesPair parameter = 5;
+}
+
+  /**
+   * Executes a single {@link org.apache.hadoop.hbase.ipc.CoprocessorProtocol}
+   * method using the registered protocol handlers.
+   * {@link CoprocessorProtocol} implementations must be registered via the
+   * {@link org.apache.hadoop.hbase.regionserver.HRegion#registerProtocol(
+   * Class, org.apache.hadoop.hbase.ipc.CoprocessorProtocol)}
+   * method before they are available.
+ */
+message ExecCoprocessorRequest {
+  required RegionSpecifier region = 1;
+  required Exec call = 2;
+}
+
+message ExecCoprocessorResponse {
+  required NameBytesPair value = 1;
+}
+
+message CoprocessorServiceCall {
+  required bytes row = 1;
+  required string serviceName = 2;
+  required string methodName = 3;
+  required bytes request = 4;
+}
+
+message CoprocessorServiceRequest {
+  required RegionSpecifier region = 1;
+  required CoprocessorServiceCall call = 2;
+}
+
+message CoprocessorServiceResponse {
+  required RegionSpecifier region = 1;
+  required NameBytesPair value = 2;
+}
+
+/**
+ * An action that is part of MultiRequest.
+ * This is a union type - exactly one of the fields will be set.
+ */
+message MultiAction {
+  optional Mutate mutate = 1;
+  optional Get get = 2;
+  optional Exec exec = 3;
+}
+
+/**
+ * An individual action result. The result will in the
+ * same order as the action in the request. If an action
+ * returns a value, it is set in value field. If it doesn't
+ * return anything, the result will be empty. If an action
+ * fails to execute due to any exception, the exception
+ * is returned as a stringified parameter.
+ */
+message ActionResult {
+  optional NameBytesPair value = 1;
+  optional NameBytesPair exception = 2;
+}
+
+/**
+ * You can execute a list of actions on a given region in order.
+ *
+ * If it is a list of mutate actions, atomic can be set
+ * to make sure they can be processed atomically, just like
+ * RowMutations.
+ */
+message MultiRequest {
+  required RegionSpecifier region = 1;
+  repeated MultiAction action = 2;
+  optional bool atomic = 3;
+}
+
+message MultiResponse {
+  repeated ActionResult result = 1;
+}
+
+
+service ClientService {
+  rpc get(GetRequest)
+    returns(GetResponse);
+
+  rpc mutate(MutateRequest)
+    returns(MutateResponse);
+
+  rpc scan(ScanRequest)
+    returns(ScanResponse);
+
+  rpc lockRow(LockRowRequest)
+    returns(LockRowResponse);
+
+  rpc unlockRow(UnlockRowRequest)
+    returns(UnlockRowResponse);
+
+  rpc bulkLoadHFile(BulkLoadHFileRequest)
+    returns(BulkLoadHFileResponse);
+
+  rpc execCoprocessor(ExecCoprocessorRequest)
+    returns(ExecCoprocessorResponse);
+
+  rpc execService(CoprocessorServiceRequest)
+    returns(CoprocessorServiceResponse);
+
+  rpc multi(MultiRequest)
+    returns(MultiResponse);
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/ClusterId.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/ClusterId.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/ClusterId.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/ClusterId.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,33 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are shared throughout HBase
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ClusterIdProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Content of the '/hbase/hbaseid', cluster id, znode.
+ * Also cluster of the ${HBASE_ROOTDIR}/hbase.id file.
+ */
+message ClusterId {
+  // This is the cluster id, a uuid as a String
+  required string clusterId = 1;
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/ClusterStatus.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/ClusterStatus.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/ClusterStatus.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/ClusterStatus.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,67 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for ClustStatus
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ClusterStatusProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "hbase.proto";
+import "ClusterId.proto";
+import "FS.proto";
+
+message RegionState {
+  required RegionInfo regionInfo = 1;
+  required State state = 2;
+  optional uint64 stamp = 3;
+  enum State {
+    OFFLINE = 0;       // region is in an offline state
+    PENDING_OPEN = 1;  // sent rpc to server to open but has not begun
+    OPENING = 2;       // server has begun to open but not yet done
+    OPEN = 3;          // server opened region and updated meta
+    PENDING_CLOSE = 4; // sent rpc to server to close but has not begun
+    CLOSING = 5;       // server has begun to close but not yet done
+    CLOSED = 6;        // server closed region and updated meta
+    SPLITTING = 7;     // server started split of a region
+    SPLIT = 8;         // server completed split of a region
+  }
+}
+
+message RegionInTransition {
+  required RegionSpecifier spec = 1;
+  required RegionState regionState = 2;
+}
+
+message LiveServerInfo {
+  required ServerName server = 1;
+  required ServerLoad serverLoad = 2;
+}
+
+message ClusterStatus {
+  optional HBaseVersionFileContent hbaseVersion = 1;
+  repeated LiveServerInfo liveServers = 2;
+  repeated ServerName deadServers = 3;
+  repeated RegionInTransition regionsInTransition = 4;
+  optional ClusterId clusterId = 5;
+  repeated Coprocessor masterCoprocessors = 6;
+  optional ServerName master = 7;
+  repeated ServerName backupMasters = 8;
+  optional bool balancerOn = 9;
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/Comparator.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/Comparator.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/Comparator.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/Comparator.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,68 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for filters
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ComparatorProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+// This file contains protocol buffers that are used for comparators (e.g. in filters)
+
+message Comparator {
+  required string name = 1;
+  optional bytes serializedComparator = 2;
+}
+
+message ByteArrayComparable {
+  optional bytes value = 1;
+}
+
+message BinaryComparator {
+  required ByteArrayComparable comparable = 1;
+}
+
+message BinaryPrefixComparator {
+  required ByteArrayComparable comparable = 1;
+}
+
+message BitComparator {
+  required ByteArrayComparable comparable = 1;
+  required BitwiseOp bitwiseOp = 2;
+
+  enum BitwiseOp {
+    AND = 1;
+    OR = 2;
+    XOR = 3;
+  }
+}
+
+message NullComparator {
+}
+
+message RegexStringComparator {
+  required string pattern = 1;
+  required int32 patternFlags = 2;
+  required string charset = 3;
+}
+
+message SubstringComparator {
+  required string substr = 1;
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/Examples.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/Examples.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/Examples.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/Examples.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,37 @@
+/**
+ * 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.
+ */
+
+option java_package = "org.apache.hadoop.hbase.coprocessor.example.generated";
+option java_outer_classname = "ExampleProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message CountRequest {
+}
+
+message CountResponse {
+  required int64 count = 1 [default = 0];
+}
+
+service RowCountService {
+  rpc getRowCount(CountRequest)
+    returns (CountResponse);
+  rpc getKeyValueCount(CountRequest)
+    returns (CountResponse);
+}
\ No newline at end of file

Added: hbase/trunk/hbase-protocol/src/main/protobuf/FS.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/FS.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/FS.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/FS.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,44 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are written into the filesystem
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "FSProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * The ${HBASE_ROOTDIR}/hbase.version file content
+ */
+message HBaseVersionFileContent {
+  required string version = 1;
+}
+
+/**
+ * Reference file content used when we split an hfile under a region.
+ */
+message Reference {
+  required bytes splitkey = 1;
+  enum Range {
+    TOP = 0;
+    BOTTOM = 1;
+  }
+  required Range range = 2;
+}
+

Added: hbase/trunk/hbase-protocol/src/main/protobuf/Filter.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/Filter.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/Filter.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/Filter.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,152 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for filters
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "FilterProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "hbase.proto";
+import "Comparator.proto";
+
+message ColumnCountGetFilter {
+  required int32 limit = 1;
+}
+
+message ColumnPaginationFilter {
+  required int32 limit = 1;
+  optional int32 offset = 2;
+}
+
+message ColumnPrefixFilter {
+  required bytes prefix = 1;
+}
+
+message ColumnRangeFilter {
+  optional bytes minColumn = 1;
+  optional bool minColumnInclusive = 2;
+  optional bytes maxColumn = 3;
+  optional bool maxColumnInclusive = 4;
+}
+
+message CompareFilter {
+  required CompareType compareOp = 1;
+  optional Comparator comparator = 2;
+}
+
+message DependentColumnFilter {
+  required CompareFilter compareFilter = 1;
+  optional bytes columnFamily = 2;
+  optional bytes columnQualifier = 3;
+  optional bool dropDependentColumn = 4;
+}
+
+message FamilyFilter {
+  required CompareFilter compareFilter = 1;
+}
+
+message FilterList {
+  required Operator operator = 1;
+  repeated Filter filters = 2;
+
+  enum Operator {
+    MUST_PASS_ALL = 1;
+    MUST_PASS_ONE = 2;
+  }
+}
+
+message FilterWrapper {
+  required Filter filter = 1;
+}
+
+message FirstKeyOnlyFilter {
+}
+
+message FirstKeyValueMatchingQualifiersFilter {
+  repeated bytes qualifiers = 1;
+}
+
+message FuzzyRowFilter {
+  repeated BytesBytesPair fuzzyKeysData = 1;
+}
+
+message InclusiveStopFilter {
+  optional bytes stopRowKey = 1;
+}
+
+message KeyOnlyFilter {
+  required bool lenAsVal = 1;
+}
+
+message MultipleColumnPrefixFilter {
+  repeated bytes sortedPrefixes = 1;
+}
+
+message PageFilter {
+  required int64 pageSize = 1;
+}
+
+message PrefixFilter {
+  optional bytes prefix = 1;
+}
+
+message QualifierFilter {
+  required CompareFilter compareFilter = 1;
+}
+
+message RandomRowFilter {
+  required float chance = 1;
+}
+
+message RowFilter {
+  required CompareFilter compareFilter = 1;
+}
+
+message SingleColumnValueExcludeFilter {
+  required SingleColumnValueFilter singleColumnValueFilter = 1;
+}
+
+message SingleColumnValueFilter {
+  optional bytes columnFamily = 1;
+  optional bytes columnQualifier = 2;
+  required CompareType compareOp = 3;
+  required Comparator comparator = 4;
+  optional bool foundColumn = 5;
+  optional bool matchedColumn = 6;
+  optional bool filterIfMissing = 7;
+  optional bool latestVersionOnly = 8;
+}
+
+message SkipFilter {
+  required Filter filter = 1;
+}
+
+message TimestampsFilter {
+  repeated int64 timestamps = 1;
+}
+
+message ValueFilter {
+  required CompareFilter compareFilter = 1;
+}
+
+message WhileMatchFilter {
+  required Filter filter = 1;
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/LoadBalancer.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/LoadBalancer.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/LoadBalancer.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/LoadBalancer.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers to represent the state of the load balancer.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "LoadBalancerProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message LoadBalancerState {
+  optional bool balancerOn = 1;
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/Master.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/Master.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/Master.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/Master.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,38 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for protocols implemented by the master.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MasterProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message IsMasterRunningRequest {
+}
+
+message IsMasterRunningResponse {
+  required bool isMasterRunning = 1;
+}
+
+service MasterService {
+  /** return true if master is available */
+  rpc isMasterRunning(IsMasterRunningRequest)
+    returns(IsMasterRunningResponse);
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/MasterAdmin.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/MasterAdmin.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/MasterAdmin.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/MasterAdmin.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,283 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for MasterAdminProtocol.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MasterAdminProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "hbase.proto";
+import "Client.proto";
+
+/* Column-level protobufs */
+
+message AddColumnRequest {
+  required bytes tableName = 1;
+  required ColumnFamilySchema columnFamilies = 2;
+}
+
+message AddColumnResponse {
+}
+
+message DeleteColumnRequest {
+  required bytes tableName = 1;
+  required bytes columnName = 2;
+}
+
+message DeleteColumnResponse {
+}
+
+message ModifyColumnRequest {
+  required bytes tableName = 1;
+  required ColumnFamilySchema columnFamilies = 2;
+}
+
+message ModifyColumnResponse {
+}
+
+/* Region-level Protos */
+
+message MoveRegionRequest {
+  required RegionSpecifier region = 1;
+  optional ServerName destServerName = 2;
+}
+
+message MoveRegionResponse {
+}
+
+message AssignRegionRequest {
+  required RegionSpecifier region = 1;
+}
+
+message AssignRegionResponse {
+}
+
+message UnassignRegionRequest {
+  required RegionSpecifier region = 1;
+  optional bool force = 2 [default = false];
+}
+
+message UnassignRegionResponse {
+}
+
+message OfflineRegionRequest {
+  required RegionSpecifier region = 1;
+}
+
+message OfflineRegionResponse {
+}
+
+/* Table-level protobufs */
+
+message CreateTableRequest {
+  required TableSchema tableSchema = 1;
+  repeated bytes splitKeys = 2;
+}
+
+message CreateTableResponse {
+}
+
+message DeleteTableRequest {
+  required bytes tableName = 1;
+}
+
+message DeleteTableResponse {
+}
+
+message EnableTableRequest {
+  required bytes tableName = 1;
+}
+
+message EnableTableResponse {
+}
+
+message DisableTableRequest {
+  required bytes tableName = 1;
+}
+
+message DisableTableResponse {
+}
+
+message ModifyTableRequest {
+  required bytes tableName = 1;
+  required TableSchema tableSchema = 2;
+}
+
+message ModifyTableResponse {
+}
+
+/* Cluster-level protobufs */
+
+
+message ShutdownRequest {
+}
+
+message ShutdownResponse {
+}
+
+message StopMasterRequest {
+}
+
+message StopMasterResponse {
+}
+
+message BalanceRequest {
+}
+
+message BalanceResponse {
+  required bool balancerRan = 1;
+}
+
+message SetBalancerRunningRequest {
+  required bool on = 1;
+  optional bool synchronous = 2;
+}
+
+message SetBalancerRunningResponse {
+  optional bool prevBalanceValue = 1;
+}
+
+message CatalogScanRequest {
+}
+
+message CatalogScanResponse {
+  optional int32 scanResult = 1;
+}
+
+message EnableCatalogJanitorRequest {
+  required bool enable = 1;
+}
+
+message EnableCatalogJanitorResponse {
+  optional bool prevValue = 1;
+}
+
+message IsCatalogJanitorEnabledRequest {
+}
+
+message IsCatalogJanitorEnabledResponse {
+  required bool value = 1;
+}
+
+service MasterAdminService {
+  /** Adds a column to the specified table. */
+  rpc addColumn(AddColumnRequest)
+    returns(AddColumnResponse);
+
+  /** Deletes a column from the specified table. Table must be disabled. */
+  rpc deleteColumn(DeleteColumnRequest)
+    returns(DeleteColumnResponse);
+
+  /** Modifies an existing column on the specified table. */
+  rpc modifyColumn(ModifyColumnRequest)
+    returns(ModifyColumnResponse);
+
+  /** Move the region region to the destination server. */
+  rpc moveRegion(MoveRegionRequest)
+    returns(MoveRegionResponse);
+
+  /** Assign a region to a server chosen at random. */
+  rpc assignRegion(AssignRegionRequest)
+    returns(AssignRegionResponse);
+
+  /**
+   * Unassign a region from current hosting regionserver.  Region will then be
+   * assigned to a regionserver chosen at random.  Region could be reassigned
+   * back to the same server.  Use moveRegion if you want
+   * to control the region movement.
+   */
+  rpc unassignRegion(UnassignRegionRequest)
+    returns(UnassignRegionResponse);
+
+  /**
+   * Offline a region from the assignment manager's in-memory state.  The
+   * region should be in a closed state and there will be no attempt to
+   * automatically reassign the region as in unassign.   This is a special
+   * method, and should only be used by experts or hbck.
+   */
+  rpc offlineRegion(OfflineRegionRequest)
+    returns(OfflineRegionResponse);
+
+  /** Deletes a table */
+  rpc deleteTable(DeleteTableRequest)
+    returns(DeleteTableResponse);
+
+  /** Puts the table on-line (only needed if table has been previously taken offline) */
+  rpc enableTable(EnableTableRequest)
+    returns(EnableTableResponse);
+
+  /** Take table offline */
+  rpc disableTable(DisableTableRequest)
+    returns(DisableTableResponse);
+
+  /** Modify a table's metadata */
+  rpc modifyTable(ModifyTableRequest)
+    returns(ModifyTableResponse);
+
+  /** Creates a new table asynchronously */
+  rpc createTable(CreateTableRequest)
+    returns(CreateTableResponse);
+
+    /** Shutdown an HBase cluster. */
+  rpc shutdown(ShutdownRequest)
+    returns(ShutdownResponse);
+
+  /** Stop HBase Master only.  Does not shutdown the cluster. */
+  rpc stopMaster(StopMasterRequest)
+    returns(StopMasterResponse);
+
+  /**
+   * Run the balancer.  Will run the balancer and if regions to move, it will
+   * go ahead and do the reassignments.  Can NOT run for various reasons.
+   * Check logs.
+   */
+  rpc balance(BalanceRequest)
+    returns(BalanceResponse);
+
+  /**
+   * Turn the load balancer on or off.
+   * If synchronous is true, it waits until current balance() call, if outstanding, to return.
+   */
+  rpc setBalancerRunning(SetBalancerRunningRequest)
+    returns(SetBalancerRunningResponse);
+
+  /** Get a run of the catalog janitor */
+  rpc runCatalogScan(CatalogScanRequest)
+     returns(CatalogScanResponse);
+
+  /**
+   * Enable the catalog janitor on or off.
+   */
+  rpc enableCatalogJanitor(EnableCatalogJanitorRequest)
+     returns(EnableCatalogJanitorResponse);
+
+  /**
+   * Query whether the catalog janitor is enabled.
+   */
+  rpc isCatalogJanitorEnabled(IsCatalogJanitorEnabledRequest)
+     returns(IsCatalogJanitorEnabledResponse);
+
+  /**
+   * Call a master coprocessor endpoint
+   */
+  rpc execMasterService(CoprocessorServiceRequest)
+    returns(CoprocessorServiceResponse);
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/MasterMonitor.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/MasterMonitor.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/MasterMonitor.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/MasterMonitor.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,66 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for MasterMonitorProtocol.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MasterMonitorProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "hbase.proto";
+import "ClusterStatus.proto";
+
+message GetSchemaAlterStatusRequest {
+  required bytes tableName = 1;
+}
+
+message GetSchemaAlterStatusResponse {
+  optional uint32 yetToUpdateRegions = 1;
+  optional uint32 totalRegions = 2;
+}
+
+message GetTableDescriptorsRequest {
+  repeated string tableNames = 1;
+}
+
+message GetTableDescriptorsResponse {
+  repeated TableSchema tableSchema = 1;
+}
+
+message GetClusterStatusRequest {
+}
+
+message GetClusterStatusResponse {
+  required ClusterStatus clusterStatus = 1;
+}
+
+service MasterMonitorService {
+  /** Used by the client to get the number of regions that have received the updated schema */
+  rpc getSchemaAlterStatus(GetSchemaAlterStatusRequest)
+    returns(GetSchemaAlterStatusResponse);
+
+  /** Get list of TableDescriptors for requested tables. */
+  rpc getTableDescriptors(GetTableDescriptorsRequest)
+    returns(GetTableDescriptorsResponse);
+
+  /** Return cluster status. */
+  rpc getClusterStatus(GetClusterStatusRequest)
+    returns(GetClusterStatusResponse);
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/MultiRowMutation.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/MultiRowMutation.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/MultiRowMutation.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/MultiRowMutation.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,35 @@
+/**
+ * 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.
+ */
+import "Client.proto";
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "MultiRowMutation";
+option java_generate_equals_and_hash = true;
+option java_generic_services = true;
+option optimize_for = SPEED;
+
+message MultiMutateRequest {
+  repeated Mutate mutationRequest = 1;
+}
+
+message MultiMutateResponse {
+}
+
+service MultiRowMutationService {
+  rpc mutateRows(MultiMutateRequest) 
+      returns(MultiMutateResponse);
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/README.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/README.txt?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/README.txt (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/README.txt Tue Nov 20 23:26:00 2012
@@ -0,0 +1,27 @@
+These are the protobuf definition files used by hbase. The produced java
+classes are generated into src/main/java/org/apache/hadoop/hbase/protobuf/generated
+and then checked in.  The reasoning is that they change infrequently.
+
+To regnerate the classes after making definition file changes, ensure first that
+the protobuf protoc tool is in your $PATH (You may need to download it and build
+it first; its part of the protobuf package obtainable from here: 
+http://code.google.com/p/protobuf/downloads/list).  Then run the following (You
+should be able to just copy and paste the below into a terminal and hit return
+-- the protoc compiler runs fast):
+
+  UNIX_PROTO_DIR=src/main/protobuf
+  JAVA_DIR=src/main/java/
+  mkdir -p $JAVA_DIR 2> /dev/null
+  if which cygpath 2> /dev/null; then
+    PROTO_DIR=`cygpath --windows $UNIX_PROTO_DIR`
+    JAVA_DIR=`cygpath --windows $JAVA_DIR`
+  else
+    PROTO_DIR=$UNIX_PROTO_DIR
+  fi
+  for PROTO_FILE in $UNIX_PROTO_DIR/*.proto
+  do
+    protoc -I$PROTO_DIR --java_out=$JAVA_DIR $PROTO_FILE
+  done
+
+After you've done the above, check it in and then check it in (or post a patch
+on a JIRA with your definition file changes and the generated files).

Added: hbase/trunk/hbase-protocol/src/main/protobuf/RPC.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/RPC.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/RPC.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/RPC.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,140 @@
+/**
+ * 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.
+ */
+
+/**
+ * Specification of (unsecure) HBase RPC:
+ *
+ * Client needs to set up a connection first to a server serving a certain
+ * HBase protocol (like ClientProtocol). Once the connection is set up, the 
+ * client and server communicates on that channel for RPC requests/responses.
+ * The sections below describe the flow. 
+ * 
+ * As part of setting up a connection to a server, the client needs to send
+ * the ConnectionHeader header. At the data level, this looks like
+ * <"hrpc"-bytearray><'5'[byte]><length-of-serialized-ConnectionHeader-obj[int32]><ConnectionHeader-object serialized>
+ *
+ * For every RPC that the client makes it needs to send the following
+ * RpcRequestHeader and the RpcRequestBody. At the data level this looks like:
+ *  <length-of-serialized-RpcRequestHeader + length-of-varint32-of-serialized-RpcRequestHeader + 
+ *   length-of-serialized-RpcRequestBody + length-of-varint32-of-serialized-RpcRequestBody>
+ *  <RpcRequestHeader [serialized using Message.writeDelimitedTo]>
+ *  <RpcRequestBody [serialized using Message.writeDelimitedTo]>
+ *
+ * On a success, the server's protobuf response looks like
+ *  <RpcResponseHeader-object [serialized using Message.writeDelimitedTo]>
+ *  <RpcResponseBody-object [serialized using Message.writeDelimitedTo]>
+ * On a failure, the server's protobuf response looks like
+ *  <RpcResponseHeader-object [serialized using Message.writeDelimitedTo]>
+ *  <RpcException-object [serialized using Message.writeDelimitedTo]>
+ *
+ * There is one special message that's sent from client to server -
+ * the Ping message. At the data level, this is just the bytes corresponding
+ *   to integer -1.
+ */
+
+import "Tracing.proto"; 
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "RPCProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+message UserInformation {
+  required string effectiveUser = 1;
+  optional string realUser = 2;
+}
+
+message ConnectionHeader {
+  /** User Info beyond what is established at connection establishment
+   *  (applies to secure HBase setup)
+   */
+  optional UserInformation userInfo = 1;
+  /** Protocol name for next rpc layer
+   * the client created a proxy with this protocol name
+   */
+  optional string protocol = 2 [default = "org.apache.hadoop.hbase.client.ClientProtocol"];
+}
+
+
+/**
+ * The RPC request header
+ */
+message RpcRequestHeader {
+  /** Monotonically increasing callId, mostly to keep track of RPCs */
+  required uint32 callId = 1;
+  optional RPCTInfo tinfo = 2;
+}
+/**
+ * The RPC request body
+ */
+message RpcRequestBody {
+  /** Name of the RPC method */
+  required string methodName = 1;
+
+  /** protocol version of class declaring the called method */
+  optional uint64 clientProtocolVersion = 2;
+
+  /** Bytes corresponding to the client protobuf request. This is the actual
+   *  bytes corresponding to the RPC request argument.
+   */
+  optional bytes request = 3;
+
+  /** Some metainfo about the request. Helps us to treat RPCs with
+   *  different priorities. For now this is just the classname of the request
+   *  proto object. 
+   */
+  optional string requestClassName = 4;
+}
+
+/**
+ * The RPC response header
+ */
+message RpcResponseHeader {
+  /** Echo back the callId the client sent */
+  required uint32 callId = 1;
+  /** Did the RPC execution encounter an error at the server */
+  enum Status {
+    SUCCESS = 0;
+    ERROR = 1;
+    FATAL = 2;
+  }
+  required Status status = 2;
+}
+/**
+ * The RPC response body
+ */
+message RpcResponseBody {
+   /** Optional response bytes. This is the actual bytes corresponding to the
+    *  return value of the invoked RPC.
+    */
+  optional bytes response = 1;
+}
+/**
+ * At the RPC layer, this message is used to indicate
+ * the server side exception to the RPC client.
+ *
+ * HBase RPC client throws an exception indicated
+ * by exceptionName with the stackTrace.
+ */
+message RpcException {
+  /** Class name of the exception thrown from the server */
+  required string exceptionName = 1;
+
+  /** Exception stack trace from the server side */
+  optional string stackTrace = 2;
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/RegionServerStatus.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/RegionServerStatus.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/RegionServerStatus.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/RegionServerStatus.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,101 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are used for RegionServerStatusProtocol.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "RegionServerStatusProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "hbase.proto";
+
+message RegionServerStartupRequest {
+  /** Port number this regionserver is up on */
+  required uint32 port = 1;
+
+  /** This servers' startcode */
+  required uint64 serverStartCode = 2;
+
+  /** Current time of the region server in ms */
+  required uint64 serverCurrentTime = 3;
+}
+
+message RegionServerStartupResponse {
+  /**
+   * Configuration for the regionserver to use: e.g. filesystem,
+   * hbase rootdir, the hostname to use creating the RegionServer ServerName,
+   * etc
+   */
+  repeated NameStringPair mapEntries = 1;
+}
+
+message RegionServerReportRequest {
+  required ServerName server = 1;
+
+  /** load the server is under */
+  optional ServerLoad load = 2;
+}
+
+message RegionServerReportResponse {
+}
+
+message ReportRSFatalErrorRequest {
+  /** name of the server experiencing the error */
+  required ServerName server = 1;
+
+  /** informative text to expose in the master logs and UI */
+  required string errorMessage = 2;
+}
+
+message ReportRSFatalErrorResponse {
+}
+
+message GetLastFlushedSequenceIdRequest {
+  /** region name */
+  required bytes regionName = 1;
+}
+
+message GetLastFlushedSequenceIdResponse {
+  /** the last HLog sequence id flushed from MemStore to HFile for the region */
+  required uint64 lastFlushedSequenceId = 1;
+}
+
+service RegionServerStatusService {
+  /** Called when a region server first starts. */
+  rpc regionServerStartup(RegionServerStartupRequest)
+    returns(RegionServerStartupResponse);
+
+  /** Called to report the load the RegionServer is under. */
+  rpc regionServerReport(RegionServerReportRequest)
+    returns(RegionServerReportResponse);
+
+  /**
+   * Called by a region server to report a fatal error that is causing it to
+   * abort.
+   */
+  rpc reportRSFatalError(ReportRSFatalErrorRequest)
+    returns(ReportRSFatalErrorResponse);
+
+  /** Called to get the sequence id of the last MemStore entry flushed to an
+   * HFile for a specified region. Used by the region server to speed up
+   * log splitting. */
+  rpc getLastFlushedSequenceId(GetLastFlushedSequenceIdRequest)
+    returns(GetLastFlushedSequenceIdResponse);
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/Tracing.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/Tracing.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/Tracing.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/Tracing.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,31 @@
+/**
+ * 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.
+ */
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "Tracing";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+//Used to pass through the information necessary to continue
+//a trace after an RPC is made. All we need is the traceid 
+//(so we know the overarching trace this message is a part of), and
+//the id of the current span when this message was sent, so we know 
+//what span caused the new span we will create when this message is received.
+message RPCTInfo {
+  optional int64 traceId = 1;
+  optional int64 parentId = 2;
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/ZooKeeper.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/ZooKeeper.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/ZooKeeper.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/ZooKeeper.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,135 @@
+/**
+ * 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.
+ */
+
+// ZNode data in hbase are serialized protobufs with a four byte
+// 'magic' 'PBUF' prefix.
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "ZooKeeperProtos";
+option java_generic_services = true;
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+import "hbase.proto";
+
+/**
+ * Content of the root-region-server znode.
+ */
+message RootRegionServer {
+  // The ServerName hosting the root region currently.
+  required ServerName server = 1;
+}
+
+/**
+ * Content of the master znode.
+ */
+message Master {
+  // The ServerName of the current Master
+  required ServerName master = 1;
+}
+
+/**
+ * Content of the '/hbase/shutdown', cluster state, znode.
+ */
+message ClusterUp {
+  // If this znode is present, cluster is up.  Currently
+  // the data is cluster startDate.
+  required string startDate = 1;
+}
+
+/**
+ * What we write under unassigned up in zookeeper as a region moves through
+ * open/close, etc., regions.  Details a region in transition.
+ */
+message RegionTransition {
+  // Code for EventType gotten by doing o.a.h.h.EventHandler.EventType.getCode()
+  required uint32 eventTypeCode = 1;
+  // Full regionname in bytes
+  required bytes regionName = 2;
+  required uint64 createTime = 3;
+  // The region server where the transition will happen or is happening
+  required ServerName serverName = 4;
+  optional bytes payload = 5;
+}
+
+/**
+ * WAL SplitLog directory znodes have this for content.  Used doing distributed
+ * WAL splitting.  Holds current state and name of server that originated split.
+ */
+message SplitLogTask {
+  enum State {
+    UNASSIGNED = 0;
+    OWNED = 1;
+    RESIGNED = 2;
+    DONE = 3;
+    ERR = 4;
+  }
+  required State state = 1;
+  required ServerName serverName = 2;
+}
+
+/**
+ * The znode that holds state of table.
+ */
+message Table {
+  // Table's current state
+  enum State {
+    ENABLED = 0;
+    DISABLED = 1;
+    DISABLING = 2;
+    ENABLING = 3;
+  }
+  // This is the table's state.  If no znode for a table,
+  // its state is presumed enabled.  See o.a.h.h.zookeeper.ZKTable class
+  // for more.
+  required State state = 1 [default = ENABLED];
+}
+
+/**
+ * Used by replication. Holds a replication peer key.
+ */
+message ReplicationPeer {
+  // clusterKey is the concatenation of the slave cluster's
+  // hbase.zookeeper.quorum:hbase.zookeeper.property.clientPort:zookeeper.znode.parent
+  required string clusterkey = 1;
+}
+
+/**
+ * Used by replication. Holds whether enabled or disabled
+ */
+message ReplicationState {
+  enum State {
+    ENABLED = 0;
+    DISABLED = 1;
+  }
+  required State state = 1;
+}
+
+/**
+ * Used by replication. Holds the current position in an HLog file.
+ */
+message ReplicationHLogPosition {
+  required int64 position = 1;
+}
+
+/**
+ * Used by replication. Used to lock a region server during failover.
+ */
+message ReplicationLock {
+  required string lockOwner = 1;
+}

Added: hbase/trunk/hbase-protocol/src/main/protobuf/hbase.proto
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-protocol/src/main/protobuf/hbase.proto?rev=1411922&view=auto
==============================================================================
--- hbase/trunk/hbase-protocol/src/main/protobuf/hbase.proto (added)
+++ hbase/trunk/hbase-protocol/src/main/protobuf/hbase.proto Tue Nov 20 23:26:00 2012
@@ -0,0 +1,268 @@
+/**
+ * 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.
+ */
+
+// This file contains protocol buffers that are shared throughout HBase
+
+option java_package = "org.apache.hadoop.hbase.protobuf.generated";
+option java_outer_classname = "HBaseProtos";
+option java_generate_equals_and_hash = true;
+option optimize_for = SPEED;
+
+/**
+ * Table Schema
+ * Inspired by the rest TableSchema
+ */
+message TableSchema {
+  optional bytes name = 1;
+  message Attribute {
+    required bytes name = 1;
+    required bytes value = 2;
+  }
+  repeated Attribute attributes = 2;
+  repeated ColumnFamilySchema columnFamilies = 3;
+}
+
+/**
+ * Column Family Schema
+ * Inspired by the rest ColumSchemaMessage
+ */
+message ColumnFamilySchema {
+  required bytes name = 1;
+  message Attribute {
+    required bytes name = 1;
+    required bytes value = 2;
+  }
+  repeated Attribute attributes = 2;
+}
+
+/**
+ * Protocol buffer version of HRegionInfo.
+ */
+message RegionInfo {
+  required uint64 regionId = 1;
+  required bytes tableName = 2;
+  optional bytes startKey = 3;
+  optional bytes endKey = 4;
+  optional bool offline = 5;
+  optional bool split = 6;
+}
+
+/**
+ * Container protocol buffer to specify a region.
+ * You can specify region by region name, or the hash
+ * of the region name, which is known as encoded
+ * region name.
+ */
+message RegionSpecifier {
+  required RegionSpecifierType type = 1;
+  required bytes value = 2;
+
+  enum RegionSpecifierType {
+    // <tablename>,<startkey>,<regionId>.<encodedName>
+    REGION_NAME = 1;
+
+    // hash of <tablename>,<startkey>,<regionId>
+    ENCODED_REGION_NAME = 2;
+  }
+}
+
+message RegionLoad {
+  /** the region specifier */
+  required RegionSpecifier regionSpecifier = 1;
+
+  /** the number of stores for the region */
+  optional uint32 stores = 2;
+
+  /** the number of storefiles for the region */
+  optional uint32 storefiles = 3;
+
+  /** the total size of the store files for the region, uncompressed, in MB */
+  optional uint32 storeUncompressedSizeMB = 4;
+
+  /** the current total size of the store files for the region, in MB */
+  optional uint32 storefileSizeMB = 5;
+
+  /** the current size of the memstore for the region, in MB */
+  optional uint32 memstoreSizeMB = 6;
+
+  /**
+   * The current total size of root-level store file indexes for the region,
+   * in MB. The same as {@link #rootIndexSizeKB} but in MB.
+   */
+  optional uint32 storefileIndexSizeMB = 7;
+
+  /** the current total read requests made to region */
+  optional uint64 readRequestsCount = 8;
+
+  /** the current total write requests made to region */
+  optional uint64 writeRequestsCount = 9;
+
+  /** the total compacting key values in currently running compaction */
+  optional uint64 totalCompactingKVs = 10;
+
+  /** the completed count of key values in currently running compaction */
+  optional uint64 currentCompactedKVs = 11;
+
+   /** The current total size of root-level indexes for the region, in KB. */
+  optional uint32 rootIndexSizeKB = 12;
+
+  /** The total size of all index blocks, not just the root level, in KB. */
+  optional uint32 totalStaticIndexSizeKB = 13;
+
+  /**
+   * The total size of all Bloom filter blocks, not just loaded into the
+   * block cache, in KB.
+   */
+  optional uint32 totalStaticBloomSizeKB = 14;
+
+  /** Region-level coprocessors. */
+  repeated Coprocessor coprocessors = 15;
+
+  /** the most recent sequence Id from cache flush */
+  optional uint64 completeSequenceId = 16;
+}
+
+/* Server-level protobufs */
+
+message ServerLoad {
+  /** Number of requests since last report. */
+  optional uint32 numberOfRequests = 1;
+
+  /** Total Number of requests from the start of the region server. */
+  optional uint32 totalNumberOfRequests = 2;
+
+  /** the amount of used heap, in MB. */
+  optional uint32 usedHeapMB = 3;
+
+  /** the maximum allowable size of the heap, in MB. */
+  optional uint32 maxHeapMB = 4;
+
+  /** Information on the load of individual regions. */
+  repeated RegionLoad regionLoads = 5;
+
+  /**
+   * Regionserver-level coprocessors, e.g., WALObserver implementations.
+   * Region-level coprocessors, on the other hand, are stored inside RegionLoad
+   * objects.
+   */
+  repeated Coprocessor coprocessors = 6;
+
+  /**
+   * Time when incremental (non-total) counts began being calculated (e.g. numberOfRequests)
+   * time is measured as the difference, measured in milliseconds, between the current time
+   * and midnight, January 1, 1970 UTC.
+   */
+  optional uint64 reportStartTime = 7;
+
+  /**
+   * Time when report was generated.
+   * time is measured as the difference, measured in milliseconds, between the current time
+   * and midnight, January 1, 1970 UTC.
+   */
+  optional uint64 reportEndTime = 8;
+
+  /**
+   * The port number that this region server is hosing an info server on.
+   */
+  optional uint32 infoServerPort = 9;
+}
+
+/**
+ * A range of time. Both from and to are Java time
+ * stamp in milliseconds. If you don't specify a time
+ * range, it means all time.  By default, if not 
+ * specified, from = 0, and to = Long.MAX_VALUE
+ */
+message TimeRange {
+  optional uint64 from = 1;
+  optional uint64 to = 2;
+}
+
+message Filter {
+  required string name = 1;
+  optional bytes serializedFilter = 2;
+}
+
+/* Comparison operators */
+enum CompareType {
+  LESS = 0;
+  LESS_OR_EQUAL = 1;
+  EQUAL = 2;
+  NOT_EQUAL = 3;
+  GREATER_OR_EQUAL = 4;
+  GREATER = 5;
+  NO_OP = 6;
+}
+
+/**
+ * The type of the key in a KeyValue.
+ */
+enum KeyType {
+    MINIMUM = 0;
+    PUT = 4;
+
+    DELETE = 8;
+    DELETE_COLUMN = 12;
+    DELETE_FAMILY = 14;
+
+    // MAXIMUM is used when searching; you look from maximum on down.
+    MAXIMUM = 255;
+}
+
+/**
+ * Protocol buffer version of KeyValue.
+ * It doesn't have those transient parameters
+ */
+message KeyValue {
+  required bytes row = 1;
+  required bytes family = 2;
+  required bytes qualifier = 3;
+  optional uint64 timestamp = 4;
+  optional KeyType keyType = 5;
+  optional bytes value = 6;
+}
+
+/**
+ * Protocol buffer version of ServerName
+ */
+message ServerName {
+  required string hostName = 1;
+  optional uint32 port = 2;
+  optional uint64 startCode = 3;
+}
+
+// Comment data structures
+
+message Coprocessor {
+  required string name = 1;
+}
+
+message NameStringPair {
+  required string name = 1;
+  required string value = 2;
+}
+
+message NameBytesPair {
+  required string name = 1;
+  optional bytes value = 2;
+}
+
+message BytesBytesPair {
+  required bytes first = 1;
+  required bytes second = 2;
+}

Modified: hbase/trunk/hbase-server/pom.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/pom.xml?rev=1411922&r1=1411921&r2=1411922&view=diff
==============================================================================
--- hbase/trunk/hbase-server/pom.xml (original)
+++ hbase/trunk/hbase-server/pom.xml Tue Nov 20 23:26:00 2012
@@ -272,6 +272,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.hbase</groupId>
+      <artifactId>hbase-protocol</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hbase</groupId>
       <artifactId>hbase-common</artifactId>
       <type>test-jar</type>
     </dependency>

Modified: hbase/trunk/pom.xml
URL: http://svn.apache.org/viewvc/hbase/trunk/pom.xml?rev=1411922&r1=1411921&r2=1411922&view=diff
==============================================================================
--- hbase/trunk/pom.xml (original)
+++ hbase/trunk/pom.xml Tue Nov 20 23:26:00 2012
@@ -50,6 +50,7 @@
   <url>http://hbase.apache.org</url>
   <modules>
     <module>hbase-server</module>
+    <module>hbase-protocol</module>
     <module>hbase-hadoop2-compat</module>
     <module>hbase-hadoop1-compat</module>
     <module>hbase-hadoop-compat</module>
@@ -917,6 +918,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.hbase</groupId>
+        <artifactId>hbase-protocol</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.hbase</groupId>
         <artifactId>hbase-hadoop-compat</artifactId>
         <version>${project.version}</version>
       </dependency>