From ff2484906c4441c64ba417441feabb73a86a232c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Elek?= Date: Thu, 22 Nov 2018 11:50:47 +0100 Subject: [PATCH] HDDS-841. [JDK11] Fix Javadoc errors in hadoop-hdds-container-service module. Contributed by Dinesh Chitlangia. --- .../common/helpers/ContainerUtils.java | 2 +- .../container/common/impl/ContainerSet.java | 6 ++--- .../common/interfaces/Container.java | 2 -- .../common/statemachine/StateContext.java | 10 +++---- .../common/states/DatanodeState.java | 3 +++ .../container/common/volume/HddsVolume.java | 26 ++++++++++--------- .../keyvalue/helpers/ChunkUtils.java | 2 +- .../helpers/KeyValueContainerUtil.java | 4 +-- .../container/ozoneimpl/ContainerReader.java | 25 ++++++++++-------- .../container/ozoneimpl/OzoneContainer.java | 1 - 10 files changed, 43 insertions(+), 38 deletions(-) diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java index d96849e3c35..355fd7c9879 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/ContainerUtils.java @@ -175,7 +175,7 @@ public final class ContainerUtils { * Verifies that this is indeed a new container. * * @param containerFile - Container File to verify - * @throws IOException + * @throws FileAlreadyExistsException */ public static void verifyIsNewContainer(File containerFile) throws FileAlreadyExistsException { diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java index 7f4f147fe39..3c09f02eb00 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerSet.java @@ -117,7 +117,7 @@ public class ContainerSet { /** * Return an container Iterator over {@link ContainerSet#containerMap}. - * @return Iterator + * @return {@literal Iterator} */ public Iterator getContainerIterator() { return containerMap.values().iterator(); @@ -141,13 +141,13 @@ public class ContainerSet { /** * A simple interface for container Iterations. - *

+ *

* This call make no guarantees about consistency of the data between * different list calls. It just returns the best known data at that point of * time. It is possible that using this iteration you can miss certain * container from the listing. * - * @param startContainerId - Return containers with Id >= startContainerId. + * @param startContainerId - Return containers with Id >= startContainerId. * @param count - how many to return * @param data - Actual containerData * @throws StorageContainerException diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/Container.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/Container.java index 2bda74707d1..405cac38850 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/Container.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/Container.java @@ -69,7 +69,6 @@ public interface Container extends RwLock { * Get metadata about the container. * * @return ContainerData - Container Data. - * @throws StorageContainerException */ CONTAINERDATA getContainerData(); @@ -77,7 +76,6 @@ public interface Container extends RwLock { * Get the Container Lifecycle state. * * @return ContainerLifeCycleState - Container State. - * @throws StorageContainerException */ ContainerProtos.ContainerDataProto.State getContainerState(); diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java index 953f73035a9..195e51b9c51 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/StateContext.java @@ -184,7 +184,7 @@ public class StateContext { * Returns all the available reports from the report queue, or empty list if * the queue is empty. * - * @return List + * @return List of reports */ public List getAllAvailableReports() { return getReports(Integer.MAX_VALUE); @@ -194,7 +194,7 @@ public class StateContext { * Returns available reports from the report queue with a max limit on * list size, or empty list if the queue is empty. * - * @return List + * @return List of reports */ public List getReports(int maxLimit) { List reportsToReturn = new LinkedList<>(); @@ -236,7 +236,7 @@ public class StateContext { * Returns all the pending ContainerActions from the ContainerAction queue, * or empty list if the queue is empty. * - * @return List + * @return {@literal List} */ public List getAllPendingContainerActions() { return getPendingContainerAction(Integer.MAX_VALUE); @@ -246,7 +246,7 @@ public class StateContext { * Returns pending ContainerActions from the ContainerAction queue with a * max limit on list size, or empty list if the queue is empty. * - * @return List + * @return {@literal List} */ public List getPendingContainerAction(int maxLimit) { List containerActionList = new ArrayList<>(); @@ -298,7 +298,7 @@ public class StateContext { * Returns pending PipelineActions from the PipelineAction queue with a * max limit on list size, or empty list if the queue is empty. * - * @return List + * @return {@literal List} */ public List getPendingPipelineAction(int maxLimit) { List pipelineActionList = new ArrayList<>(); diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/DatanodeState.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/DatanodeState.java index 75142afd10c..25be207dcd9 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/DatanodeState.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/DatanodeState.java @@ -48,6 +48,9 @@ public interface DatanodeState { * * @param time - Time * @param timeUnit - Unit of time. + * @throws InterruptedException + * @throws ExecutionException + * @throws TimeoutException */ T await(long time, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException; diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java index 6b90146753a..d08882606cd 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java @@ -40,15 +40,17 @@ import java.util.Properties; import java.util.UUID; /** - * HddsVolume represents volume in a datanode. {@link VolumeSet} maitains a + * HddsVolume represents volume in a datanode. {@link VolumeSet} maintains a * list of HddsVolumes, one for each volume in the Datanode. * {@link VolumeInfo} in encompassed by this class. - * + *

* The disk layout per volume is as follows: - * ../hdds/VERSION - * ../hdds/<>/current/<>/<>/metadata - * ../hdds/<>/current/<>/<>/<> - * + *

../hdds/VERSION + *

{@literal ../hdds/<>/current/<>/<>/metadata} + *

{@literal ../hdds/<>/current/<>/<>/<>} + *

* Each hdds volume has its own VERSION file. The hdds volume will have one * scmUuid directory for each SCM it is a part of (currently only one SCM is * supported). @@ -377,14 +379,14 @@ public final class HddsVolume { /** * VolumeState represents the different states a HddsVolume can be in. - * NORMAL => Volume can be used for storage - * FAILED => Volume has failed due and can no longer be used for + * NORMAL => Volume can be used for storage + * FAILED => Volume has failed due and can no longer be used for * storing containers. - * NON_EXISTENT => Volume Root dir does not exist - * INCONSISTENT => Volume Root dir is not empty but VERSION file is + * NON_EXISTENT => Volume Root dir does not exist + * INCONSISTENT => Volume Root dir is not empty but VERSION file is * missing or Volume Root dir is not a directory - * NOT_FORMATTED => Volume Root exists but not formatted (no VERSION file) - * NOT_INITIALIZED => VERSION file exists but has not been verified for + * NOT_FORMATTED => Volume Root exists but not formatted(no VERSION file) + * NOT_INITIALIZED => VERSION file exists but has not been verified for * correctness. */ public enum VolumeState { diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/ChunkUtils.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/ChunkUtils.java index dc44dc53715..2ee82cb8fed 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/ChunkUtils.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/ChunkUtils.java @@ -235,7 +235,7 @@ public final class ChunkUtils { * * @param chunkFile - chunkFile to write data into. * @param info - chunk info. - * @return true if the chunkFile exists and chunkOffset < chunkFile length, + * @return true if the chunkFile exists and chunkOffset < chunkFile length, * false otherwise. */ public static boolean validateChunkForOverwrite(File chunkFile, diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java index 4f2b3a2a919..bad57b58070 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/KeyValueContainerUtil.java @@ -96,9 +96,9 @@ public final class KeyValueContainerUtil { /** * remove Container if it is empty. - *

+ *

* There are three things we need to delete. - *

+ *

* 1. Container file and metadata file. 2. The Level DB file 3. The path that * we created on the data location. * diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerReader.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerReader.java index aee5775b7ed..43f78ed4eb7 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerReader.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerReader.java @@ -51,21 +51,24 @@ import java.io.IOException; * * Layout of the container directory on disk is as follows: * - * ../hdds/VERSION - * ../hdds/<>/current/<>/</metadata/<>.container - * ../hdds/<>/current/<>/</<> - * + *

../hdds/VERSION + *

{@literal ../hdds/<>/current/<>/</metadata/<>.container} + *

{@literal ../hdds/<>/current/<>/</<>} + *

* Some ContainerTypes will have extra metadata other than the .container * file. For example, KeyValueContainer will have a .db file. This .db file * will also be stored in the metadata folder along with the .container file. - * - * ../hdds/<>/current/<>/</metadata/<>.db - * - * Note that the <> is dependent on the ContainerType. + *

+ * {@literal ../hdds/<>/current/<>/</metadata/<>.db} + *

+ * Note that the {@literal <>} is dependent on the ContainerType. * For KeyValueContainers, the data is stored in a "chunks" folder. As such, - * the <> layout for KeyValueContainers is - * - * ../hdds/<>/current/<>/</chunks/<> + * the {@literal <>} layout for KeyValueContainers is: + *

{@literal ../hdds/<>/current/<>/</chunks/<>} * */ public class ContainerReader implements Runnable { diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java index a89b50a704b..80ce13d19b2 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java @@ -170,7 +170,6 @@ public class OzoneContainer { /** * Returns container report. * @return - container report. - * @throws IOException */ public PipelineReportsProto getPipelineReport() {