Skip to content

Commit a7b4d93

Browse files
committed
Merge branch 'next'
2 parents 18a5892 + 003c606 commit a7b4d93

39 files changed

Lines changed: 4455 additions & 253 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ build/
22
pom.xml
33
target/
44
/bin/
5+
.idea

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ script: export MAVEN_OPTS="-Xmx1024m" && mvn test --quiet
1414
jdk:
1515
- oraclejdk7
1616
- openjdk6
17+
- oraclejdk8
1718
notifications:
1819
email: false
1920
addons:

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (C) 2010-2016 The Async HBase Authors. All rights reserved.
22
# This file is part of Async HBase.
3-
#
3+
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions are met:
66
# - Redistributions of source code must retain the above copyright notice,
@@ -39,7 +39,7 @@ proto_builddir := $(top_builddir)/protobuf
3939
spec_title := Asynchronous HBase Client
4040
spec_vendor := The Async HBase Authors
4141
# Semantic Versioning (see http://semver.org/).
42-
spec_version := 1.7.3
42+
spec_version := 1.8.0-SNAPSHOT
4343
jar := $(top_builddir)/asynchbase-$(spec_version).jar
4444

4545
asynchbase_PROTOS := \
@@ -53,20 +53,26 @@ asynchbase_PROTOS := \
5353
protobuf/Tracing.proto \
5454
protobuf/ZooKeeper.proto \
5555
protobuf/HBase.proto \
56-
56+
protobuf/ClusterId.proto \
57+
protobuf/ClusterStatus.proto \
58+
protobuf/FS.proto \
59+
protobuf/MapReduce.proto \
60+
5761
PROTOBUF_GEN_DIR = $(top_builddir)/src/org/hbase/async/generated
5862

5963
BUILT_SOURCES := $(asynchbase_PROTOS:protobuf/%.proto=$(PROTOBUF_GEN_DIR)/%PB.java)
6064

6165
asynchbase_SOURCES := \
6266
src/AppendRequest.java \
6367
src/AtomicIncrementRequest.java \
68+
src/MultiColumnAtomicIncrementRequest.java \
6469
src/BatchableRpc.java \
6570
src/BinaryComparator.java \
6671
src/BinaryPrefixComparator.java \
6772
src/BitComparator.java \
6873
src/BrokenMetaException.java \
6974
src/BufferedIncrement.java \
75+
src/BufferedMultiColumnIncrement.java \
7076
src/Bytes.java \
7177
src/ClientStats.java \
7278
src/ColumnPaginationFilter.java \
@@ -85,6 +91,7 @@ asynchbase_SOURCES := \
8591
src/FirstKeyOnlyFilter.java \
8692
src/FuzzyRowFilter.java \
8793
src/GetRequest.java \
94+
src/GetResultOrException.java \
8895
src/HBaseClient.java \
8996
src/HBaseException.java \
9097
src/HBaseRpc.java \
@@ -94,6 +101,7 @@ asynchbase_SOURCES := \
94101
src/KeyRegexpFilter.java \
95102
src/KeyValue.java \
96103
src/MultiAction.java \
104+
src/MultipleColumnPrefixFilter.java \
97105
src/NoSuchColumnFamilyException.java \
98106
src/NonRecoverableException.java \
99107
src/NotServingRegionException.java \

pom.xml.in

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,45 @@
166166

167167
</plugins>
168168
</build>
169+
170+
<profiles>
171+
<!-- CGlib in Mockito and PowerMockito has issues mocking the Subject class under javax.security.auth.
172+
It should work better in 2.x so until that comes out, we'll just skip the auth test classes when running
173+
under JDK 8.
174+
175+
The exception observed is:
176+
java.lang.LinkageError: loader constraint violation in interface itable initialization:
177+
when resolving method "$java.security.Principal$$EnhancerByMockitoWithCGLIB$$e775e657
178+
.implies(Ljavax/security/auth/Subject;)Z" the class loader (instance of org/powermock/
179+
core/classloader/MockClassLoader) of the current class, $java/security/
180+
Principal$$EnhancerByMockitoWithCGLIB$$e775e657, and the class loader (instance of <bootloader>) for
181+
interface java/security/Principal have different Class objects for the type javax/security/auth/Subject
182+
used in the signature.
183+
-->
184+
<profile>
185+
<activation>
186+
<jdk>1.8</jdk>
187+
</activation>
188+
<build>
189+
<plugins>
190+
<plugin>
191+
<groupId>org.apache.maven.plugins</groupId>
192+
<artifactId>maven-surefire-plugin</artifactId>
193+
<version>2.12.4</version>
194+
<configuration>
195+
<excludes>
196+
<exclude>**/TestKerberosClientAuthProvider.java</exclude>
197+
<exclude>**/TestLogin.java</exclude>
198+
<exclude>**/TestSimpleClientAuthProvider.java</exclude>
199+
<exclude>**/TestIntegration.java</exclude>
200+
<exclude>**/TestIncrementCoalescing.java</exclude>
201+
</excludes>
202+
</configuration>
203+
</plugin>
204+
</plugins>
205+
</build>
206+
</profile>
207+
</profiles>
169208

170209
<dependencies>
171210

protobuf/Client.proto

Lines changed: 85 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import "HBase.proto";
2828
import "Filter.proto";
2929
import "Cell.proto";
3030
import "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

8092
message 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

385461
service 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
}

protobuf/ClusterId.proto

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 shared throughout HBase
20+
21+
option java_package = "org.hbase.async.generated";
22+
option java_outer_classname = "ClusterIdPB";
23+
option java_generate_equals_and_hash = false;
24+
option optimize_for = LITE_RUNTIME;
25+
26+
/**
27+
* Content of the '/hbase/hbaseid', cluster id, znode.
28+
* Also cluster of the ${HBASE_ROOTDIR}/hbase.id file.
29+
*/
30+
message ClusterId {
31+
// This is the cluster id, a uuid as a String
32+
required string cluster_id = 1;
33+
}

0 commit comments

Comments
 (0)