Skip to content

Commit c5c62f1

Browse files
committed
Changes relevant for branch-2
1 parent f48f73f commit c5c62f1

File tree

56 files changed

+331
-313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+331
-313
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/AsyncMetaTableAccessor.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,25 +408,32 @@ private static Scan getMetaScan(AsyncTable<?> metaTable, int rowUpperLimit) {
408408
* can't deserialize the result.
409409
*/
410410
private static Optional<RegionLocations> getRegionLocations(final Result r) {
411-
if (r == null) return Optional.empty();
411+
if (r == null) {
412+
return Optional.empty();
413+
}
412414
Optional<RegionInfo> regionInfo = getHRegionInfo(r, getRegionInfoColumn());
413-
if (!regionInfo.isPresent()) return Optional.empty();
415+
if (!regionInfo.isPresent()) {
416+
return Optional.empty();
417+
}
414418

415419
List<HRegionLocation> locations = new ArrayList<HRegionLocation>(1);
416420
NavigableMap<byte[], NavigableMap<byte[], byte[]>> familyMap = r.getNoVersionMap();
417421

418422
locations.add(getRegionLocation(r, regionInfo.get(), 0));
419423

420424
NavigableMap<byte[], byte[]> infoMap = familyMap.get(getCatalogFamily());
421-
if (infoMap == null) return Optional.of(new RegionLocations(locations));
425+
if (infoMap == null) {
426+
return Optional.of(new RegionLocations(locations));
427+
}
422428

423429
// iterate until all serverName columns are seen
424430
int replicaId = 0;
425431
byte[] serverColumn = getServerColumn(replicaId);
426-
SortedMap<byte[], byte[]> serverMap = null;
427-
serverMap = infoMap.tailMap(serverColumn, false);
432+
SortedMap<byte[], byte[]> serverMap = infoMap.tailMap(serverColumn, false);
428433

429-
if (serverMap.isEmpty()) return Optional.of(new RegionLocations(locations));
434+
if (serverMap.isEmpty()) {
435+
return Optional.of(new RegionLocations(locations));
436+
}
430437

431438
for (Map.Entry<byte[], byte[]> entry : serverMap.entrySet()) {
432439
replicaId = parseReplicaIdFromServerColumn(entry.getKey());

hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterStatus.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ public List<RegionState> getRegionStatesInTransition() {
186186
}
187187

188188
/** Returns the HBase version string as reported by the HMaster */
189+
@Override
189190
public String getHBaseVersion() {
190191
return metrics.getHBaseVersion();
191192
}
@@ -279,6 +280,7 @@ public ServerLoad getLoad(final ServerName sn) {
279280
return serverMetrics == null ? null : new ServerLoad(serverMetrics);
280281
}
281282

283+
@Override
282284
public String getClusterId() {
283285
return metrics.getClusterId();
284286
}
@@ -289,6 +291,7 @@ public List<String> getMasterCoprocessorNames() {
289291
}
290292

291293
/**
294+
* Get the list of master coprocessor names.
292295
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 Use
293296
* {@link #getMasterCoprocessorNames} instead.
294297
*/
@@ -299,6 +302,7 @@ public String[] getMasterCoprocessors() {
299302
}
300303

301304
/**
305+
* Get the last major compaction time for a given table.
302306
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 Use
303307
* {@link #getLastMajorCompactionTimestamp(TableName)} instead.
304308
*/
@@ -308,6 +312,7 @@ public long getLastMajorCompactionTsForTable(TableName table) {
308312
}
309313

310314
/**
315+
* Get the last major compaction time for a given region.
311316
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 Use
312317
* {@link #getLastMajorCompactionTimestamp(byte[])} instead.
313318
*/
@@ -317,6 +322,7 @@ public long getLastMajorCompactionTsForRegion(final byte[] region) {
317322
}
318323

319324
/**
325+
* Returns true if the balancer is enabled.
320326
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 No flag in 2.0
321327
*/
322328
@Deprecated

hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ protected HColumnDescriptor(ModifyableColumnFamilyDescriptor delegate) {
176176
}
177177

178178
/**
179+
* Check if a given family name is allowed.
179180
* @param b Family name.
180181
* @return <code>b</code>
181182
* @throws IllegalArgumentException If not null and not a legitimate family name: i.e. 'printable'
@@ -205,19 +206,12 @@ public String getNameAsString() {
205206
return delegatee.getNameAsString();
206207
}
207208

208-
/**
209-
* @param key The key.
210-
* @return The value.
211-
*/
212209
@Override
213210
public byte[] getValue(byte[] key) {
214211
return delegatee.getValue(key);
215212
}
216213

217-
/**
218-
* @param key The key.
219-
* @return The value as a string.
220-
*/
214+
@Override
221215
public String getValue(String key) {
222216
byte[] value = getValue(Bytes.toBytes(key));
223217
return value == null ? null : Bytes.toString(value);
@@ -228,35 +222,22 @@ public Map<Bytes, Bytes> getValues() {
228222
return delegatee.getValues();
229223
}
230224

231-
/**
232-
* @param key The key.
233-
* @param value The value.
234-
* @return this (for chained invocation)
235-
*/
236225
public HColumnDescriptor setValue(byte[] key, byte[] value) {
237226
getDelegateeForModification().setValue(key, value);
238227
return this;
239228
}
240229

241-
/**
242-
* @param key Key whose key and value we're to remove from HCD parameters.
243-
*/
244230
public void remove(final byte[] key) {
245231
getDelegateeForModification().removeValue(new Bytes(key));
246232
}
247233

248-
/**
249-
* @param key The key.
250-
* @param value The value.
251-
* @return this (for chained invocation)
252-
*/
253234
public HColumnDescriptor setValue(String key, String value) {
254235
getDelegateeForModification().setValue(key, value);
255236
return this;
256237
}
257238

258239
/**
259-
* @return compression type being used for the column family
240+
* Returns compression type being used for the column family
260241
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
261242
* (<a href="https://issues.apache.org/jira/browse/HBASE-13655">HBASE-13655</a>). Use
262243
* {@link #getCompressionType()}.
@@ -267,7 +248,7 @@ public Compression.Algorithm getCompression() {
267248
}
268249

269250
/**
270-
* @return compression type being used for the column family for major compaction
251+
* Returns compression type being used for the column family for major compaction
271252
* @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0
272253
* (<a href="https://issues.apache.org/jira/browse/HBASE-13655">HBASE-13655</a>). Use
273254
* {@link #getCompactionCompressionType()}.
@@ -283,6 +264,7 @@ public int getMaxVersions() {
283264
}
284265

285266
/**
267+
* Set maximum versions to keep
286268
* @param value maximum number of versions
287269
* @return this (for chained invocation)
288270
*/
@@ -320,6 +302,7 @@ public int getBlocksize() {
320302
}
321303

322304
/**
305+
* Set block size to use when writing
323306
* @param value Blocksize to use when writing out storefiles/hfiles on this column family.
324307
* @return this (for chained invocation)
325308
*/
@@ -423,6 +406,7 @@ public boolean isInMemory() {
423406
}
424407

425408
/**
409+
* Set or clear the in memory flag.
426410
* @param value True if we are to favor keeping all values for this column family in the
427411
* HRegionServer cache
428412
* @return this (for chained invocation)
@@ -438,6 +422,7 @@ public MemoryCompactionPolicy getInMemoryCompaction() {
438422
}
439423

440424
/**
425+
* Set the in memory compaction policy.
441426
* @param value the prefered in-memory compaction policy for this column family
442427
* @return this (for chained invocation)
443428
*/
@@ -452,6 +437,7 @@ public KeepDeletedCells getKeepDeletedCells() {
452437
}
453438

454439
/**
440+
* Set the keep deleted cells policy.
455441
* @param value True if deleted rows should not be collected immediately.
456442
* @return this (for chained invocation)
457443
*/
@@ -481,6 +467,7 @@ public int getTimeToLive() {
481467
}
482468

483469
/**
470+
* Set the time to live of cell contents
484471
* @param value Time-to-live of cell contents, in seconds.
485472
* @return this (for chained invocation)
486473
*/
@@ -490,6 +477,7 @@ public HColumnDescriptor setTimeToLive(int value) {
490477
}
491478

492479
/**
480+
* Set the time to live of cell contents
493481
* @param value Time to live of cell contents, in human readable format
494482
* @see org.apache.hadoop.hbase.util.PrettyPrinter#format(String, Unit)
495483
* @return this (for chained invocation)
@@ -505,6 +493,7 @@ public int getMinVersions() {
505493
}
506494

507495
/**
496+
* Set the minimum number of versions to keep.
508497
* @param value The minimum number of versions to keep. (used when timeToLive is set)
509498
* @return this (for chained invocation)
510499
*/
@@ -519,6 +508,7 @@ public boolean isBlockCacheEnabled() {
519508
}
520509

521510
/**
511+
* Set or clear the block cache enabled flag.
522512
* @param value True if hfile DATA type blocks should be cached (We always cache INDEX and BLOOM
523513
* blocks; you cannot turn this off).
524514
* @return this (for chained invocation)
@@ -534,6 +524,7 @@ public BloomType getBloomFilterType() {
534524
}
535525

536526
/**
527+
* Set the bloom filter type.
537528
* @param value bloom filter type
538529
* @return this (for chained invocation)
539530
*/
@@ -547,10 +538,6 @@ public int getScope() {
547538
return delegatee.getScope();
548539
}
549540

550-
/**
551-
* @param value the scope tag
552-
* @return this (for chained invocation)
553-
*/
554541
public HColumnDescriptor setScope(int value) {
555542
getDelegateeForModification().setScope(value);
556543
return this;
@@ -562,6 +549,7 @@ public boolean isCacheDataOnWrite() {
562549
}
563550

564551
/**
552+
* Set or clear the cache data on write flag.
565553
* @param value true if we should cache data blocks on write
566554
* @return this (for chained invocation)
567555
*/
@@ -571,7 +559,7 @@ public HColumnDescriptor setCacheDataOnWrite(boolean value) {
571559
}
572560

573561
/**
574-
* This is a noop call from HBase 2.0 onwards
562+
* Set or clear the cache in L1 flag. This is a noop call from HBase 2.0 onwards
575563
* @return this (for chained invocation)
576564
* @deprecated Since 2.0 and will be removed in 3.0 with out any replacement. Caching data in on
577565
* heap Cache, when there are both on heap LRU Cache and Bucket Cache will no longer
@@ -588,6 +576,7 @@ public boolean isCacheIndexesOnWrite() {
588576
}
589577

590578
/**
579+
* Set or clear the cache indexes on write flag.
591580
* @param value true if we should cache index blocks on write
592581
* @return this (for chained invocation)
593582
*/
@@ -602,6 +591,7 @@ public boolean isCacheBloomsOnWrite() {
602591
}
603592

604593
/**
594+
* Set or clear the cache bloom filters on write flag.
605595
* @param value true if we should cache bloomfilter blocks on write
606596
* @return this (for chained invocation)
607597
*/
@@ -616,6 +606,7 @@ public boolean isEvictBlocksOnClose() {
616606
}
617607

618608
/**
609+
* Set or clear the evict bloom filters on close flag.
619610
* @param value true if we should evict cached blocks from the blockcache on close
620611
* @return this (for chained invocation)
621612
*/
@@ -630,6 +621,7 @@ public boolean isPrefetchBlocksOnOpen() {
630621
}
631622

632623
/**
624+
* Set or clear the prefetch on open flag.
633625
* @param value true if we should prefetch blocks into the blockcache on open
634626
* @return this (for chained invocation)
635627
*/
@@ -638,9 +630,6 @@ public HColumnDescriptor setPrefetchBlocksOnOpen(boolean value) {
638630
return this;
639631
}
640632

641-
/**
642-
* @see java.lang.Object#toString()
643-
*/
644633
@Override
645634
public String toString() {
646635
return delegatee.toString();
@@ -660,9 +649,6 @@ public static Map<String, String> getDefaultValues() {
660649
return ColumnFamilyDescriptorBuilder.getDefaultValues();
661650
}
662651

663-
/**
664-
* @see java.lang.Object#equals(java.lang.Object)
665-
*/
666652
@Override
667653
public boolean equals(Object obj) {
668654
if (this == obj) {
@@ -674,9 +660,6 @@ public boolean equals(Object obj) {
674660
return false;
675661
}
676662

677-
/**
678-
* @see java.lang.Object#hashCode()
679-
*/
680663
@Override
681664
public int hashCode() {
682665
return delegatee.hashCode();
@@ -688,14 +671,15 @@ public int compareTo(HColumnDescriptor other) {
688671
}
689672

690673
/**
691-
* @return This instance serialized with pb with pb magic prefix
674+
* Returns This instance serialized with pb with pb magic prefix
692675
* @see #parseFrom(byte[])
693676
*/
694677
public byte[] toByteArray() {
695678
return ColumnFamilyDescriptorBuilder.toByteArray(delegatee);
696679
}
697680

698681
/**
682+
* Parse a serialized representation of a {@link HColumnDescriptor}
699683
* @param bytes A pb serialized {@link HColumnDescriptor} instance with pb magic prefix
700684
* @return An instance of {@link HColumnDescriptor} made from <code>bytes</code> n * @see
701685
* #toByteArray()

0 commit comments

Comments
 (0)