From d26e9d04e1a4de63f9bce98eef3a68cfe9b6c28c Mon Sep 17 00:00:00 2001 From: syedmurtazahassan Date: Sat, 13 Jul 2019 16:46:19 +0200 Subject: [PATCH] HBASE-22586 Javadoc Warnings related to @param tag Signed-off-by: Jan Hentschel --- .../apache/hadoop/hbase/PrivateCellUtil.java | 28 +++++++++++------- .../hbase/util/ClassLoaderTestHelper.java | 3 +- .../HBaseMetrics2HadoopMetricsAdapter.java | 5 ++-- .../hbase/mapreduce/HFileOutputFormat2.java | 29 ------------------- .../apache/hadoop/hbase/HealthChecker.java | 3 +- .../ForeignExceptionDispatcher.java | 1 - ...anOutOneBlockAsyncDFSOutputSaslHelper.java | 2 +- .../namespace/NamespaceStateManager.java | 2 +- .../regionserver/StripeStoreFileManager.java | 1 - .../hbase/regionserver/wal/SyncFuture.java | 2 -- .../regionserver/WALEntryStream.java | 5 ++-- .../hbase/master/TestActiveMasterManager.java | 9 +++--- .../TestCatalogJanitorInMemoryStates.java | 11 ++++--- .../hbase/master/TestRegionPlacement.java | 4 +-- .../hbase/procedure/TestZKProcedure.java | 14 +++++++-- .../EncodedSeekPerformanceTest.java | 2 +- .../util/ProcessBasedLocalHBaseCluster.java | 4 ++- 17 files changed, 56 insertions(+), 69 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java index 523cc8e2da5..6cf6edb733d 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java @@ -1211,8 +1211,8 @@ public final class PrivateCellUtil { /** * Compare cell's row against given comparator - * @param cell - * @param comparator + * @param cell the cell to use for comparison + * @param comparator the {@link CellComparator} to use for comparison * @return result comparing cell's row */ public static int compareRow(Cell cell, ByteArrayComparable comparator) { @@ -1225,8 +1225,8 @@ public final class PrivateCellUtil { /** * Compare cell's column family against given comparator - * @param cell - * @param comparator + * @param cell the cell to use for comparison + * @param comparator the {@link CellComparator} to use for comparison * @return result comparing cell's column family */ public static int compareFamily(Cell cell, ByteArrayComparable comparator) { @@ -1240,8 +1240,8 @@ public final class PrivateCellUtil { /** * Compare cell's qualifier against given comparator - * @param cell - * @param comparator + * @param cell the cell to use for comparison + * @param comparator the {@link CellComparator} to use for comparison * @return result comparing cell's qualifier */ public static int compareQualifier(Cell cell, ByteArrayComparable comparator) { @@ -1278,8 +1278,8 @@ public final class PrivateCellUtil { /** * Compare cell's value against given comparator - * @param cell - * @param comparator + * @param cell the cell to use for comparison + * @param comparator the {@link CellComparator} to use for comparison * @return result comparing cell's value */ public static int compareValue(Cell cell, ByteArrayComparable comparator) { @@ -2579,7 +2579,7 @@ public final class PrivateCellUtil { * the index block, bloom keys from the bloom blocks This byte[] is expected to be serialized in * the KeyValue serialization format If the KeyValue (Cell's) serialization format changes this * method cannot be used. - * @param comparator the cell comparator + * @param comparator the {@link CellComparator} to use for comparison * @param left the cell to be compared * @param key the serialized key part of a KeyValue * @param offset the offset in the key byte[] @@ -2606,8 +2606,14 @@ public final class PrivateCellUtil { * method is used both in the normal comparator and the "same-prefix" comparator. Note that we are * assuming that row portions of both KVs have already been parsed and found identical, and we * don't validate that assumption here. - * @param commonPrefix the length of the common prefix of the two key-values being compared, - * including row length and row + * @param comparator the {@link CellComparator} to use for comparison + * @param left the cell to be compared + * @param right the serialized key part of a key-value + * @param roffset the offset in the key byte[] + * @param rlength the length of the key byte[] + * @param rowlength the row length + * @return greater than 0 if left cell is bigger, less than 0 if right cell is bigger, 0 if both + * cells are equal */ static final int compareWithoutRow(CellComparator comparator, Cell left, byte[] right, int roffset, int rlength, short rowlength) { diff --git a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/ClassLoaderTestHelper.java b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/ClassLoaderTestHelper.java index 0705a365710..c3e007f873d 100644 --- a/hbase-common/src/test/java/org/apache/hadoop/hbase/util/ClassLoaderTestHelper.java +++ b/hbase-common/src/test/java/org/apache/hadoop/hbase/util/ClassLoaderTestHelper.java @@ -52,7 +52,8 @@ public class ClassLoaderTestHelper { * Jar a list of files into a jar archive. * * @param archiveFile the target jar archive - * @param tobejared a list of files to be jared + * @param tobeJared a list of files to be jared + * @return true if a jar archive is build, false otherwise */ private static boolean createJarArchive(File archiveFile, File[] tobeJared) { try { diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java index e4d87100ca0..5fc2450cdb5 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java @@ -138,10 +138,9 @@ public class HBaseMetrics2HadoopMetricsAdapter { /** * Add Histogram value-distribution data to a Hadoop-Metrics2 record building. * - * @param builder A Hadoop-Metrics2 record builder. * @param name A base name for this record. - * @param desc A description for this record. - * @param snapshot The distribution of measured values. + * @param histogram A histogram to measure distribution of values. + * @param builder A Hadoop-Metrics2 record builder. */ private void addHistogram(String name, Histogram histogram, MetricsRecordBuilder builder) { MutableHistogram.snapshot(name, EMPTY_STRING, histogram, builder, true); diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java index dc293568769..f67c7537323 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java @@ -843,11 +843,6 @@ public class HFileOutputFormat2 /** * Serialize column family to compression algorithm map to configuration. * Invoked while configuring the MR job for incremental load. - * - * @param tableDescriptor to read the properties from - * @param conf to persist serialized values into - * @throws IOException - * on failure to read column family descriptors */ @VisibleForTesting static Function compressionDetails = familyDescriptor -> @@ -856,14 +851,6 @@ public class HFileOutputFormat2 /** * Serialize column family to block size map to configuration. Invoked while * configuring the MR job for incremental load. - * - * @param tableDescriptor - * to read the properties from - * @param conf - * to persist serialized values into - * - * @throws IOException - * on failure to read column family descriptors */ @VisibleForTesting static Function blockSizeDetails = familyDescriptor -> String @@ -872,14 +859,6 @@ public class HFileOutputFormat2 /** * Serialize column family to bloom type map to configuration. Invoked while * configuring the MR job for incremental load. - * - * @param tableDescriptor - * to read the properties from - * @param conf - * to persist serialized values into - * - * @throws IOException - * on failure to read column family descriptors */ @VisibleForTesting static Function bloomTypeDetails = familyDescriptor -> { @@ -893,13 +872,6 @@ public class HFileOutputFormat2 /** * Serialize column family to data block encoding map to configuration. * Invoked while configuring the MR job for incremental load. - * - * @param tableDescriptor - * to read the properties from - * @param conf - * to persist serialized values into - * @throws IOException - * on failure to read column family descriptors */ @VisibleForTesting static Function dataBlockEncodingDetails = familyDescriptor -> { @@ -909,5 +881,4 @@ public class HFileOutputFormat2 } return encoding.toString(); }; - } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/HealthChecker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/HealthChecker.java index a43a51d8656..e47afd58d68 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/HealthChecker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/HealthChecker.java @@ -54,7 +54,8 @@ class HealthChecker { /** * Initialize. * - * @param configuration + * @param location the location of the health script + * @param timeout the timeout to be used for the health script */ public void init(String location, long timeout) { this.healthCheckScript = location; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignExceptionDispatcher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignExceptionDispatcher.java index 87f7c00064c..b2ed0c267da 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignExceptionDispatcher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/errorhandling/ForeignExceptionDispatcher.java @@ -95,7 +95,6 @@ public class ForeignExceptionDispatcher implements ForeignExceptionListener, For /** * Sends an exception to all listeners. - * @param message human readable message passed to the listener * @param e {@link ForeignException} containing the cause. Can be null. */ private void dispatch(ForeignException e) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java index a56c3d75e91..7d13421522b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java @@ -318,7 +318,7 @@ public final class FanOutOneBlockAsyncDFSOutputSaslHelper { /** * Creates a new SaslClientCallbackHandler. * @param userName SASL user name - * @Param password SASL password + * @param password SASL password */ public SaslClientCallbackHandler(String userName, char[] password) { this.password = password; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java index 3cf5a257233..1d7c85d2aef 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java @@ -184,7 +184,7 @@ class NamespaceStateManager { /** * Delete the namespace state. * - * @param An instance of NamespaceTableAndRegionInfo + * @param namespace the name of the namespace to delete */ void deleteNamespace(String namespace) { this.nsStateCache.remove(namespace); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java index 8caf0139333..6842ac67ba4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java @@ -867,7 +867,6 @@ public class StripeStoreFileManager /** * Remove compacted files. - * @param compactedFiles Compacted files. */ private void removeCompactedFiles() throws IOException { for (HStoreFile oldFile : this.compactedFiles) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFuture.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFuture.java index 3e0998ef94b..650f68c1363 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFuture.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SyncFuture.java @@ -72,8 +72,6 @@ class SyncFuture { /** * Call this method to clear old usage and get it ready for new deploy. * @param txid the new transaction id - * @param span current span, detached from caller. Don't forget to attach it when resuming after a - * call to {@link #get(long)}. * @return this */ synchronized SyncFuture reset(long txid) { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java index 08cef28b909..19d30f3b48f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/WALEntryStream.java @@ -74,10 +74,11 @@ class WALEntryStream implements Closeable { /** * Create an entry stream over the given queue at the given start position * @param logQueue the queue of WAL paths - * @param conf {@link Configuration} to use to create {@link Reader} for this stream + * @param conf the {@link Configuration} to use to create {@link Reader} for this stream * @param startPosition the position in the first WAL to start reading at + * @param walFileLengthProvider provides the length of the WAL file * @param serverName the server name which all WALs belong to - * @param metrics replication metrics + * @param metrics the replication metrics * @throws IOException */ public WALEntryStream(PriorityBlockingQueue logQueue, Configuration conf, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java index 5851dea3c4e..6074d2cff57 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java @@ -192,15 +192,16 @@ public class TestActiveMasterManager { assertTrue(t.isActiveMaster); LOG.info("Deleting master node"); + ZKUtil.deleteNode(zk, zk.getZNodePaths().masterAddressZNode); } /** * Assert there is an active master and that it has the specified address. - * @param zk - * @param thisMasterAddress - * @throws KeeperException - * @throws IOException + * @param zk single Zookeeper watcher + * @param expectedAddress the expected address of the master + * @throws KeeperException unexpected Zookeeper exception + * @throws IOException if an IO problem is encountered */ private void assertMaster(ZKWatcher zk, ServerName expectedAddress) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitorInMemoryStates.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitorInMemoryStates.java index fcd16380433..3cb17a1ac9d 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitorInMemoryStates.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestCatalogJanitorInMemoryStates.java @@ -129,12 +129,11 @@ public class TestCatalogJanitorInMemoryStates { } - /* - * Splits a region - * @param t Region to split. - * @return List of region locations - * @throws IOException, InterruptedException - */ + /** + * Splits a region + * @param r Region to split. + * @return List of region locations + */ private List splitRegion(final RegionInfo r) throws IOException, InterruptedException { List locations = new ArrayList<>(); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java index 37f50202779..1d78e13583f 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRegionPlacement.java @@ -358,8 +358,8 @@ public class TestRegionPlacement { /** * Verify the meta has updated to the latest assignment plan - * @param plan - * @throws IOException + * @param expectedPlan the region assignment plan + * @throws IOException if an IO problem is encountered */ private void verifyMETAUpdated(FavoredNodesPlan expectedPlan) throws IOException { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java index 1b0fc9f40a7..0266851ab39 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestZKProcedure.java @@ -334,7 +334,12 @@ public class TestZKProcedure { /** * Wait for the coordinator task to complete, and verify all the mocks - * @param task to wait on + * @param proc the {@link Procedure} to execute + * @param prepare the mock prepare + * @param commit the mock commit + * @param cleanup the mock cleanup + * @param finish the mock finish + * @param opHasError the operation error state * @throws Exception on unexpected failure */ private void waitAndVerifyProc(Procedure proc, VerificationMode prepare, @@ -358,7 +363,12 @@ public class TestZKProcedure { /** * Wait for the coordinator task to complete, and verify all the mocks - * @param task to wait on + * @param op the {@link Subprocedure} to use + * @param prepare the mock prepare + * @param commit the mock commit + * @param cleanup the mock cleanup + * @param finish the mock finish + * @param opHasError the operation error state * @throws Exception on unexpected failure */ private void waitAndVerifySubproc(Subprocedure op, VerificationMode prepare, diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java index 57948b63e17..5932826962b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/EncodedSeekPerformanceTest.java @@ -143,7 +143,7 @@ public class EncodedSeekPerformanceTest { /** * @param path Path to the HFile which will be used. - * @param encoders List of encoders which will be used for tests. + * @param encodings the data block encoding algorithms to use * @throws IOException if there is a bug while reading from disk */ public void runTests(Path path, DataBlockEncoding[] encodings) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java index 6415fdb62e6..0de4b830e88 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java @@ -101,7 +101,9 @@ public class ProcessBasedLocalHBaseCluster { /** * Constructor. Modifies the passed configuration. - * @param hbaseHome the top directory of the HBase source tree + * @param conf the {@link Configuration} to use + * @param numDataNodes the number of data nodes + * @param numRegionServers the number of region servers */ public ProcessBasedLocalHBaseCluster(Configuration conf, int numDataNodes, int numRegionServers) {