Skip to content

Commit aa43865

Browse files
authored
Merge branch 'apache:master' into HDDS-11463
2 parents 32de1b5 + f5ff2f0 commit aa43865

File tree

167 files changed

+6691
-9014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+6691
-9014
lines changed

.asf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
github:
16-
description: "Scalable, redundant, and distributed object store for Apache Hadoop"
16+
description: "Scalable, reliable, distributed storage system optimized for data analytics and object store workloads."
1717
homepage: https://ozone.apache.org
1818
labels:
1919
- hadoop

.github/workflows/ci.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ on:
2929
env:
3030
FAIL_FAST: ${{ github.event_name == 'pull_request' }}
3131
# Minimum required Java version for running Ozone is defined in pom.xml (javac.version).
32-
TEST_JAVA_VERSION: 17 # JDK version used by CI build and tests; should match the JDK version in apache/ozone-runner image
32+
TEST_JAVA_VERSION: 21 # JDK version used by CI build and tests; should match the JDK version in apache/ozone-runner image
33+
MAVEN_ARGS: --batch-mode --settings ${{ github.workspace }}/dev-support/ci/maven-settings.xml --show-version
3334
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
3435
HADOOP_IMAGE: ghcr.io/apache/hadoop
3536
OZONE_IMAGE: ghcr.io/apache/ozone
@@ -257,7 +258,7 @@ jobs:
257258
key: maven-repo-${{ hashFiles('**/pom.xml') }}
258259
restore-keys: |
259260
maven-repo-
260-
if: ${{ !contains('author,bats,docs', matrix.check) }}
261+
if: ${{ !contains('author,bats', matrix.check) }}
261262
- name: Download Ratis repo
262263
if: ${{ inputs.ratis_args != '' }}
263264
uses: actions/download-artifact@v4
@@ -343,6 +344,15 @@ jobs:
343344
uses: actions/checkout@v4
344345
with:
345346
ref: ${{ needs.build-info.outputs.sha }}
347+
- name: Cache for maven dependencies
348+
uses: actions/cache/restore@v4
349+
with:
350+
path: |
351+
~/.m2/repository/*/*/*
352+
!~/.m2/repository/org/apache/ozone
353+
key: maven-repo-${{ hashFiles('**/pom.xml') }}
354+
restore-keys: |
355+
maven-repo-
346356
- name: Download compiled Ozone binaries
347357
uses: actions/download-artifact@v4
348358
with:
@@ -486,6 +496,15 @@ jobs:
486496
uses: actions/checkout@v4
487497
with:
488498
ref: ${{ needs.build-info.outputs.sha }}
499+
- name: Cache for maven dependencies
500+
uses: actions/cache/restore@v4
501+
with:
502+
path: |
503+
~/.m2/repository/*/*/*
504+
!~/.m2/repository/org/apache/ozone
505+
key: maven-repo-${{ hashFiles('**/pom.xml') }}
506+
restore-keys: |
507+
maven-repo-
489508
- name: Download compiled Ozone binaries
490509
uses: actions/download-artifact@v4
491510
with:
@@ -530,6 +549,15 @@ jobs:
530549
uses: actions/checkout@v4
531550
with:
532551
ref: ${{ needs.build-info.outputs.sha }}
552+
- name: Cache for maven dependencies
553+
uses: actions/cache/restore@v4
554+
with:
555+
path: |
556+
~/.m2/repository/*/*/*
557+
!~/.m2/repository/org/apache/ozone
558+
key: maven-repo-${{ hashFiles('**/pom.xml') }}
559+
restore-keys: |
560+
maven-repo-
533561
- name: Download compiled Ozone binaries
534562
uses: actions/download-artifact@v4
535563
with:

.github/workflows/populate-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373

7474
- name: Fetch dependencies
7575
if: steps.restore-cache.outputs.cache-hit != 'true'
76-
run: mvn --batch-mode --no-transfer-progress --show-version -Pgo-offline -Pdist clean verify
76+
run: mvn --batch-mode --no-transfer-progress --show-version -Pgo-offline -Pdist -Drocks_tools_native clean verify
7777

7878
- name: Delete Ozone jars from repo
7979
if: steps.restore-cache.outputs.cache-hit != 'true'

.mvn/extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<extension>
2525
<groupId>com.gradle</groupId>
2626
<artifactId>develocity-maven-extension</artifactId>
27-
<version>1.22.1</version>
27+
<version>1.23</version>
2828
</extension>
2929
<extension>
3030
<groupId>com.gradle</groupId>

dev-support/ci/maven-settings.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0http://maven.apache.org/xsd/settings-1.0.0.xsd">
19+
<mirrors>
20+
<mirror>
21+
<id>block-snapshots1</id>
22+
<mirrorOf>apache.snapshots</mirrorOf>
23+
<name>Block access to Apache Snapshots</name>
24+
<url>https://repository.apache.org/snapshots</url>
25+
<blocked>true</blocked>
26+
</mirror>
27+
<mirror>
28+
<id>block-snapshots2</id>
29+
<mirrorOf>apache.snapshots.https</mirrorOf>
30+
<name>Block access to Apache Snapshots</name>
31+
<url>https://repository.apache.org/content/repositories/snapshots</url>
32+
<blocked>true</blocked>
33+
</mirror>
34+
</mirrors>
35+
</settings>

dev-support/pom.xml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,25 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License. See accompanying LICENSE file.
1414
-->
15-
<project xmlns="http://maven.apache.org/POM/4.0.0"
16-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
15+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
16+
<modelVersion>4.0.0</modelVersion>
1817
<parent>
19-
<artifactId>ozone-main</artifactId>
2018
<groupId>org.apache.ozone</groupId>
19+
<artifactId>ozone-main</artifactId>
2120
<version>2.0.0-SNAPSHOT</version>
2221
</parent>
23-
<modelVersion>4.0.0</modelVersion>
2422
<artifactId>ozone-dev-support</artifactId>
25-
<description>Helper module for sharing resources among projects</description>
2623
<name>Apache Ozone Dev Support</name>
24+
<description>Helper module for sharing resources among projects</description>
2725

2826
<properties>
2927
<failIfNoTests>false</failIfNoTests>
3028
</properties>
3129
<build>
3230
<resources>
3331
<resource>
34-
<directory>${project.build.directory}/extra-resources</directory>
3532
<targetPath>META-INF</targetPath>
33+
<directory>${project.build.directory}/extra-resources</directory>
3634
<includes>
3735
<include>LICENSE.txt</include>
3836
<include>NOTICE.txt</include>
@@ -54,10 +52,10 @@
5452
<executions>
5553
<execution>
5654
<id>copy-resources</id>
57-
<phase>validate</phase>
5855
<goals>
5956
<goal>copy-resources</goal>
6057
</goals>
58+
<phase>validate</phase>
6159
<configuration>
6260
<outputDirectory>${project.build.directory}/extra-resources</outputDirectory>
6361
<resources>
@@ -77,21 +75,21 @@
7775
<plugin>
7876
<groupId>org.apache.maven.plugins</groupId>
7977
<artifactId>maven-remote-resources-plugin</artifactId>
80-
<executions>
81-
<execution>
82-
<phase>process-resources</phase>
83-
<goals>
84-
<goal>bundle</goal>
85-
</goals>
86-
</execution>
87-
</executions>
8878
<configuration>
8979
<resourcesDirectory>${project.build.outputDirectory}</resourcesDirectory>
9080
<includes>
9181
<include>META-INF/LICENSE.txt</include>
9282
<include>META-INF/NOTICE.txt</include>
9383
</includes>
9484
</configuration>
85+
<executions>
86+
<execution>
87+
<goals>
88+
<goal>bundle</goal>
89+
</goals>
90+
<phase>process-resources</phase>
91+
</execution>
92+
</executions>
9593
</plugin>
9694
</plugins>
9795
</build>

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/cli/GenericCli.java

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.hadoop.hdds.cli;
1818

19+
import java.io.IOException;
1920
import java.util.HashMap;
2021
import java.util.Map;
2122
import java.util.Map.Entry;
@@ -25,6 +26,7 @@
2526
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
2627

2728
import com.google.common.annotations.VisibleForTesting;
29+
import org.apache.hadoop.security.UserGroupInformation;
2830
import picocli.CommandLine;
2931
import picocli.CommandLine.ExitCode;
3032
import picocli.CommandLine.Model.CommandSpec;
@@ -48,25 +50,20 @@ public class GenericCli implements Callable<Void>, GenericParentCommand {
4850
private String configurationPath;
4951

5052
private final CommandLine cmd;
53+
private OzoneConfiguration conf;
54+
private UserGroupInformation user;
5155

5256
public GenericCli() {
53-
this(null);
57+
this(CommandLine.defaultFactory());
5458
}
5559

56-
public GenericCli(Class<?> type) {
57-
this(type, CommandLine.defaultFactory());
58-
}
59-
60-
public GenericCli(Class<?> type, CommandLine.IFactory factory) {
60+
public GenericCli(CommandLine.IFactory factory) {
6161
cmd = new CommandLine(this, factory);
6262
cmd.setExecutionExceptionHandler((ex, commandLine, parseResult) -> {
6363
printError(ex);
6464
return EXECUTION_ERROR_EXIT_CODE;
6565
});
6666

67-
if (type != null) {
68-
SubcommandWithParent.addSubcommands(getCmd(), type);
69-
}
7067
ExtensibleParentCommand.addSubcommands(cmd);
7168
}
7269

@@ -122,6 +119,20 @@ public OzoneConfiguration createOzoneConfiguration() {
122119
return ozoneConf;
123120
}
124121

122+
public OzoneConfiguration getOzoneConf() {
123+
if (conf == null) {
124+
conf = createOzoneConfiguration();
125+
}
126+
return conf;
127+
}
128+
129+
public UserGroupInformation getUser() throws IOException {
130+
if (user == null) {
131+
user = UserGroupInformation.getCurrentUser();
132+
}
133+
return user;
134+
}
135+
125136
@VisibleForTesting
126137
public picocli.CommandLine getCmd() {
127138
return cmd;

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/cli/SubcommandWithParent.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/db/CodecBuffer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ public class CodecBuffer implements UncheckedAutoCloseable {
5858
private static class Factory {
5959
private static volatile BiFunction<ByteBuf, Object, CodecBuffer> constructor
6060
= CodecBuffer::new;
61-
static void set(BiFunction<ByteBuf, Object, CodecBuffer> f) {
61+
static void set(BiFunction<ByteBuf, Object, CodecBuffer> f, String name) {
6262
constructor = f;
63-
LOG.info("Successfully set constructor to " + f);
63+
LOG.info("Successfully set constructor to {}: {}", name, f);
6464
}
6565

6666
static CodecBuffer newCodecBuffer(ByteBuf buf) {
@@ -89,7 +89,7 @@ protected void finalize() {
8989
* Note that there is a severe performance penalty for leak detection.
9090
*/
9191
public static void enableLeakDetection() {
92-
Factory.set(LeakDetector::newCodecBuffer);
92+
Factory.set(LeakDetector::newCodecBuffer, "LeakDetector::newCodecBuffer");
9393
}
9494

9595
/** The size of a buffer. */

hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/ChunkBufferImplWithByteBufferList.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,7 @@ public List<ByteBuffer> asByteBufferList() {
248248

249249
@Override
250250
public long writeTo(GatheringByteChannel channel) throws IOException {
251-
long written = 0;
252-
for (ByteBuffer buf : buffers) {
253-
written += BufferUtils.writeFully(channel, buf);
254-
}
251+
final long written = BufferUtils.writeFully(channel, buffers);
255252
findCurrent();
256253
return written;
257254
}

0 commit comments

Comments
 (0)