Skip to content

Conversation

@abstractdog
Copy link
Contributor

@abstractdog abstractdog commented Sep 2, 2025

As described on jira:
Interface and reflective plugin configuration for a pool of AMs identified by a namespace.
The registry should allow each DAGClientServer to register/unregister themselves from a pool.

Basically, this PR introduces AMRegistry that is going to be implemented in TEZ-4007 by a Zookeeper AM registry.

@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@abstractdog abstractdog force-pushed the TEZ-4008 branch 2 times, most recently from 23ce3eb to f0a349c Compare September 2, 2025 14:17
@apache apache deleted a comment from tez-yetus Sep 2, 2025
@tez-yetus

This comment was marked as outdated.

@abstractdog abstractdog force-pushed the TEZ-4008 branch 2 times, most recently from 325bcf4 to e08ff20 Compare September 2, 2025 17:17
@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@tez-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 11s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 3 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 1m 55s Maven dependency ordering for branch
+1 💚 mvninstall 8m 13s master passed
+1 💚 compile 0m 55s master passed
+1 💚 checkstyle 0m 52s master passed
+1 💚 javadoc 0m 53s master passed
+0 🆗 spotbugs 1m 36s tez-api in master has 610 extant spotbugs warnings.
+0 🆗 spotbugs 0m 59s tez-dag in master has 785 extant spotbugs warnings.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 6s Maven dependency ordering for patch
+1 💚 mvninstall 0m 36s the patch passed
+1 💚 codespell 0m 15s No new issues.
+1 💚 compile 0m 37s the patch passed
+1 💚 javac 0m 37s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 17s the patch passed
+1 💚 javadoc 0m 25s the patch passed
+1 💚 spotbugs 1m 54s the patch passed
_ Other Tests _
+1 💚 unit 1m 49s tez-api in the patch passed.
+1 💚 unit 4m 8s tez-dag in the patch passed.
+1 💚 asflicense 0m 17s The patch does not generate ASF License warnings.
27m 4s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/9/artifact/out/Dockerfile
GITHUB PR #426
Optional Tests dupname asflicense codespell detsecrets xmllint javac javadoc unit compile spotbugs checkstyle
uname Linux 6f32f1b38442 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-home/workspace/tez-multibranch_PR-426/src/.yetus/personality.sh
git revision master / 6ff2aa5
Default Java Ubuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/9/testReport/
Max. process+thread count 382 (vs. ulimit of 5500)
modules C: tez-api tez-dag U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/9/console
versions git=2.43.0 maven=3.8.7 spotbugs=4.9.3 codespell=2.0.0
Powered by Apache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

Copy link
Member

@ayushtkn ayushtkn left a comment

Choose a reason for hiding this comment

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

Thanx @abstractdog, minor comments, rest LGTM

tez-api/pom.xml Outdated
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-registry</artifactId>
Copy link
Member

Choose a reason for hiding this comment

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

use hadoop-registry, hadoop-yarn-registry is just a stub pom, which has only hadoop-registry
https://issues.apache.org/jira/browse/HADOOP-15821

Comment on lines 49 to 61
public AMRecord(AMRecord other) {
this.appId = other.getApplicationId();
this.host = other.getHost();
this.port = other.getPort();
this.id = other.getId();
}

public AMRecord(ServiceRecord serviceRecord) {
this.appId = ApplicationId.fromString(serviceRecord.get(APP_ID_RECORD_KEY));
this.host = serviceRecord.get(HOST_RECORD_KEY);
this.port = Integer.parseInt(serviceRecord.get(PORT_RECORD_KEY));
this.id = serviceRecord.get(OPAQUE_ID_KEY);
}
Copy link
Member

Choose a reason for hiding this comment

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

these two aren't used anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they aren't used from tez code base, instead at tez clients that might want to handle tez unmanaged sessions
I know this looks strange at first sight, but let me add javadoc clarifying this, and you'll see if it's more straightforward


@Override
public boolean equals(Object other) {
if (other instanceof AMRecord otherRecord) {
Copy link
Member

Choose a reason for hiding this comment

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

should we bail out early if other == this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, that branch is part of traditional equals method, let me add

}
}

public ServiceRecord toServiceRecord() {
Copy link
Member

Choose a reason for hiding this comment

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

this isn't used either?

Copy link
Contributor Author

@abstractdog abstractdog Sep 4, 2025

Choose a reason for hiding this comment

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

same as above, adding javadoc

Comment on lines 100 to 102
@Override
public int hashCode() {
return appId.hashCode() * host.hashCode() * id.hashCode() + port;
Copy link
Member

Choose a reason for hiding this comment

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

multiplying can easily lead to overflow & two values can collide easily. If any of appId, host or id is null, this will lead to NPE as well.

How about using

    return Objects.hash(appId, host, port, id);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice, I haven't used this before :D let me fix

public static final String TEZ_CLIENT_VERSION_ENV = "TEZ_CLIENT_VERSION";

//Arbitrary opaque ID to identify AM instances from AMRegistryClient
public static final String TEZ_AM_UUID = "UUID";
Copy link
Member

Choose a reason for hiding this comment

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

is there a possibility to use TEZ_AM_UUID rather than just UUID?

Configuration conf = new Configuration();
AMRegistry amRegistry = AMRegistryUtils.createAMRegistry(conf);
assertNull(amRegistry);
String className = "org.apache.tez.dag.api.client.registry.TestAMRegistry$SkeletonAMRegistry";
Copy link
Member

Choose a reason for hiding this comment

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

can we do String className = SkeletonAMRegistry.class.getName(); rather than hardcoding

Comment on lines 50 to 51
amRegistry = AMRegistryUtils.createAMRegistry(conf);
assertEquals(className, amRegistry.getClass().getName());
Copy link
Member

Choose a reason for hiding this comment

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

should add

 assertNotNull(amRegistry);

Else if it still stays null, rather than failing with some nice error, it will fail with NPE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, adding it

@tez-yetus

This comment was marked as outdated.

@abstractdog
Copy link
Contributor Author

thanks for the review so far, @ayushtkn, addressed them, precommit is green

@tez-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 32s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 3 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 1m 53s Maven dependency ordering for branch
+1 💚 mvninstall 10m 16s master passed
+1 💚 compile 1m 24s master passed
+1 💚 checkstyle 1m 13s master passed
+1 💚 javadoc 1m 15s master passed
+0 🆗 spotbugs 2m 18s tez-api in master has 610 extant spotbugs warnings.
+0 🆗 spotbugs 1m 50s tez-dag in master has 785 extant spotbugs warnings.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 9s Maven dependency ordering for patch
+1 💚 mvninstall 0m 59s the patch passed
+1 💚 codespell 0m 31s No new issues.
+1 💚 compile 0m 57s the patch passed
+1 💚 javac 0m 57s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 29s the patch passed
+1 💚 javadoc 0m 40s the patch passed
+1 💚 spotbugs 3m 25s the patch passed
_ Other Tests _
+1 💚 unit 2m 15s tez-api in the patch passed.
+1 💚 unit 5m 3s tez-dag in the patch passed.
+1 💚 asflicense 0m 21s The patch does not generate ASF License warnings.
37m 15s
Subsystem Report/Notes
Docker ClientAPI=1.51 ServerAPI=1.51 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/12/artifact/out/Dockerfile
GITHUB PR #426
Optional Tests dupname asflicense codespell detsecrets xmllint javac javadoc unit compile spotbugs checkstyle
uname Linux 6ceadde259dc 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-home/workspace/tez-multibranch_PR-426/src/.yetus/personality.sh
git revision master / b05793a
Default Java Ubuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/12/testReport/
Max. process+thread count 489 (vs. ulimit of 5500)
modules C: tez-api tez-dag U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/12/console
versions git=2.43.0 maven=3.8.7 spotbugs=4.9.3 codespell=2.0.0
Powered by Apache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

Copy link
Member

@ayushtkn ayushtkn left a comment

Choose a reason for hiding this comment

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

LGTM

@abstractdog abstractdog merged commit 4a28907 into apache:master Sep 4, 2025
4 checks passed
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.

3 participants