You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ad...@apache.org on 2022/06/10 07:09:53 UTC
[ozone] branch master updated: HDDS-6846. HeadOp ignored for link bucket (#3495)
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 34eb378399 HDDS-6846. HeadOp ignored for link bucket (#3495)
34eb378399 is described below
commit 34eb378399368dd17e8850282a0dea02abe28373
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Fri Jun 10 09:09:47 2022 +0200
HDDS-6846. HeadOp ignored for link bucket (#3495)
---
hadoop-ozone/common/pom.xml | 4 +++
.../apache/hadoop/ozone/om/helpers/OmKeyArgs.java | 1 +
.../hadoop/ozone/om/helpers/TestOmKeyArgs.java | 41 ++++++++++++++++++++++
3 files changed, 46 insertions(+)
diff --git a/hadoop-ozone/common/pom.xml b/hadoop-ozone/common/pom.xml
index 701e6d5e6a..e5ec64f8a0 100644
--- a/hadoop-ozone/common/pom.xml
+++ b/hadoop-ozone/common/pom.xml
@@ -122,6 +122,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-params</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyArgs.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyArgs.java
index 40d84b8fb0..9e0ba115fc 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyArgs.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyArgs.java
@@ -187,6 +187,7 @@ public final class OmKeyArgs implements Auditable {
.addAllMetadata(metadata)
.setRefreshPipeline(refreshPipeline)
.setSortDatanodesInPipeline(sortDatanodesInPipeline)
+ .setHeadOp(headOp)
.setLatestVersionLocation(latestVersionLocation)
.setAcls(acls);
}
diff --git a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/helpers/TestOmKeyArgs.java b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/helpers/TestOmKeyArgs.java
new file mode 100644
index 0000000000..8ae02569e0
--- /dev/null
+++ b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/helpers/TestOmKeyArgs.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.ozone.om.helpers;
+
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * Test for {@link OmKeyArgs}.
+ */
+class TestOmKeyArgs {
+
+ @ParameterizedTest
+ @ValueSource(booleans = { true, false })
+ void toBuilderPreservesHeadOp(boolean headOp) {
+ OmKeyArgs subject = new OmKeyArgs.Builder()
+ .setHeadOp(headOp)
+ .build();
+
+ assertEquals(headOp, subject.isHeadOp());
+ assertEquals(headOp, subject.toBuilder().build().isHeadOp());
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org