@@ -28,6 +28,7 @@ import "HBase.proto";
2828import "Filter.proto" ;
2929import "Cell.proto" ;
3030import "Comparator.proto" ;
31+ import "MapReduce.proto" ;
3132
3233/**
3334 * The protocol buffer version of Authorizations.
@@ -51,6 +52,14 @@ message Column {
5152 repeated bytes qualifier = 2 ;
5253}
5354
55+ /**
56+ * Consistency defines the expected consistency level for an operation.
57+ */
58+ enum Consistency {
59+ STRONG = 0 ;
60+ TIMELINE = 1 ;
61+ }
62+
5463/**
5564 * The protocol buffer version of Get.
5665 * Unless existence_only is specified, return all the requested data
@@ -75,6 +84,9 @@ message Get {
7584 // If the row to get doesn't exist, return the
7685 // closest row before.
7786 optional bool closest_row_before = 11 [default = false ];
87+
88+ optional Consistency consistency = 12 [default = STRONG ];
89+ repeated ColumnFamilyTimeRange cf_time_range = 13 ;
7890}
7991
8092message Result {
@@ -92,6 +104,15 @@ message Result {
92104 // used for Get to check existence only. Not set if existence_only was not set to true
93105 // in the query.
94106 optional bool exists = 3 ;
107+
108+ // Whether or not the results are coming from possibly stale data
109+ optional bool stale = 4 [default = false ];
110+
111+ // Whether or not the entire result could be returned. Results will be split when
112+ // the RPC chunk size limit is reached. Partial results contain only a subset of the
113+ // cells for a row and must be combined with a result containing the remaining cells
114+ // to form a complete result
115+ optional bool partial = 5 [default = false ];
95116}
96117
97118/**
@@ -233,7 +254,10 @@ message Scan {
233254 optional bool load_column_families_on_demand = 13 ; /* DO NOT add defaults to load_column_families_on_demand. */
234255 optional bool small = 14 ;
235256 optional bool reversed = 15 [default = false ];
257+ optional Consistency consistency = 16 [default = STRONG ];
236258 optional uint32 caching = 17 ;
259+ optional bool allow_partial_results = 18 ;
260+ repeated ColumnFamilyTimeRange cf_time_range = 19 ;
237261}
238262
239263/**
@@ -254,6 +278,10 @@ message ScanRequest {
254278 optional uint32 number_of_rows = 4 ;
255279 optional bool close_scanner = 5 ;
256280 optional uint64 next_call_seq = 6 ;
281+ optional bool client_handles_partials = 7 ;
282+ optional bool client_handles_heartbeats = 8 ;
283+ optional bool track_scan_metrics = 9 ;
284+ optional bool renew = 10 [default = false ];
257285}
258286
259287/**
@@ -269,13 +297,40 @@ message ScanResponse {
269297 // has 3, 3, 3 in it, then we know that on the client, we are to make
270298 // three Results each of three Cells each.
271299 repeated uint32 cells_per_result = 1 ;
300+
272301 optional uint64 scanner_id = 2 ;
273302 optional bool more_results = 3 ;
274303 optional uint32 ttl = 4 ;
275304 // If cells are not carried in an accompanying cellblock, then they are pb'd here.
276305 // This field is mutually exclusive with cells_per_result (since the Cells will
277306 // be inside the pb'd Result)
278307 repeated Result results = 5 ;
308+ optional bool stale = 6 ;
309+
310+ // This field is filled in if we are doing cellblocks. In the event that a row
311+ // could not fit all of its cells into a single RPC chunk, the results will be
312+ // returned as partials, and reconstructed into a complete result on the client
313+ // side. This field is a list of flags indicating whether or not the result
314+ // that the cells belong to is a partial result. For example, if this field
315+ // has false, false, true in it, then we know that on the client side, we need to
316+ // make another RPC request since the last result was only a partial.
317+ repeated bool partial_flag_per_result = 7 ;
318+
319+ // A server may choose to limit the number of results returned to the client for
320+ // reasons such as the size in bytes or quantity of results accumulated. This field
321+ // will true when more results exist in the current region.
322+ optional bool more_results_in_region = 8 ;
323+
324+ // This field is filled in if the server is sending back a heartbeat message.
325+ // Heartbeat messages are sent back to the client to prevent the scanner from
326+ // timing out. Seeing a heartbeat message communicates to the Client that the
327+ // server would have continued to scan had the time limit not been reached.
328+ optional bool heartbeat_message = 9 ;
329+
330+ // This field is filled in if the client has requested that scan metrics be tracked.
331+ // The metrics tracked here are sent back to the client to be tracked together with
332+ // the existing client side metrics.
333+ optional ScanMetrics scan_metrics = 10 ;
279334}
280335
281336/**
@@ -338,6 +393,24 @@ message RegionAction {
338393 repeated Action action = 3 ;
339394}
340395
396+ /*
397+ * Statistics about the current load on the region
398+ */
399+ message RegionLoadStats {
400+ // Percent load on the memstore. Guaranteed to be positive, between 0 and 100.
401+ optional int32 memstoreLoad = 1 [default = 0 ];
402+ // Percent JVM heap occupancy. Guaranteed to be positive, between 0 and 100.
403+ // We can move this to "ServerLoadStats" should we develop them.
404+ optional int32 heapOccupancy = 2 [default = 0 ];
405+ // Compaction pressure. Guaranteed to be positive, between 0 and 100.
406+ optional int32 compactionPressure = 3 [default = 0 ];
407+ }
408+
409+ message MultiRegionLoadStats {
410+ repeated RegionSpecifier region = 1 ;
411+ repeated RegionLoadStats stat = 2 ;
412+ }
413+
341414/**
342415 * Either a Result or an Exception NameBytesPair (keyed by
343416 * exception name whose value is the exception stringified)
@@ -351,6 +424,8 @@ message ResultOrException {
351424 optional NameBytesPair exception = 3 ;
352425 // result if this was a coprocessor service call
353426 optional CoprocessorServiceResult service_result = 4 ;
427+ // current load on the region
428+ optional RegionLoadStats loadStats = 5 [deprecated =true ];
354429}
355430
356431/**
@@ -379,25 +454,29 @@ message MultiResponse {
379454 repeated RegionActionResult regionActionResult = 1 ;
380455 // used for mutate to indicate processed only
381456 optional bool processed = 2 ;
457+ optional MultiRegionLoadStats regionStatistics = 3 ;
382458}
383459
384460
385461service ClientService {
386462 rpc Get (GetRequest )
387- returns (GetResponse );
463+ returns (GetResponse );
388464
389465 rpc Mutate (MutateRequest )
390- returns (MutateResponse );
466+ returns (MutateResponse );
391467
392468 rpc Scan (ScanRequest )
393- returns (ScanResponse );
469+ returns (ScanResponse );
394470
395471 rpc BulkLoadHFile (BulkLoadHFileRequest )
396- returns (BulkLoadHFileResponse );
472+ returns (BulkLoadHFileResponse );
397473
398474 rpc ExecService (CoprocessorServiceRequest )
399- returns (CoprocessorServiceResponse );
475+ returns (CoprocessorServiceResponse );
476+
477+ rpc ExecRegionServerService (CoprocessorServiceRequest )
478+ returns (CoprocessorServiceResponse );
400479
401480 rpc Multi (MultiRequest )
402- returns (MultiResponse );
481+ returns (MultiResponse );
403482}
0 commit comments