Skip to content

HDDS-13199. Remove DatanodeDetails#getUuid and DatanodeID#getUuid methods#10405

Open
navinko wants to merge 5 commits into
apache:masterfrom
navinko:HDDS-13199-continuing
Open

HDDS-13199. Remove DatanodeDetails#getUuid and DatanodeID#getUuid methods#10405
navinko wants to merge 5 commits into
apache:masterfrom
navinko:HDDS-13199-continuing

Conversation

@navinko
Copy link
Copy Markdown
Contributor

@navinko navinko commented Jun 1, 2026

What changes were proposed in this pull request?

Rebase 8576.patch with upstream latest

Please describe your PR in detail:

Remove DatanodeDetails#getUuid and DatanodeID#getUuid methods
This is continuation of left over on HDDS-13199

  • Rebase with latest upstream and fixed the code.
  • checkstyle fixes.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-13199

How was this patch tested?

Tested all existing unit test and integration test ran successfully.
Tests locally : Did not observe any failure.
`
bash-5.1$ ozone admin datanode list
Datanode: b8466a8b-d1fc-481e-8304-e7fe4d696bbc (/default-rack/172.18.0.9/ozone-datanode-2.ozone_default/2 pipelines)
Operational State: IN_SERVICE
Health State: HEALTHY
Total volume count: 1
Healthy volume count: 1
Related pipelines:
4b81bbb6-f2b0-4b0a-9656-49e59208d600/RATIS/ONE/RATIS/OPEN/Leader
0348f63f-1d2b-4007-85b1-36bfbbf1341e/RATIS/THREE/RATIS/OPEN/Follower

Datanode: fceb2cd0-de86-4581-9f65-6da8466e831d (/default-rack/172.18.0.3/ozone-datanode-1.ozone_default/2 pipelines)
Operational State: IN_SERVICE
Health State: HEALTHY
Total volume count: 1
Healthy volume count: 1
Related pipelines:
f79ecaf8-0025-487b-b849-190a0c0eb147/RATIS/ONE/RATIS/OPEN/Leader
0348f63f-1d2b-4007-85b1-36bfbbf1341e/RATIS/THREE/RATIS/OPEN/Leader

Datanode: 4ddd5199-bebf-4a78-b7fc-9ee9f7691820 (/default-rack/172.18.0.8/ozone-datanode-3.ozone_default/2 pipelines)
Operational State: IN_SERVICE
Health State: HEALTHY
Total volume count: 1
Healthy volume count: 1
Related pipelines:
7719e064-dec7-4ec9-a519-08fec2d228c5/RATIS/ONE/RATIS/OPEN/Leader
0348f63f-1d2b-4007-85b1-36bfbbf1341e/RATIS/THREE/RATIS/OPEN/Follower

bash-5.1$ ozone admin datanode usageinfo -m -c=3
Usage Information (3 Datanodes)

ID : b8466a8b-d1fc-481e-8304-e7fe4d696bbc
IP Address : 172.18.0.9
Hostname : ozone-datanode-2.ozone_default
Filesystem Capacity : 485473984512 B (452.13 GB)
Filesystem Used : 32625520640 B (30.38 GB)
Filesystem Used % : 6.72% (Filesystem Used/Filesystem Capacity)
Filesystem Available : 452848463872 B (421.75 GB)
Filesystem Available % : 93.28% (Filesystem Available/Filesystem Capacity)
Ozone Capacity : 485425437116 B (452.09 GB)
Ozone Used : 4382720 B (4.18 MB)
Ozone Used % : 0.00% (Ozone Used/Ozone Capacity)
Ozone Available : 452848463872 B (421.75 GB)
Ozone Available % : 93.29% (Ozone Available/Ozone capacity)
Pipeline(s) : 2
Container(s) : 0
Container Pre-allocated : 0 B (0 B)
Remaining Allocatable : 452848463872 B (421.75 GB)
Free Space To Spare : 104857600 B (100 MB)
Reserved : 48547396 B (46.30 MB)

ID : 4ddd5199-bebf-4a78-b7fc-9ee9f7691820
IP Address : 172.18.0.8
Hostname : ozone-datanode-3.ozone_default
Filesystem Capacity : 485473984512 B (452.13 GB)
Filesystem Used : 32625520640 B (30.38 GB)
Filesystem Used % : 6.72% (Filesystem Used/Filesystem Capacity)
Filesystem Available : 452848463872 B (421.75 GB)
Filesystem Available % : 93.28% (Filesystem Available/Filesystem Capacity)
Ozone Capacity : 485425437116 B (452.09 GB)
Ozone Used : 4382720 B (4.18 MB)
Ozone Used % : 0.00% (Ozone Used/Ozone Capacity)
Ozone Available : 452848463872 B (421.75 GB)
Ozone Available % : 93.29% (Ozone Available/Ozone capacity)
Pipeline(s) : 2
Container(s) : 0
Container Pre-allocated : 0 B (0 B)
Remaining Allocatable : 452848463872 B (421.75 GB)
Free Space To Spare : 104857600 B (100 MB)
Reserved : 48547396 B (46.30 MB)

ID : fceb2cd0-de86-4581-9f65-6da8466e831d
IP Address : 172.18.0.3
Hostname : ozone-datanode-1.ozone_default
Filesystem Capacity : 485473984512 B (452.13 GB)
Filesystem Used : 32123781120 B (29.92 GB)
Filesystem Used % : 6.62% (Filesystem Used/Filesystem Capacity)
Filesystem Available : 453350203392 B (422.22 GB)
Filesystem Available % : 93.38% (Filesystem Available/Filesystem Capacity)
Ozone Capacity : 485425437116 B (452.09 GB)
Ozone Used : 4382720 B (4.18 MB)
Ozone Used % : 0.00% (Ozone Used/Ozone Capacity)
Ozone Available : 453350203392 B (422.22 GB)
Ozone Available % : 93.39% (Ozone Available/Ozone capacity)
Pipeline(s) : 2
Container(s) : 0
Container Pre-allocated : 0 B (0 B)
Remaining Allocatable : 453350203392 B (422.22 GB)
Free Space To Spare : 104857600 B (100 MB)
Reserved : 48547396 B (46.30 MB)

CI build: https://github.com/navinko/ozone/actions/runs/26769887196

@navinko
Copy link
Copy Markdown
Contributor Author

navinko commented Jun 1, 2026

@navinko , Please see if you are interested in continuing the work in #8576 ?

Hi @szetszwo updated the changes with new PR .
Kindly review once you get some time .

Copy link
Copy Markdown
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

@navinko , Could you also remove DatanodeID#getUuid?

+++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeID.java
@@ -121,11 +121,4 @@ private static HddsProtos.UUID toProto(final UUID id) {
         .setLeastSigBits(id.getLeastSignificantBits())
         .build();
   }
-
-  // TODO: Remove this in follow-up Jira. (HDDS-12015)
-  //   Exposing this temporarily to help with refactoring.
-  @Deprecated
-  public UUID getUuid() {
-    return uuid;
-  }
 }

@navinko
Copy link
Copy Markdown
Contributor Author

navinko commented Jun 2, 2026

+1 the change looks good.

@navinko , Could you also remove DatanodeID#getUuid?

+++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeID.java
@@ -121,11 +121,4 @@ private static HddsProtos.UUID toProto(final UUID id) {
         .setLeastSigBits(id.getLeastSignificantBits())
         .build();
   }
-
-  // TODO: Remove this in follow-up Jira. (HDDS-12015)
-  //   Exposing this temporarily to help with refactoring.
-  @Deprecated
-  public UUID getUuid() {
-    return uuid;
-  }
 }

Thanks @szetszwo
My bad , I removed it now , It was only used in HddsTestUtils , updated changes.

@navinko navinko marked this pull request as draft June 2, 2026 08:53
@navinko
Copy link
Copy Markdown
Contributor Author

navinko commented Jun 2, 2026

Once i removed DatanodeID#getUuid? the local build and test cases passed but realised it broke robot test for balancer (ratis+EC) .Fixed it by updating DatanodeID#getID (which is used for json conversion) to DatanodeID#getUuid
Successful CI Build : https://github.com/navinko/ozone/actions/runs/26821321814/job/79098828322

@navinko navinko marked this pull request as ready for review June 2, 2026 16:33

// Mainly used for JSON conversion
public String getID() {
public String getUuid() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@navinko , Thanks for the update! Let's rename it to getUuidStringForTesting() and move it right after toString().

@@ -70,6 +65,10 @@ public String toString() {
     return uuidByteString.getString();
   }

+  public String getUuidStringForTesting() {
+    return toString();
+  }
+
   /**
    * This will be removed once the proto structure is refactored
    * to remove deprecated fields.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @szetszwo for the suggestions.
Addressed the review comments and used getUuidStringForTesting for tests only and updated HddsTestUtils.
Since earlier the balancer's robot test, jq was referring "datanodeDetails.id.uuid" and getUuid() was available in DatanodeID class so the test succeeded but with rename to getUuidStringForTesting caused uuid being null . I used datanodeDetails.uuidString instead of datanodeDetails.id.uuidStringForTesting to make robot test succeed.
CI Build : https://github.com/navinko/ozone/actions/runs/26844028091/job/79160804056

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants