Review Board 1.7.22


HBASE-5445, First draft of Protobufs specification for HMasterInterface

Review Request #4283 - Created March 10, 2012 and updated

Gregory Chanan
HBASE-5445
Reviewers
hbase
hbase-git
First draft of the protobufs specification for HMasterInterface.
This is relatively close to a one-to-one mapping with the existing interface.  A pdf listing the existing-to-protobufs mapping is available on the JIRA: https://issues.apache.org/jira/browse/HBASE-5445

Thanks to Devaraj who provided some initial work he had done on this.

 

Diff revision 1 (Latest)

  1. src/main/proto/HMasterProtocol.proto: Loading...
  2. src/main/proto/hbase.proto: Loading...
src/main/proto/HMasterProtocol.proto
New File

    
   
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
// This file contains protocol buffers that are used for HMasterProtocol.

    
   
20

   

    
   
21
option java_package = "org.apache.hadoop.hbase.protobuf.generated";

    
   
22
option java_outer_classname = "HMasterProtocol";

    
   
23
option java_generic_services = true;

    
   
24
option java_generate_equals_and_hash = true;

    
   
25
option optimize_for = SPEED;

    
   
26

   

    
   
27
import "hbase.proto";

    
   
28

   

    
   
29
/* Column-level protobufs */

    
   
30

   

    
   
31
message AddColumnRequest {

    
   
32
  required bytes tableName = 1;

    
   
33
  required ColumnDescriptor columnDesc = 2;

    
   
34
}

    
   
35

   

    
   
36
message AddColumnResponse {

    
   
37
}

    
   
38

   

    
   
39
message DeleteColumnRequest {

    
   
40
  required bytes tableName = 1;

    
   
41
  required bytes columnName = 2;

    
   
42
}

    
   
43

   

    
   
44
message DeleteColumnResponse {

    
   
45
}

    
   
46

   

    
   
47
message ModifyColumnRequest {

    
   
48
  required bytes tableName = 1;

    
   
49
  required ColumnDescriptor columnDesc = 2;

    
   
50
}

    
   
51

   

    
   
52
message ModifyColumnResponse {

    
   
53
}

    
   
54

   

    
   
55
/* Region-level protobufs */

    
   
56

   

    
   
57
message MoveRegionRequest {

    
   
58
  required RegionSpecifier region = 1;

    
   
59
  required ServerSpecifier destServer = 2;

    
   
60
}

    
   
61

   

    
   
62
message MoveRegionResponse {

    
   
63
}

    
   
64

   

    
   
65
message AssignRegionRequest {

    
   
66
  required RegionSpecifier region = 1;

    
   
67
}

    
   
68

   

    
   
69
message AssignRegionResponse {

    
   
70
}

    
   
71

   

    
   
72
message UnassignRegionRequest {

    
   
73
  required RegionSpecifier region = 1;

    
   
74

   

    
   
75
  /* If true, force unassign (Will remove region from

    
   
76
   * regions-in-transition too if present as well as from assigned regions --

    
   
77
   * radical!  If results in double assignment use hbck -fix to resolve.

    
   
78
   */

    
   
79
  optional bool force = 2 [default = false];

    
   
80
}

    
   
81

   

    
   
82
message UnassignRegionResponse {

    
   
83
}

    
   
84

   

    
   
85
message RegionState {

    
   
86
  required RegionInfo regionInfo = 1;

    
   
87
  required State state = 2;

    
   
88
  optional uint64 stamp = 3;

    
   
89

   

    
   
90
  enum State {

    
   
91
    OFFLINE,        // region is in an offline state

    
   
92
    PENDING_OPEN,   // sent rpc to server to open but has not begun

    
   
93
    OPENING,        // server has begun to open but not yet done

    
   
94
    OPEN,           // server opened region and updated meta

    
   
95
    PENDING_CLOSE,  // sent rpc to server to close but has not begun

    
   
96
    CLOSING,        // server has begun to close but not yet done

    
   
97
    CLOSED,         // server closed region and updated meta

    
   
98
    SPLITTING,      // server started split of a region

    
   
99
    SPLIT           // server completed split of a region

    
   
100
  }

    
   
101
}

    
   
102

   

    
   
103
message RegionInTransition {

    
   
104
  required string name = 1;

    
   
105
  required RegionState regionState = 2;

    
   
106
}

    
   
107

   

    
   
108
/* Server-level protobufs */

    
   
109

   

    
   
110
message LiveServerInfo {

    
   
111
  required ServerSpecifier server = 1;

    
   
112
  required ServerLoad serverLoad = 2;

    
   
113
}

    
   
114

   

    
   
115
/* Table-level protobufs */

    
   
116

   

    
   
117
message CreateTableRequest {

    
   
118
  required TableDescriptor tableDesc = 1;

    
   
119
  repeated bytes splitKeys = 2;

    
   
120
}

    
   
121

   

    
   
122
message CreateTableResponse {

    
   
123
}

    
   
124

   

    
   
125
message DeleteTableRequest {

    
   
126
  required bytes tableName = 1;

    
   
127
}

    
   
128

   

    
   
129
message DeleteTableResponse {

    
   
130
}

    
   
131

   

    
   
132
message EnableTableRequest {

    
   
133
  required bytes tableName = 1;

    
   
134
}

    
   
135

   

    
   
136
message EnableTableResponse {

    
   
137
}

    
   
138

   

    
   
139
message DisableTableRequest {

    
   
140
  required bytes tableName = 1;

    
   
141
}

    
   
142

   

    
   
143
message DisableTableResponse {

    
   
144
}

    
   
145

   

    
   
146
message ModifyTableRequest {

    
   
147
  required bytes tableName = 1;

    
   
148
  required TableDescriptor tableDesc = 2;

    
   
149
}

    
   
150

   

    
   
151
message ModifyTableResponse {

    
   
152
}

    
   
153

   

    
   
154
message GetSchemaAlterStatusRequest {

    
   
155
  required bytes tableName = 1;

    
   
156
}

    
   
157

   

    
   
158
message GetSchemaAlterStatusResponse {

    
   
159
  optional uint64 yetToUpdateRegions = 1;

    
   
160
  optional uint64 totalRegions = 2;

    
   
161
}

    
   
162

   

    
   
163
/* Cluster-level protobufs */

    
   
164

   

    
   
165
message IsMasterRunningRequest {

    
   
166
}

    
   
167

   

    
   
168
message IsMasterRunningResponse {

    
   
169
  required bool masterRunning = 1;

    
   
170
}

    
   
171

   

    
   
172
message ShutdownRequest {

    
   
173
}

    
   
174

   

    
   
175
message ShutdownResponse {

    
   
176
}

    
   
177

   

    
   
178
message StopMasterRequest {

    
   
179
}

    
   
180

   

    
   
181
message StopMasterResponse {

    
   
182
}

    
   
183

   

    
   
184
message GetClusterStatusRequest {

    
   
185
}

    
   
186

   

    
   
187
message GetClusterStatusResponse {

    
   
188
  required ClusterStatus clusterStatus = 1;

    
   
189
}

    
   
190

   

    
   
191
message GetTableDescriptorsRequest {

    
   
192
  repeated bytes tableNames = 1;

    
   
193
}

    
   
194

   

    
   
195
message GetTableDescriptorsResponse {

    
   
196
  repeated TableDescriptor tableDescs = 1;

    
   
197
}

    
   
198

   

    
   
199
message IsLoadBalancerRunningRequest {

    
   
200
}

    
   
201

   

    
   
202
message IsLoadBalancerRunningResponse {

    
   
203
  required bool isRunning = 1;

    
   
204
}

    
   
205

   

    
   
206
message BalanceRequest {

    
   
207
}

    
   
208

   

    
   
209
message BalanceResponse {

    
   
210
  required bool balancerRan = 1;

    
   
211
}

    
   
212

   

    
   
213
message LoadBalancerSwitchIsRequest {

    
   
214
  required bool on = 1;

    
   
215
  optional bool synchronous = 2 [default = false];

    
   
216
}

    
   
217

   

    
   
218
message LoadBalancerSwitchIsResponse {

    
   
219
  optional bool prevBalanceValue = 1;

    
   
220
}

    
   
221

   

    
   
222
message ClusterStatus {

    
   
223
  optional string hbaseVersion = 1;

    
   
224
  repeated LiveServerInfo liveServers = 2;

    
   
225
  repeated ServerSpecifier deadServers = 3;

    
   
226
  repeated RegionInTransition regionsInTransition = 4;

    
   
227
  optional string clusterId = 5;

    
   
228
  repeated Coprocessor masterCoprocessors = 6;

    
   
229
  optional ServerSpecifier master = 7;

    
   
230
  repeated ServerSpecifier backupMasters = 8;

    
   
231
}

    
   
232

   

    
   
233
service HMasterService {

    
   
234
  /* Column-level rpcs */

    
   
235
  rpc addColumn(AddColumnRequest)

    
   
236
    returns(AddColumnResponse);

    
   
237

   

    
   
238
  rpc deleteColumn(DeleteColumnRequest)

    
   
239
    returns(DeleteColumnResponse);

    
   
240

   

    
   
241
  rpc modifyColumn(ModifyColumnRequest)

    
   
242
    returns(ModifyColumnResponse);

    
   
243

   

    
   
244
  /* Region-level rpcs */

    
   
245
  rpc moveRegion(MoveRegionRequest)

    
   
246
    returns(MoveRegionResponse);

    
   
247

   

    
   
248
  rpc assignRegion(AssignRegionRequest)

    
   
249
    returns(AssignRegionResponse);

    
   
250

   

    
   
251
  rpc unassignRegion(UnassignRegionRequest)

    
   
252
    returns(UnassignRegionResponse);

    
   
253

   

    
   
254
  /* Table-level rpcs */

    
   
255
  rpc createTable(CreateTableRequest)

    
   
256
    returns(CreateTableResponse);

    
   
257

   

    
   
258
  rpc deleteTable(DeleteTableRequest)

    
   
259
    returns(DeleteTableResponse);

    
   
260

   

    
   
261
  rpc enableTable(EnableTableRequest)

    
   
262
    returns(EnableTableResponse);

    
   
263

   

    
   
264
  rpc disableTable(DisableTableRequest)

    
   
265
    returns(DisableTableResponse);

    
   
266

   

    
   
267
  rpc modifyTable(ModifyTableRequest)

    
   
268
    returns(ModifyTableResponse);

    
   
269

   

    
   
270
  rpc getSchemeAlterStatus(GetSchemaAlterStatusRequest)

    
   
271
    returns(GetSchemaAlterStatusResponse);

    
   
272

   

    
   
273
  /* Cluster-level rpcs */

    
   
274
  rpc isMasterRunning(IsMasterRunningRequest)

    
   
275
    returns(IsMasterRunningResponse);

    
   
276

   

    
   
277
  rpc shutdown(ShutdownRequest)

    
   
278
    returns(ShutdownResponse);

    
   
279

   

    
   
280
  rpc stopMaster(StopMasterRequest)

    
   
281
    returns(StopMasterResponse);

    
   
282

   

    
   
283
  rpc getClusterStatus(GetClusterStatusRequest)

    
   
284
    returns(GetClusterStatusResponse);

    
   
285

   

    
   
286
  rpc getTableDescriptors(GetTableDescriptorsRequest)

    
   
287
    returns(GetTableDescriptorsResponse);

    
   
288

   

    
   
289
  rpc isLoadBalancerRunning(IsLoadBalancerRunningRequest)

    
   
290
    returns(IsLoadBalancerRunningResponse);

    
   
291

   

    
   
292
  rpc balance(BalanceRequest)

    
   
293
    returns(BalanceResponse);

    
   
294

   

    
   
295
  rpc loadBalancerSwitchIs(LoadBalancerSwitchIsRequest)

    
   
296
    returns(LoadBalancerSwitchIsResponse);

    
   
297
}
src/main/proto/hbase.proto
New File
 
  1. src/main/proto/HMasterProtocol.proto: Loading...
  2. src/main/proto/hbase.proto: Loading...