Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into HDDS-11070
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai committed Jan 15, 2025
2 parents f264cf8 + 6c41a9a commit 87cdc72
Show file tree
Hide file tree
Showing 562 changed files with 7,969 additions and 7,725 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:
FAIL_FAST: ${{ github.event_name == 'pull_request' }}
# Minimum required Java version for running Ozone is defined in pom.xml (javac.version).
TEST_JAVA_VERSION: 21 # JDK version used by CI build and tests; should match the JDK version in apache/ozone-runner image
MAVEN_ARGS: --batch-mode --settings ${{ github.workspace }}/dev-support/ci/maven-settings.xml --show-version
MAVEN_ARGS: --batch-mode --settings ${{ github.workspace }}/dev-support/ci/maven-settings.xml
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
HADOOP_IMAGE: ghcr.io/apache/hadoop
OZONE_IMAGE: ghcr.io/apache/ozone
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
- name: Run a full build
run: hadoop-ozone/dev-support/checks/build.sh -Pdist -Psrc -Dmaven.javadoc.skip=true ${{ inputs.ratis_args }}
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Store binaries for tests
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -226,7 +226,7 @@ jobs:
run: hadoop-ozone/dev-support/checks/build.sh -Pdist -DskipRecon -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 }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
basic:
needs:
- build-info
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
- name: Execute tests
run: hadoop-ozone/dev-support/checks/${{ matrix.check }}.sh ${{ inputs.ratis_args }}
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Summary of failures
run: hadoop-ozone/dev-support/checks/_summary.sh target/${{ matrix.check }}/summary.txt
if: ${{ failure() }}
Expand Down Expand Up @@ -321,7 +321,7 @@ jobs:
- name: Execute tests
run: hadoop-ozone/dev-support/checks/${{ github.job }}.sh ${{ inputs.ratis_args }}
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Summary of failures
run: hadoop-ozone/dev-support/checks/_summary.sh target/${{ github.job }}/summary.txt
if: ${{ failure() }}
Expand Down Expand Up @@ -641,7 +641,7 @@ jobs:
hadoop-ozone/dev-support/checks/integration.sh -P${{ matrix.profile }} ${args}
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Summary of failures
run: |
if [[ -s "target/${{ github.job }}/summary.md" ]]; then
Expand Down Expand Up @@ -701,7 +701,7 @@ jobs:
env:
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Archive build results
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/intermittent-test-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
fi
continue-on-error: true
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Summary of failures
run: hadoop-ozone/dev-support/checks/_summary.sh target/unit/summary.txt
if: ${{ !cancelled() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repeat-acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Run a full build
run: hadoop-ozone/dev-support/checks/build.sh -Pdist -Psrc -Dmaven.javadoc.skip=true
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Store binaries for tests
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion .mvn/develocity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
<develocity
xmlns="https://www.gradle.com/develocity-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.gradle.com/develocity-maven https://www.gradle.com/schema/develocity-maven.xsd">
<projectId>ozone</projectId>
<server>
<url>https://ge.apache.org</url>
<url>https://develocity.apache.org</url>
<allowUntrusted>false</allowUntrusted>
</server>
<buildScan>
Expand Down
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<extension>
<groupId>com.gradle</groupId>
<artifactId>develocity-maven-extension</artifactId>
<version>1.23</version>
<version>1.22.2</version>
</extension>
<extension>
<groupId>com.gradle</groupId>
Expand Down
15 changes: 6 additions & 9 deletions hadoop-hdds/annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<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">
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.ozone</groupId>
Expand All @@ -25,14 +22,14 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">

<artifactId>hdds-annotation-processing</artifactId>
<version>2.0.0-SNAPSHOT</version>
<description>Apache Ozone annotation processing tools for validating custom
annotations at compile time.
</description>
<name>Apache Ozone Annotation Processing</name>
<packaging>jar</packaging>
<name>Apache Ozone Annotation Processing</name>
<description>Apache Ozone annotation processing tools for validating custom
annotations at compile time.</description>

<properties>
<maven.test.skip>true</maven.test.skip> <!-- no tests in this module so far -->
<!-- no tests in this module so far -->
<maven.test.skip>true</maven.test.skip>
</properties>

<build>
Expand Down
60 changes: 25 additions & 35 deletions hadoop-hdds/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<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">
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.ozone</groupId>
Expand All @@ -25,14 +22,31 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">

<artifactId>hdds-client</artifactId>
<version>2.0.0-SNAPSHOT</version>
<description>Apache Ozone Distributed Data Store Client Library</description>
<name>Apache Ozone HDDS Client</name>
<packaging>jar</packaging>

<properties>
</properties>
<name>Apache Ozone HDDS Client</name>
<description>Apache Ozone Distributed Data Store Client Library</description>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-common</artifactId>
Expand All @@ -49,11 +63,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-interface-client</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-client</artifactId>
Expand All @@ -74,31 +83,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>org.apache.ratis</groupId>
<artifactId>ratis-thirdparty-misc</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
</dependency>

<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.apache.ozone</groupId>
Expand Down Expand Up @@ -148,7 +137,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>ban-annotations</id> <!-- override default restriction from root POM -->
<id>ban-annotations</id>
<!-- override default restriction from root POM -->
<configuration>
<rules>
<restrictImports>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,16 @@ public ChecksumCombineMode getChecksumCombineMode() {
try {
return ChecksumCombineMode.valueOf(checksumCombineMode);
} catch (IllegalArgumentException iae) {
LOG.warn("Bad checksum combine mode: {}. Using default {}",
checksumCombineMode,
ChecksumCombineMode.COMPOSITE_CRC.name());
return ChecksumCombineMode.valueOf(
ChecksumCombineMode.COMPOSITE_CRC.name());
LOG.warn("Bad checksum combine mode: {}.",
checksumCombineMode);
return null;
}
}

public void setChecksumCombineMode(String checksumCombineMode) {
this.checksumCombineMode = checksumCombineMode;
}

public void setEcReconstructStripeReadPoolLimit(int poolLimit) {
this.ecReconstructStripeReadPoolLimit = poolLimit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public void write(ByteBuffer b, int off, int len) throws IOException {
}
while (len > 0) {
allocateNewBufferIfNeeded();
int writeLen = Math.min(len, currentBuffer.length());
int writeLen = Math.min(len, currentBuffer.remaining());
final StreamBuffer buf = new StreamBuffer(b, off, writeLen);
currentBuffer.put(buf);
writeChunkIfNeeded();
Expand All @@ -265,7 +265,7 @@ public void write(ByteBuffer b, int off, int len) throws IOException {
}

private void writeChunkIfNeeded() throws IOException {
if (currentBuffer.length() == 0) {
if (currentBuffer.remaining() == 0) {
writeChunk(currentBuffer);
currentBuffer = null;
}
Expand Down Expand Up @@ -410,6 +410,10 @@ public void executePutBlock(boolean close,
waitFuturesComplete();
final BlockData blockData = containerBlockData.build();
if (close) {
// HDDS-12007 changed datanodes to ignore the following PutBlock request.
// However, clients still have to send it for maintaining compatibility.
// Otherwise, new clients won't send a PutBlock.
// Then, old datanodes will fail since they expect a PutBlock.
final ContainerCommandRequestProto putBlockRequest
= ContainerProtocolCalls.getPutBlockRequest(
xceiverClient.getPipeline(), blockData, true, tokenString);
Expand Down Expand Up @@ -507,6 +511,22 @@ public void flush() throws IOException {
}
}

@Override
public void hflush() throws IOException {
hsync();
}

@Override
public void hsync() throws IOException {
try {
if (!isClosed()) {
handleFlush(false);
}
} catch (Exception e) {

}
}

public void waitFuturesComplete() throws IOException {
try {
CompletableFuture.allOf(futures.toArray(EMPTY_FUTURE_ARRAY)).get();
Expand Down Expand Up @@ -672,6 +692,7 @@ private void writeChunkToContainer(ByteBuffer buf)
out.writeAsync(buf, StandardWriteOption.SYNC) :
out.writeAsync(buf))
.whenCompleteAsync((r, e) -> {
metrics.decrPendingContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
if (e != null || !r.isSuccess()) {
if (e == null) {
e = new IOException("result is not success");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package org.apache.hadoop.hdds.scm.storage;

import org.apache.hadoop.fs.Syncable;

import java.io.Closeable;
import java.io.IOException;
import java.nio.ByteBuffer;
Expand All @@ -26,7 +28,7 @@
* This interface is similar to {@link java.io.OutputStream}
* except that this class support {@link ByteBuffer} instead of byte[].
*/
public interface ByteBufferStreamOutput extends Closeable {
public interface ByteBufferStreamOutput extends Closeable, Syncable {
/**
* Similar to {@link java.io.OutputStream#write(byte[])},
* except that the parameter of this method is a {@link ByteBuffer}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public ByteBuffer duplicate() {
return buffer.duplicate();
}

public int length() {
return buffer.limit() - buffer.position();
public int remaining() {
return buffer.remaining();
}

public int position() {
Expand Down
Loading

0 comments on commit 87cdc72

Please sign in to comment.