Skip to content

Commit

Permalink
Merge branch 'master' into HDDS-11746
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejaskriya authored Jan 7, 2025
2 parents 55f8ab3 + 5354cec commit c05126b
Show file tree
Hide file tree
Showing 399 changed files with 5,268 additions and 10,899 deletions.
31 changes: 14 additions & 17 deletions dev-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,25 @@
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>
<artifactId>ozone-main</artifactId>
<groupId>org.apache.ozone</groupId>
<artifactId>ozone-main</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ozone-dev-support</artifactId>
<description>Helper module for sharing resources among projects</description>
<name>Apache Ozone Dev Support</name>
<description>Helper module for sharing resources among projects</description>

<properties>
<failIfNoTests>false</failIfNoTests>
<sort.skip>true</sort.skip>
</properties>
<build>
<resources>
<resource>
<directory>${project.build.directory}/extra-resources</directory>
<targetPath>META-INF</targetPath>
<directory>${project.build.directory}/extra-resources</directory>
<includes>
<include>LICENSE.txt</include>
<include>NOTICE.txt</include>
Expand All @@ -55,10 +52,10 @@
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>validate</phase>
<configuration>
<outputDirectory>${project.build.directory}/extra-resources</outputDirectory>
<resources>
Expand All @@ -78,21 +75,21 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<configuration>
<resourcesDirectory>${project.build.outputDirectory}</resourcesDirectory>
<includes>
<include>META-INF/LICENSE.txt</include>
<include>META-INF/NOTICE.txt</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>bundle</goal>
</goals>
<phase>process-resources</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
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 @@ -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 @@ -672,6 +672,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 @@ -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 c05126b

Please sign in to comment.