You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by er...@apache.org on 2023/06/30 17:35:06 UTC

[ozone] branch master updated: HDDS-8966. Replace test-specific unknown value with real one (#5010)

This is an automated email from the ASF dual-hosted git repository.

erose 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 53ba990cbb HDDS-8966. Replace test-specific unknown value with real one (#5010)
53ba990cbb is described below

commit 53ba990cbbf16e5daf652fad149ae2060574acf9
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Fri Jun 30 19:35:01 2023 +0200

    HDDS-8966. Replace test-specific unknown value with real one (#5010)
---
 .../common/src/main/java/org/apache/hadoop/ozone/OmUtils.java        | 1 +
 .../apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java   | 2 +-
 hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto  | 2 +-
 .../apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisServer.java    | 5 -----
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
index 7f40ab9485..4cb3c678c0 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
@@ -319,6 +319,7 @@ public final class OmUtils {
     case SnapshotPurge:
     case RecoverLease:
     case SetTimes:
+    case UnknownCommand:
       return false;
     default:
       LOG.error("CmdType {} is not categorized as readOnly or not.", cmdType);
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java
index ba24c113c7..4e44a0567f 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java
@@ -103,7 +103,7 @@ public class TestOzoneManagerRatisRequest {
     // Create an instance of OMRequest with an unknown command type.
     OzoneManagerProtocolProtos.OMRequest omRequest =
         OzoneManagerProtocolProtos.OMRequest.newBuilder()
-            .setCmdType(OzoneManagerProtocolProtos.Type.TestUnknownCommand)
+            .setCmdType(OzoneManagerProtocolProtos.Type.UnknownCommand)
             .setClientId("test-client-id")
             .build();
 
diff --git a/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto b/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto
index 8399d3ba85..a64283fb1c 100644
--- a/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto
+++ b/hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto
@@ -39,6 +39,7 @@ import "hdds.proto";
 import "Security.proto";
 
 enum Type {
+  UnknownCommand = 0;
   CreateVolume = 11;
   SetVolumeProperty = 12;
   CheckVolumeAccess = 13;
@@ -138,7 +139,6 @@ enum Type {
   RefetchSecretKey = 121;
   ListSnapshotDiffJobs = 122;
   CancelSnapshotDiff = 123;
-  TestUnknownCommand = 124;
 }
 
 message OMRequest {
diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisServer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisServer.java
index fda8ebcd8a..c04e8fdcdf 100644
--- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisServer.java
+++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisServer.java
@@ -200,11 +200,6 @@ public class TestOzoneManagerRatisServer {
         OzoneManagerProtocolProtos.Type.values();
 
     for (OzoneManagerProtocolProtos.Type cmdtype : cmdTypes) {
-      if (cmdtype == OzoneManagerProtocolProtos.Type.TestUnknownCommand) {
-        // Skip OzoneManagerProtocolProtos.Type.TestUnknownCommand, since this
-        // cmdType is reserved for testing purposes only.
-        continue;
-      }
       OMRequest request = OMRequest.newBuilder()
           .setCmdType(cmdtype)
           .setClientId(clientId)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org