From b60e5d39e04c8010798d633d387e6da14a0daa54 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Tue, 26 Jul 2022 15:08:24 -0700 Subject: [PATCH 1/2] HBASE-27203 Clean up error-prone findings in hbase-client --- .../hadoop/hbase/AsyncMetaTableAccessor.java | 42 ++++++----- .../org/apache/hadoop/hbase/ClusterId.java | 1 + .../hadoop/hbase/ClusterMetricsBuilder.java | 4 +- .../hadoop/hbase/CoprocessorEnvironment.java | 4 +- .../hadoop/hbase/HBaseServerException.java | 5 +- .../apache/hadoop/hbase/HRegionLocation.java | 4 +- .../apache/hadoop/hbase/RegionLocations.java | 2 + .../apache/hadoop/hbase/RegionMetrics.java | 4 +- .../hadoop/hbase/ServerMetricsBuilder.java | 19 +++-- .../org/apache/hadoop/hbase/UserMetrics.java | 4 +- .../hadoop/hbase/UserMetricsBuilder.java | 4 +- .../hadoop/hbase/client/AbstractResponse.java | 6 +- .../AbstractRpcBasedConnectionRegistry.java | 2 +- .../org/apache/hadoop/hbase/client/Admin.java | 24 ++++--- .../apache/hadoop/hbase/client/Append.java | 2 +- .../hadoop/hbase/client/AsyncAdmin.java | 33 +++++---- .../AsyncAdminRequestRetryingCaller.java | 3 - .../hadoop/hbase/client/AsyncTable.java | 69 ++++++++++--------- ...talogReplicaLoadBalanceSimpleSelector.java | 10 +-- .../hadoop/hbase/client/CheckAndMutate.java | 8 +++ .../hbase/client/ClientIdGenerator.java | 18 +++-- .../hbase/client/ColumnFamilyDescriptor.java | 26 +++---- .../client/ColumnFamilyDescriptorBuilder.java | 65 +++++++---------- .../hadoop/hbase/client/CompactType.java | 6 +- .../apache/hadoop/hbase/client/Delete.java | 4 +- .../org/apache/hadoop/hbase/client/Get.java | 2 +- .../apache/hadoop/hbase/client/Increment.java | 1 + .../hadoop/hbase/client/IsolationLevel.java | 7 +- .../hadoop/hbase/client/LogQueryFilter.java | 5 +- .../MasterCoprocessorRpcChannelImpl.java | 4 +- .../hadoop/hbase/client/MasterRegistry.java | 4 +- .../hadoop/hbase/client/MultiResponse.java | 6 +- .../hbase/client/MutableRegionInfo.java | 1 + .../apache/hadoop/hbase/client/Mutation.java | 19 +++-- .../org/apache/hadoop/hbase/client/Put.java | 1 + .../org/apache/hadoop/hbase/client/Query.java | 7 +- .../hbase/client/RawAsyncHBaseAdmin.java | 46 ++++++------- .../hbase/client/RawAsyncTableImpl.java | 2 +- .../client/RegionCoprocessorServiceExec.java | 2 +- .../hadoop/hbase/client/RegionInfo.java | 33 ++++----- .../hbase/client/RegionReplicaUtil.java | 4 +- ...RegionServerCoprocessorRpcChannelImpl.java | 4 +- .../apache/hadoop/hbase/client/Result.java | 4 +- .../apache/hadoop/hbase/client/RowAccess.java | 1 - .../hadoop/hbase/client/RowMutations.java | 1 + .../org/apache/hadoop/hbase/client/Scan.java | 6 +- .../hbase/client/ScanResultConsumer.java | 3 +- .../hadoop/hbase/client/ServiceCaller.java | 8 +-- .../hadoop/hbase/client/SlowLogParams.java | 5 +- .../org/apache/hadoop/hbase/client/Table.java | 10 +++ .../hadoop/hbase/client/TableDescriptor.java | 4 +- .../hbase/client/TableDescriptorBuilder.java | 9 +-- .../hadoop/hbase/client/TableState.java | 18 +++-- .../backoff/ClientBackoffPolicyFactory.java | 4 -- .../ExponentialClientBackoffPolicy.java | 4 -- .../BigDecimalColumnInterpreter.java | 2 +- .../ReplicationPeerConfigUtil.java | 32 +++++---- .../hbase/coprocessor/ColumnInterpreter.java | 11 +-- .../exceptions/RegionOpeningException.java | 4 +- .../hbase/filter/BigDecimalComparator.java | 9 +-- .../hadoop/hbase/filter/BinaryComparator.java | 19 +++-- .../filter/BinaryComponentComparator.java | 8 +-- .../hbase/filter/BinaryPrefixComparator.java | 19 +++-- .../hadoop/hbase/filter/BitComparator.java | 18 +++-- .../hbase/filter/ColumnCountGetFilter.java | 16 +++-- .../hbase/filter/ColumnPaginationFilter.java | 29 ++++---- .../hbase/filter/ColumnPrefixFilter.java | 17 +++-- .../hbase/filter/ColumnRangeFilter.java | 11 +-- .../hbase/filter/ColumnValueFilter.java | 14 ++-- .../hadoop/hbase/filter/CompareFilter.java | 12 ++-- .../hbase/filter/DependentColumnFilter.java | 17 +++-- .../hadoop/hbase/filter/FamilyFilter.java | 18 +++-- .../apache/hadoop/hbase/filter/Filter.java | 5 +- .../hadoop/hbase/filter/FilterList.java | 16 +++-- .../hbase/filter/FilterListWithAND.java | 6 +- .../hadoop/hbase/filter/FilterListWithOR.java | 6 +- .../hbase/filter/FirstKeyOnlyFilter.java | 21 +++--- ...FirstKeyValueMatchingQualifiersFilter.java | 5 +- .../hadoop/hbase/filter/FuzzyRowFilter.java | 27 +++++--- .../hbase/filter/InclusiveStopFilter.java | 20 +++--- .../hadoop/hbase/filter/KeyOnlyFilter.java | 19 +++-- .../hadoop/hbase/filter/LongComparator.java | 14 ++-- .../hbase/filter/MultiRowRangeFilter.java | 22 +++--- .../filter/MultipleColumnPrefixFilter.java | 20 +++--- .../hadoop/hbase/filter/NullComparator.java | 19 +++-- .../hadoop/hbase/filter/PageFilter.java | 10 +-- .../hadoop/hbase/filter/ParseFilter.java | 4 +- .../hadoop/hbase/filter/PrefixFilter.java | 17 +++-- .../hadoop/hbase/filter/QualifierFilter.java | 16 +++-- .../hadoop/hbase/filter/RandomRowFilter.java | 20 +++--- .../hbase/filter/RegexStringComparator.java | 18 +++-- .../apache/hadoop/hbase/filter/RowFilter.java | 18 +++-- .../SingleColumnValueExcludeFilter.java | 19 +++-- .../hbase/filter/SingleColumnValueFilter.java | 6 +- .../hadoop/hbase/filter/SkipFilter.java | 19 +++-- .../hbase/filter/SubstringComparator.java | 19 +++-- .../hadoop/hbase/filter/TimestampsFilter.java | 16 +++-- .../hadoop/hbase/filter/ValueFilter.java | 18 +++-- .../hadoop/hbase/filter/WhileMatchFilter.java | 17 +++-- .../hadoop/hbase/filter/package-info.java | 21 +++--- .../hadoop/hbase/ipc/AbstractRpcClient.java | 6 +- .../hbase/ipc/BlockingRpcConnection.java | 7 +- .../hadoop/hbase/ipc/CellBlockBuilder.java | 2 + .../apache/hadoop/hbase/ipc/ConnectionId.java | 16 +++-- .../hadoop/hbase/ipc/HBaseRpcController.java | 2 + .../hbase/ipc/NettyRpcDuplexHandler.java | 9 ++- .../apache/hadoop/hbase/ipc/RpcClient.java | 4 +- .../hadoop/hbase/master/RegionState.java | 7 +- .../hadoop/hbase/protobuf/ProtobufMagic.java | 10 +-- .../hadoop/hbase/quotas/QuotaRetriever.java | 4 +- .../hbase/quotas/SpaceLimitSettings.java | 4 +- .../hadoop/hbase/security/SaslUtil.java | 10 +-- .../security/access/AccessControlClient.java | 55 +++++++++------ .../security/access/AccessControlUtil.java | 17 ++--- .../access/ShadedAccessControlUtil.java | 14 ++-- .../security/access/TablePermission.java | 4 +- .../security/visibility/VisibilityClient.java | 10 +-- .../hbase/shaded/protobuf/ProtobufUtil.java | 27 +++----- .../shaded/protobuf/RequestConverter.java | 11 +-- .../apache/hadoop/hbase/util/Writables.java | 1 + .../hbase/zookeeper/ReadOnlyZKClient.java | 4 ++ .../hadoop/hbase/zookeeper/ZKMetadata.java | 2 +- .../client/TestAsyncTableRpcPriority.java | 14 ++-- .../client/TestCoprocessorDescriptor.java | 4 -- .../apache/hadoop/hbase/client/TestGet.java | 3 +- .../hadoop/hbase/client/TestMutation.java | 10 +-- .../hbase/client/TestRegionInfoDisplay.java | 4 +- .../apache/hadoop/hbase/client/TestScan.java | 33 ++++----- .../client/TestSimpleRequestController.java | 10 +-- .../hbase/filter/TestKeyOnlyFilter.java | 4 +- .../hbase/ipc/TestCellBlockBuilder.java | 9 ++- .../hbase/ipc/TestNettyRpcConnection.java | 4 +- .../TestQuotaGlobalsSettingsBypass.java | 1 + .../security/TestHBaseSaslRpcClient.java | 29 +++----- .../hbase/util/TestRoundRobinPoolMap.java | 6 +- .../hbase/util/TestThreadLocalPoolMap.java | 6 +- 136 files changed, 886 insertions(+), 765 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/AsyncMetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/AsyncMetaTableAccessor.java index 414d4ee7b49a..741dc763bbd2 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/AsyncMetaTableAccessor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/AsyncMetaTableAccessor.java @@ -101,11 +101,7 @@ public static CompletableFuture> getTableState(AsyncTable> getRegionLocation(AsyncTable metaTable, byte[] regionName) { CompletableFuture> future = new CompletableFuture<>(); @@ -127,11 +123,7 @@ public static CompletableFuture> getTableState(AsyncTable> getRegionLocationWithEncodedName(AsyncTable metaTable, byte[] encodedRegionName) { CompletableFuture> future = new CompletableFuture<>(); @@ -176,8 +168,9 @@ private static Optional getTableState(Result r) throws IOException { } /** - * Used to get all region locations for the specific table. n * @param tableName table we're - * looking for, can be null for getting all regions + * Used to get all region locations for the specific table + * @param metaTable scanner over meta table + * @param tableName table we're looking for, can be null for getting all regions * @return the list of region locations. The return value will be wrapped by a * {@link CompletableFuture}. */ @@ -200,8 +193,9 @@ public static CompletableFuture> getTableHRegionLocations( } /** - * Used to get table regions' info and server. n * @param tableName table we're looking for, can - * be null for getting all regions + * Used to get table regions' info and server. + * @param metaTable scanner over meta table + * @param tableName table we're looking for, can be null for getting all regions * @param excludeOfflinedSplitParents don't return split parents * @return the list of regioninfos and server. The return value will be wrapped by a * {@link CompletableFuture}. @@ -259,9 +253,11 @@ void add(Result r) { } /** - * Performs a scan of META table for given table. n * @param tableName table withing we scan - * @param type scanned part of meta - * @param visitor Visitor invoked against each row + * Performs a scan of META table for given table. + * @param metaTable scanner over meta table + * @param tableName table within we scan + * @param type scanned part of meta + * @param visitor Visitor invoked against each row */ private static CompletableFuture scanMeta(AsyncTable metaTable, TableName tableName, QueryType type, final Visitor visitor) { @@ -270,11 +266,13 @@ private static CompletableFuture scanMeta(AsyncTable scanMeta(AsyncTable metaTable, byte[] startRow, byte[] stopRow, QueryType type, int maxRows, final Visitor visitor) { diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterId.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterId.java index 9b7a5de19bd3..8c675c4522e6 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterId.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterId.java @@ -51,6 +51,7 @@ public byte[] toByteArray() { } /** + * Parse the serialized representation of the {@link ClusterId} * @param bytes A pb serialized {@link ClusterId} instance with pb magic prefix * @return An instance of {@link ClusterId} made from bytes n * @see #toByteArray() */ diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterMetricsBuilder.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterMetricsBuilder.java index 7ef8a2086118..630e3620a675 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterMetricsBuilder.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ClusterMetricsBuilder.java @@ -67,11 +67,11 @@ public static ClusterStatusProtos.ClusterStatus toClusterStatus(ClusterMetrics m .collect(Collectors.toList())) .addAllTableRegionStatesCount(metrics.getTableRegionStatesCount().entrySet().stream() .map(status -> ClusterStatusProtos.TableRegionStatesCount.newBuilder() - .setTableName(ProtobufUtil.toProtoTableName((status.getKey()))) + .setTableName(ProtobufUtil.toProtoTableName(status.getKey())) .setRegionStatesCount(ProtobufUtil.toTableRegionStatesCount(status.getValue())).build()) .collect(Collectors.toList())); if (metrics.getMasterName() != null) { - builder.setMaster(ProtobufUtil.toServerName((metrics.getMasterName()))); + builder.setMaster(ProtobufUtil.toServerName(metrics.getMasterName())); } if (metrics.getMasterTasks() != null) { builder.addAllMasterTasks(metrics.getMasterTasks().stream() diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java index 94909f1c14ef..32e06d610247 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/CoprocessorEnvironment.java @@ -44,8 +44,8 @@ public interface CoprocessorEnvironment { int getLoadSequence(); /** - * @return a Read-only Configuration; throws {@link UnsupportedOperationException} if you try to - * set a configuration. + * Returns a Read-only Configuration; throws {@link UnsupportedOperationException} if you try to + * set a configuration. */ Configuration getConfiguration(); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/HBaseServerException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HBaseServerException.java index 3484995c1bfd..47a86f9492f5 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/HBaseServerException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HBaseServerException.java @@ -44,10 +44,7 @@ public HBaseServerException(boolean serverOverloaded, String message) { this.serverOverloaded = serverOverloaded; } - /** - * @param t throwable to check for server overloaded state - * @return True if the server was considered overloaded when the exception was thrown - */ + /** Returns True if the server was considered overloaded when the exception was thrown */ public static boolean isServerOverloaded(Throwable t) { if (t instanceof HBaseServerException) { return ((HBaseServerException) t).isServerOverloaded(); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java index 6ae93bb3954f..a7720b2734ef 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionLocation.java @@ -110,8 +110,8 @@ public long getSeqNum() { } /** - * @return String made of hostname and port formatted as per - * {@link Addressing#createHostAndPortStr(String, int)} + * Returns String made of hostname and port formatted as per + * {@link Addressing#createHostAndPortStr(String, int)} */ public String getHostnamePort() { return Addressing.createHostAndPortStr(this.getHostname(), this.getPort()); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLocations.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLocations.java index 4d6dd6d43fa3..4c0390c6c3be 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLocations.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLocations.java @@ -208,6 +208,7 @@ public RegionLocations removeElementsWithNullLocation() { * @param other the locations to merge with * @return an RegionLocations object with merged locations or the same object if nothing is merged */ + @SuppressWarnings("ReferenceEquality") public RegionLocations mergeLocations(RegionLocations other) { assert other != null; @@ -280,6 +281,7 @@ private HRegionLocation selectRegionLocation(HRegionLocation oldLocation, * @return an RegionLocations object with updated locations or the same object if nothing is * updated */ + @SuppressWarnings("ReferenceEquality") public RegionLocations updateLocation(HRegionLocation location, boolean checkForEquals, boolean force) { assert location != null; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionMetrics.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionMetrics.java index 645a31a85523..d915e7a32cac 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionMetrics.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionMetrics.java @@ -107,8 +107,8 @@ default String getNameAsString() { int getStoreRefCount(); /** - * @return the max reference count for any store file among all compacted stores files of this - * region + * Returns the max reference count for any store file among all compacted stores files of this + * region */ int getMaxCompactedStoreFileRefCount(); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerMetricsBuilder.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerMetricsBuilder.java index 72f78220c1a8..1e57857db69e 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerMetricsBuilder.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerMetricsBuilder.java @@ -44,10 +44,6 @@ @InterfaceAudience.Private public final class ServerMetricsBuilder { - /** - * @param sn the server name - * @return a empty metrics - */ public static ServerMetrics of(ServerName sn) { return newBuilder(sn).build(); } @@ -280,6 +276,7 @@ public int getVersionNumber() { return versionNumber; } + @Override public String getVersion() { return version; } @@ -383,15 +380,17 @@ public String toString() { int currentMaxCompactedStoreFileRefCount = r.getMaxCompactedStoreFileRefCount(); maxCompactedStoreFileRefCount = Math.max(maxCompactedStoreFileRefCount, currentMaxCompactedStoreFileRefCount); - uncompressedStoreFileSizeMB += r.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE); - storeFileSizeMB += r.getStoreFileSize().get(Size.Unit.MEGABYTE); - memStoreSizeMB += r.getMemStoreSize().get(Size.Unit.MEGABYTE); - storefileIndexSizeKB += r.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE); + uncompressedStoreFileSizeMB += + (long) r.getUncompressedStoreFileSize().get(Size.Unit.MEGABYTE); + storeFileSizeMB += (long) r.getStoreFileSize().get(Size.Unit.MEGABYTE); + memStoreSizeMB += (long) r.getMemStoreSize().get(Size.Unit.MEGABYTE); + storefileIndexSizeKB += + (long) r.getStoreFileUncompressedDataIndexSize().get(Size.Unit.KILOBYTE); readRequestsCount += r.getReadRequestCount(); writeRequestsCount += r.getWriteRequestCount(); filteredReadRequestsCount += r.getFilteredReadRequestCount(); - rootLevelIndexSizeKB += r.getStoreFileRootLevelIndexSize().get(Size.Unit.KILOBYTE); - bloomFilterSizeMB += r.getBloomFilterSize().get(Size.Unit.MEGABYTE); + rootLevelIndexSizeKB += (long) r.getStoreFileRootLevelIndexSize().get(Size.Unit.KILOBYTE); + bloomFilterSizeMB += (long) r.getBloomFilterSize().get(Size.Unit.MEGABYTE); compactedCellCount += r.getCompactedCellCount(); compactingCellCount += r.getCompactingCellCount(); } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/UserMetrics.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/UserMetrics.java index 05108c70e746..681b1f416c78 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/UserMetrics.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/UserMetrics.java @@ -50,8 +50,8 @@ interface ClientMetrics { long getWriteRequestCount(); /** - * @return the number of write requests and read requests and coprocessor service requests made by - * the user + * Returns the number of write requests and read requests and coprocessor service requests made by + * the user */ default long getRequestCount() { return getReadRequestCount() + getWriteRequestCount(); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/UserMetricsBuilder.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/UserMetricsBuilder.java index ab63f19fec85..4a66283146d9 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/UserMetricsBuilder.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/UserMetricsBuilder.java @@ -17,6 +17,7 @@ */ package org.apache.hadoop.hbase; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import org.apache.hadoop.hbase.util.Strings; @@ -30,7 +31,8 @@ public final class UserMetricsBuilder { public static UserMetrics toUserMetrics(ClusterStatusProtos.UserLoad userLoad) { - UserMetricsBuilder builder = UserMetricsBuilder.newBuilder(userLoad.getUserName().getBytes()); + UserMetricsBuilder builder = + UserMetricsBuilder.newBuilder(userLoad.getUserName().getBytes(StandardCharsets.UTF_8)); userLoad.getClientMetricsList().stream() .map(clientMetrics -> new ClientMetricsImpl(clientMetrics.getHostName(), clientMetrics.getReadRequestsCount(), clientMetrics.getWriteRequestsCount(), diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractResponse.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractResponse.java index bb44defbac6a..b0a33eda4021 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractResponse.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractResponse.java @@ -27,11 +27,9 @@ abstract class AbstractResponse { public enum ResponseType { - SINGLE(0), - MULTI(1); + SINGLE, + MULTI; - ResponseType(int value) { - } } public abstract ResponseType type(); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRpcBasedConnectionRegistry.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRpcBasedConnectionRegistry.java index bc1febe38031..4e97dcab24dd 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRpcBasedConnectionRegistry.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AbstractRpcBasedConnectionRegistry.java @@ -135,7 +135,7 @@ private void populateStubs(Set addrs) throws IOException { * Typically, you can use lambda expression to implement this interface as * *
-   * (c, s, d) -> s.xxx(c, your request here, d)
+   * (c, s, d) -> s.xxx(c, your request here, d)
    * 
*/ @FunctionalInterface diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java index 6a0913c23c73..2e5e58f5d9e4 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java @@ -116,6 +116,7 @@ public interface Admin extends Abortable, Closeable { Connection getConnection(); /** + * Check if a table exists. * @param tableName Table to check. * @return true if table exists already. * @throws IOException if a remote or network exception occurs @@ -280,8 +281,8 @@ HTableDescriptor getTableDescriptor(TableName tableName) * Get a table descriptor. * @param tableName as a {@link TableName} * @return the tableDescriptor - * @throws org.apache.hadoop.hbase.TableNotFoundException - * @throws IOException if a remote or network exception occurs + * @throws TableNotFoundException if the table was not found + * @throws IOException if a remote or network exception occurs */ TableDescriptor getDescriptor(TableName tableName) throws TableNotFoundException, IOException; @@ -290,7 +291,7 @@ HTableDescriptor getTableDescriptor(TableName tableName) * @param desc table descriptor for table * @throws IllegalArgumentException if the table name is reserved * @throws org.apache.hadoop.hbase.MasterNotRunningException if master is not running - * @throws org.apache.hadoop.hbase.TableExistsException if table already exists (If + * @throws TableExistsException if table already exists (If * concurrent threads, the table may * have been created between * test-for-existence and @@ -316,7 +317,7 @@ default void createTable(TableDescriptor desc) throws IOException { * @throws IOException if a remote or network exception * occurs * @throws org.apache.hadoop.hbase.MasterNotRunningException if master is not running - * @throws org.apache.hadoop.hbase.TableExistsException if table already exists (If + * @throws TableExistsException if table already exists (If * concurrent threads, the table may * have been created between * test-for-existence and @@ -335,7 +336,7 @@ void createTable(TableDescriptor desc, byte[] startKey, byte[] endKey, int numRe * split keys are repeated and if the * split key has empty byte array. * @throws org.apache.hadoop.hbase.MasterNotRunningException if master is not running - * @throws org.apache.hadoop.hbase.TableExistsException if table already exists (If + * @throws TableExistsException if table already exists (If * concurrent threads, the table may * have been created between * test-for-existence and @@ -574,6 +575,7 @@ default void disableTable(TableName tableName) throws IOException { HTableDescriptor[] disableTables(Pattern pattern) throws IOException; /** + * Check if a table is enabled. * @param tableName name of table to check * @return true if table is on-line * @throws IOException if a remote or network exception occurs @@ -581,6 +583,7 @@ default void disableTable(TableName tableName) throws IOException { boolean isTableEnabled(TableName tableName) throws IOException; /** + * Check if a table is disabled. * @param tableName name of table to check * @return true if table is off-line * @throws IOException if a remote or network exception occurs @@ -588,6 +591,7 @@ default void disableTable(TableName tableName) throws IOException { boolean isTableDisabled(TableName tableName) throws IOException; /** + * Check if a table is available. * @param tableName name of table to check * @return true if all regions of the table are available * @throws IOException if a remote or network exception occurs @@ -1646,6 +1650,7 @@ default ClusterMetrics getClusterMetrics() throws IOException { ClusterMetrics getClusterMetrics(EnumSet