From fed449582c6583187e04dde6ce81af3bb3f24132 Mon Sep 17 00:00:00 2001 From: Bharath Vissapragada Date: Fri, 20 Dec 2019 10:28:57 -0800 Subject: [PATCH] Fix QA bot issues - Checkstyle warnings - License headers - Javadoc tags - Shading issues --- .../hadoop/hbase/client/MasterRegistry.java | 23 ++++++++++++++++--- .../MasterRegistryFetchException.java | 17 ++++++++++++++ .../hbase/client/TestFromClientSide.java | 9 ++++---- 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterRegistry.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterRegistry.java index 294e677f2f4f..8b54751bbc3d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterRegistry.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MasterRegistry.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.hadoop.hbase.client; import static org.apache.hadoop.hbase.HConstants.DEFAULT_HBASE_RPC_TIMEOUT; @@ -49,12 +66,12 @@ /** * Master based registry implementation. Makes RPCs to the configured master addresses from config - * {@value HConstants#MASTER_ADDRS_KEY}. + * {@value org.apache.hadoop.hbase.HConstants#MASTER_ADDRS_KEY}. * * It has the ability to burst the same RPC to multiple masters as a batch and returns whatever * comes back first (a.k.a hedged RPCs). Number of target masters in a single batch is controlled - * via {@value HConstants#MASTER_REGISTRY_NUM_HEDGED_REQS_KEY}. If it is set to 1 (default), it is - * equivalent to picking a random master from the configured list. + * via {@value org.apache.hadoop.hbase.HConstants#MASTER_REGISTRY_NUM_HEDGED_REQS_KEY}. If it is + * set to 1 (default), it is equivalent to picking a random master from the configured list. * * TODO: Handle changes to the configuration dynamically without having to restart the client. */ diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/MasterRegistryFetchException.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/MasterRegistryFetchException.java index 8de72024d287..ca01a1bf2a8c 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/MasterRegistryFetchException.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/exceptions/MasterRegistryFetchException.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.hadoop.hbase.exceptions; import java.util.List; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java index 40bea34a97c7..b23dad9d0962 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java @@ -5130,7 +5130,7 @@ public void testCheckAndDeleteWithCompareOp() throws IOException { * Test ScanMetrics */ @Test - @SuppressWarnings ("unused") + @SuppressWarnings({"unused", "checkstyle:EmptyBlock"}) public void testScanMetrics() throws Exception { final TableName tableName = name.getTableName(); @@ -5169,7 +5169,8 @@ public void testScanMetrics() throws Exception { scan2.setScanMetricsEnabled(true); scan2.setCaching(numRecords + 1); try (ResultScanner scanner = ht.getScanner(scan2)) { - for (Result result : scanner.next(numRecords - 1)) {} + for (Result result : scanner.next(numRecords - 1)) { + } scanner.close(); // closing the scanner will set the metrics. assertNotNull(scanner.getScanMetrics()); @@ -5182,8 +5183,8 @@ public void testScanMetrics() throws Exception { try (ResultScanner scanner = ht.getScanner(scan2)) { // per HBASE-5717, this should still collect even if you don't run all the way to // the end of the scanner. So this is asking for 2 of the 3 rows we inserted. - for (Result result : scanner.next(numRecords - 1)) {} - + for (Result result : scanner.next(numRecords - 1)) { + } ScanMetrics scanMetrics = scanner.getScanMetrics(); assertEquals("Did not access all the regions in the table", numOfRegions, scanMetrics.countOfRegions.get());