Skip to content

TEZ-4008: Pluggable AM FrameworkServices and AmExtensions (2/3) - #426

Merged
abstractdog merged 3 commits into
apache:masterfrom
abstractdog:TEZ-4008
Sep 4, 2025
Merged

TEZ-4008: Pluggable AM FrameworkServices and AmExtensions (2/3)#426
abstractdog merged 3 commits into
apache:masterfrom
abstractdog:TEZ-4008

Conversation

@abstractdog

@abstractdogabstractdog commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

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
abstractdogforce-pushed the TEZ-4008 branch 2 times, most recently from 23ce3eb to f0a349cCompareSeptember 2, 2025 14:17
@apacheapache deleted a comment from tez-yetusSep 2, 2025
@tez-yetus

This comment was marked as outdated.

@abstractdog
abstractdogforce-pushed the TEZ-4008 branch 2 times, most recently from 325bcf4 to e08ff20CompareSeptember 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
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 11sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+0 🆗xmllint0m 0sxmllint was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 3 new or modified test files.
_ master Compile Tests _
+0 🆗mvndep1m 55sMaven dependency ordering for branch
+1 💚mvninstall8m 13smaster passed
+1 💚compile0m 55smaster passed
+1 💚checkstyle0m 52smaster passed
+1 💚javadoc0m 53smaster passed
+0 🆗spotbugs1m 36stez-api in master has 610 extant spotbugs warnings.
+0 🆗spotbugs0m 59stez-dag in master has 785 extant spotbugs warnings.
_ Patch Compile Tests _
+0 🆗mvndep0m 6sMaven dependency ordering for patch
+1 💚mvninstall0m 36sthe patch passed
+1 💚codespell0m 15sNo new issues.
+1 💚compile0m 37sthe patch passed
+1 💚javac0m 37sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 17sthe patch passed
+1 💚javadoc0m 25sthe patch passed
+1 💚spotbugs1m 54sthe patch passed
_ Other Tests _
+1 💚unit1m 49stez-api in the patch passed.
+1 💚unit4m 8stez-dag in the patch passed.
+1 💚asflicense0m 17sThe patch does not generate ASF License warnings.
27m 4s
SubsystemReport/Notes
DockerClientAPI=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 Testsdupname asflicense codespell detsecrets xmllint javac javadoc unit compile spotbugs checkstyle
unameLinux 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 toolmaven
Personality/home/jenkins/jenkins-home/workspace/tez-multibranch_PR-426/src/.yetus/personality.sh
git revisionmaster / 6ff2aa5
Default JavaUbuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/9/testReport/
Max. process+thread count382 (vs. ulimit of 5500)
modulesC: tez-api tez-dag U: .
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/9/console
versionsgit=2.43.0 maven=3.8.7 spotbugs=4.9.3 codespell=2.0.0
Powered byApache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@ayushtknayushtkn left a comment

Copy link
Copy Markdown
Member

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

Comment threadtez-api/pom.xml Outdated
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-registry</artifactId>

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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?

@abstractdogabstractdogSep 4, 2025

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 32sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+0 🆗xmllint0m 0sxmllint was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 3 new or modified test files.
_ master Compile Tests _
+0 🆗mvndep1m 53sMaven dependency ordering for branch
+1 💚mvninstall10m 16smaster passed
+1 💚compile1m 24smaster passed
+1 💚checkstyle1m 13smaster passed
+1 💚javadoc1m 15smaster passed
+0 🆗spotbugs2m 18stez-api in master has 610 extant spotbugs warnings.
+0 🆗spotbugs1m 50stez-dag in master has 785 extant spotbugs warnings.
_ Patch Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for patch
+1 💚mvninstall0m 59sthe patch passed
+1 💚codespell0m 31sNo new issues.
+1 💚compile0m 57sthe patch passed
+1 💚javac0m 57sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 29sthe patch passed
+1 💚javadoc0m 40sthe patch passed
+1 💚spotbugs3m 25sthe patch passed
_ Other Tests _
+1 💚unit2m 15stez-api in the patch passed.
+1 💚unit5m 3stez-dag in the patch passed.
+1 💚asflicense0m 21sThe patch does not generate ASF License warnings.
37m 15s
SubsystemReport/Notes
DockerClientAPI=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 Testsdupname asflicense codespell detsecrets xmllint javac javadoc unit compile spotbugs checkstyle
unameLinux 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 toolmaven
Personality/home/jenkins/jenkins-home/workspace/tez-multibranch_PR-426/src/.yetus/personality.sh
git revisionmaster / b05793a
Default JavaUbuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/12/testReport/
Max. process+thread count489 (vs. ulimit of 5500)
modulesC: tez-api tez-dag U: .
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-426/12/console
versionsgit=2.43.0 maven=3.8.7 spotbugs=4.9.3 codespell=2.0.0
Powered byApache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@ayushtknayushtkn left a comment

Copy link
Copy Markdown
Member

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:masterSep 4, 2025
4 checks passed
Sign up for freeto 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

@abstractdog@tez-yetus@ayushtkn