Skip to content

Commit

Permalink
Merge branch 'apache:master' into HDDS-11243
Browse files Browse the repository at this point in the history
  • Loading branch information
slfan1989 authored Oct 3, 2024
2 parents 8407b52 + 31f9f2c commit 11005b0
Show file tree
Hide file tree
Showing 192 changed files with 1,907 additions and 476 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Compile Ozone using Java ${{ matrix.java }}
run: hadoop-ozone/dev-support/checks/build.sh -Pdist -Dskip.npx -Dskip.installnpx -Djavac.version=${{ matrix.java }} ${{ inputs.ratis_args }}
run: hadoop-ozone/dev-support/checks/build.sh -Pdist -Dskip.npx -Dskip.installnpx -Dmaven.javadoc.failOnWarnings=${{ matrix.java != 8 }} -Djavac.version=${{ matrix.java }} ${{ inputs.ratis_args }}
env:
OZONE_WITH_COVERAGE: false
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion dev-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>ozone-main</artifactId>
<groupId>org.apache.ozone</groupId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ozone-dev-support</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdds/annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>hdds-annotation-processing</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<description>Apache Ozone annotation processing tools for validating custom
annotations at compile time.
</description>
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdds/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>hdds-client</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<description>Apache Ozone Distributed Data Store Client Library</description>
<name>Apache Ozone HDDS Client</name>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public synchronized int read(ByteBuffer byteBuffer) throws IOException {
* readWithStrategy implementation, as it will never be called by the tests.
*
* @param strategy
* @return
* @throws IOException
*/
protected abstract int readWithStrategy(ByteReaderStrategy strategy) throws
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ protected int calculateExpectedDataBlocks(ECReplicationConfig rConfig) {
* Using the current position, returns the index of the blockStream we should
* be reading from. This is the index in the internal array holding the
* stream reference. The block group index will be one greater than this.
* @return
*/
protected int currentStreamIndex() {
return (int)((position / ecChunkSize) % repConfig.getData());
Expand Down Expand Up @@ -206,7 +205,6 @@ protected BlockExtendedInputStream getOrOpenStream(int locationIndex) throws IOE
* to the replicaIndex given based on the EC pipeline fetched from SCM.
* @param replicaIndex
* @param refreshFunc
* @return
*/
protected Function<BlockID, BlockLocationInfo> ecPipelineRefreshFunction(
int replicaIndex, Function<BlockID, BlockLocationInfo> refreshFunc) {
Expand Down Expand Up @@ -241,7 +239,6 @@ protected Function<BlockID, BlockLocationInfo> ecPipelineRefreshFunction(
* potentially partial last stripe. Note that the internal block index is
* numbered starting from 1.
* @param index - Index number of the internal block, starting from 1
* @return
*/
protected long internalBlockLength(int index) {
long lastStripe = blockInfo.getLength() % stripeSize;
Expand Down Expand Up @@ -344,7 +341,6 @@ protected boolean shouldRetryFailedRead(int failedIndex) {
* strategy buffer. This call may read from several internal BlockInputStreams
* if there is sufficient space in the buffer.
* @param strategy
* @return
* @throws IOException
*/
@Override
Expand Down Expand Up @@ -409,7 +405,6 @@ protected void seekStreamIfNecessary(BlockExtendedInputStream stream,
* group length.
* @param stream Stream to read from
* @param strategy The ReaderStrategy to read data into
* @return
* @throws IOException
*/
private int readFromStream(BlockExtendedInputStream stream,
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdds/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>hdds-common</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<description>Apache Ozone Distributed Data Store Common</description>
<name>Apache Ozone HDDS Common</name>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ public static File createDir(String dirPath) {
* Utility string formatter method to display SCM roles.
*
* @param nodes
* @return
* @return String
*/
public static String format(List<String> nodes) {
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -680,7 +680,8 @@ public static int roundupMb(long bytes) {

/**
* Unwrap exception to check if it is some kind of access control problem
* ({@link AccessControlException} or {@link SecretManager.InvalidToken})
* ({@link org.apache.hadoop.security.AccessControlException} or
* {@link org.apache.hadoop.security.token.SecretManager.InvalidToken})
* or a RpcException.
*/
public static Throwable getUnwrappedException(Exception ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ public static JsonNode getBeansJsonNode(String metricsJson) throws IOException {
* Returns the number of decommissioning nodes.
*
* @param jsonNode
* @return
*/
public static int getNumDecomNodes(JsonNode jsonNode) {
int numDecomNodes;
Expand All @@ -118,7 +117,6 @@ public static int getNumDecomNodes(JsonNode jsonNode) {
* @param numDecomNodes
* @param countsMap
* @param errMsg
* @return
* @throws IOException
*/
@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ StartContainerBalancerResponseProto startContainerBalancer(
* Force generates new secret keys (rotate).
*
* @param force boolean flag that forcefully rotates the key on demand
* @return
* @throws IOException
*/
boolean rotateSecretKeys(boolean force) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ public long getReportTimeStamp() {

/**
* Return a map of all stats and their value as a long.
* @return
*/
public Map<String, Long> getStats() {
Map<String, Long> result = new HashMap<>();
Expand All @@ -159,7 +158,6 @@ public Map<String, Long> getStats() {
/**
* Return a map of all samples, with the stat as the key and the samples
* for the stat as a List of Long.
* @return
*/
public Map<String, List<Long>> getSamples() {
Map<String, List<Long>> result = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public class SCMNodeInfo {
/**
* Build SCM Node information from configuration.
* @param conf
* @return
*/
public static List<SCMNodeInfo> buildNodeInfo(ConfigurationSource conf) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,13 @@ public void remove(Node node) {
* @param loc string location of a node. If loc starts with "/", it's a
* absolute path, otherwise a relative path. Following examples
* are all accepted,
* <pre>
* {@code
* 1. /dc1/rm1/rack1 -> an inner node
* 2. /dc1/rm1/rack1/node1 -> a leaf node
* 3. rack1/node1 -> a relative path to this node
*
* }
* </pre>
* @return null if the node is not found
*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ public int getReplicaIndex(DatanodeDetails dn) {

/**
* Get the replicaIndex Map.
* @return
*/
public Map<DatanodeDetails, Integer> getReplicaIndexes() {
return this.getNodes().stream().collect(Collectors.toMap(Function.identity(), this::getReplicaIndex));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public static InetSocketAddress updateListenAddress(OzoneConfiguration conf,
* Fall back to OZONE_METADATA_DIRS if not defined.
*
* @param conf
* @return
* @return File
*/
public static File getScmDbDir(ConfigurationSource conf) {
File metadataDir = getDirectoryFromConfig(conf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
/**
* Simple general resource leak detector using {@link ReferenceQueue} and {@link java.lang.ref.WeakReference} to
* observe resource object life-cycle and assert proper resource closure before they are GCed.
*
* <p>
* Example usage:
*
Expand All @@ -43,16 +42,18 @@
* // report leaks, don't refer to the original object (MyResource) here.
* System.out.println("MyResource is not closed before being discarded.");
* });
*
* @Override
* }
* }
* </pre>
* <pre>
* {@code @Override
* public void close() {
* // proper resources cleanup...
* // inform tracker that this object is closed properly.
* leakTracker.close();
* }
* }
*
* }</pre>
* }
* </pre>
*/
public class LeakDetector {
private static final Logger LOG = LoggerFactory.getLogger(LeakDetector.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import java.io.IOException;

/**
* A {@link Codec} to serialize/deserialize objects by delegation.
* A {@link org.apache.hadoop.hdds.utils.db.Codec} to serialize/deserialize objects by delegation.
*
* @param <T> The object type of this {@link Codec}.
* @param <T> The object type of this {@link org.apache.hadoop.hdds.utils.db.Codec}.
* @param <DELEGATE> The object type of the {@link #delegate}.
*/
public class DelegatedCodec<T, DELEGATE> implements Codec<T> {
Expand Down Expand Up @@ -53,8 +53,8 @@ public enum CopyType {
* Construct a {@link Codec} using the given delegate.
*
* @param delegate the delegate {@link Codec}
* @param forward a function to convert {@link DELEGATE} to {@link T}.
* @param backward a function to convert {@link T} back to {@link DELEGATE}.
* @param forward a function to convert {@code DELEGATE} to {@code T}.
* @param backward a function to convert {@code T} back to {@code DELEGATE}.
* @param copyType How to {@link #copyObject(Object)}?
*/
public DelegatedCodec(Codec<DELEGATE> delegate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ static ChunkBuffer allocate(int capacity) {
return allocate(capacity, 0);
}

/**
* Similar to {@link ByteBuffer#allocate(int)}
/** Similar to {@link ByteBuffer#allocate(int)}
* except that it can specify the increment.
*
* @param increment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* Helper class to convert between protobuf lists and Java lists of
* {@link ContainerProtos.ChunkInfo} objects.
* {@link org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos.ChunkInfo} objects.
* <p>
* This class is immutable.
*/
Expand All @@ -49,7 +49,7 @@ public ChunkInfoList(List<ContainerProtos.ChunkInfo> chunks) {
}

/**
* @return A new {@link ChunkInfoList} created from protobuf data.
* @return A new {@link #ChunkInfoList} created from protobuf data.
*/
public static ChunkInfoList getFromProtoBuf(
ContainerProtos.ChunkInfoList chunksProto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class LayoutVersionInstanceFactory<T> {
/**
* Register an instance with a given factory key (key + version).
* For safety reasons we dont allow (1) re-registering, (2) registering an
* instance with version > SLV.
* instance with version &gt; SLV.
*
* @param lvm LayoutVersionManager
* @param key VersionFactoryKey key to associate with instance.
Expand Down Expand Up @@ -136,13 +136,15 @@ private boolean isValid(LayoutVersionManager lvm, int version) {
}

/**
* <pre>
* From the list of versioned instances for a given "key", this
* returns the "floor" value corresponding to the given version.
* For example, if we have key = "CreateKey", entry -> [(1, CreateKeyV1),
* (3, CreateKeyV2), and if the passed in key = CreateKey and version = 2, we
* For example, if we have key = "CreateKey", entry -&gt; [(1, CreateKeyV1),
* (3, CreateKeyV2), and if the passed in key = CreateKey &amp; version = 2, we
* return CreateKeyV1.
* Since this is a priority queue based implementation, we use a O(1) peek()
* lookup to get the current valid version.
* </pre>
* @param lvm LayoutVersionManager
* @param key Key and Version.
* @return instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public interface LayoutVersionManager {
/**
* Generic API for returning a registered handler for a given type.
* @param type String type
* @return
*/
default Object getHandler(String type) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ public interface UpgradeFinalizer<T> {
* Represents the current state in which the service is with regards to
* finalization after an upgrade.
* The state transitions are the following:
* ALREADY_FINALIZED - no entry no exit from this status without restart.
* {@code ALREADY_FINALIZED} - no entry no exit from this status without restart.
* After an upgrade:
* FINALIZATION_REQUIRED -(finalize)-> STARTING_FINALIZATION
* -> FINALIZATION_IN_PROGRESS -> FINALIZATION_DONE from finalization done
* {@code FINALIZATION_REQUIRED -(finalize)-> STARTING_FINALIZATION
* -> FINALIZATION_IN_PROGRESS -> FINALIZATION_DONE} from finalization done
* there is no more move possible, after a restart the service can end up in:
* - FINALIZATION_REQUIRED, if the finalization failed and have not reached
* FINALIZATION_DONE,
* - or it can be ALREADY_FINALIZED if the finalization was successfully done.
* {@code FINALIZATION_REQUIRED}, if the finalization failed and have not reached
* {@code FINALIZATION_DONE},
* - or it can be {@code ALREADY_FINALIZED} if the finalization was successfully done.
*/
enum Status {
ALREADY_FINALIZED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/**
* "Key" element to the Version specific instance factory. Currently it has 2
* dimensions -> a 'key' string and a version. This is to support a factory
* dimensions -&gt; a 'key' string and a version. This is to support a factory
* which returns an instance for a given "key" and "version".
*/
public class VersionFactoryKey {
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdds/config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>hdds-config</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<description>Apache Ozone Distributed Data Store Config Tools</description>
<name>Apache Ozone HDDS Config</name>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ default String[] getTrimmedStrings(String name) {
/**
* Gets the configuration entries where the key contains the prefix. This
* method will strip the prefix from the key in the return Map.
* Example: somePrefix.key->value will be key->value in the returned map.
* Example: {@code somePrefix.key->value} will be {@code key->value} in the returned map.
* @param keyPrefix Prefix to search.
* @return Map containing keys that match and their values.
*/
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdds/container-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>hdds-container-service</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<description>Apache Ozone Distributed Data Store Container Service</description>
<name>Apache Ozone HDDS Container Service</name>
<packaging>jar</packaging>
Expand Down
Loading

0 comments on commit 11005b0

Please sign in to comment.