Skip to content

Conversation

@abstractdog
Copy link
Contributor

@abstractdog abstractdog commented Sep 6, 2025

This PR contains a Zookeeper-based Framework service and a major refactor in this area.

Pieces of this PR:

  • include curator dependency
  • remove amUuid from DAGAppMaster
  • harmonized id/opaque id to externalId in terms of variable and env constant name
  • FrameworkService base interface: marker interface for framework-level services, implementations are framework-specific (currently yarn or zookeeper)
    • ClientFrameworkService: interface for client-side framework services; users of this class can acquire tez clients for the actual framework (yarn/zookeeper)
    • ServerFrameworkService: interface for server-side framework services; users of this class can acquire server-side logic for the actual framework (yarn/zookeeper)
  • AMExtensions: a class that encapsulates all the pluggable logic within DAGAppMaster
  • update unit tests to provide an AMExtensions to prevent NPE while mocking

@tez-yetus

This comment was marked as outdated.

* Curator/Zookeeper impl of AMRegistryClient
*/
@InterfaceAudience.Public
public class ZkAMRegistryClient extends AMRegistryClient {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a question. What is the duty of ZooKeeper here? When I read this patch a while ago, I presumed ZooKeeper would be used for two reasons. My memory might be wrong.

  1. Generate a unique application ID
  2. Service discovery for application masters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@okumin: both:

  1. ZkAMRegistry.generateNewId takes care of generating applicationId (backed by zookeeper)
  2. it also for service discovery (AM registers itself, client receives updates about that)

I'm happy to see that you're interested in the area!
please be aware that it's under refactor, I'll let you know, when it's ready

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. Background: I wonder if it can be independent of ZooKeeper technically. The reliability and fault-tolerance of ZK are beneficial in many environments, but in other cases, high availability is not necessary. Trino does not provide fault-tolerance with its coordinator, and some users appreciate the ease of use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

absolutely! be aware that these patches have been working for years in downstream distributions. This PR is about contributing them back, so apparently, it's ZK the long-term plan is to improve abstractions and make it more pluggable, and replace ZK with Kubernetes etcd, for example, but the default (yarn-based) behavior doesn't utilize an AM registry at all
can you please elaborate on how Trino's lack of fault tolerance comes to this picture? I mean, this ZK-based registry is more about AM service discovery, not fault tolerance

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi folks, sorry, I'd like to chime in with a question here. :)

From the description of TEZ-3991, this feature seems to allow the AM to manage its own lifecycle, while clients such as HiveServer2 only need to discover available AMs via ZooKeeper (ZK) and submit tasks.

Based on my current limited understanding, the benefits of this feature should include reducing the burden on HS2 and potentially making task submission more efficient.

However, I have a few questions:

  • Is this feature primarily beneficial for LLAP mode? Since LLAP requires long-running Tez AMs, and IMO this feature seems more useful for long-running tasks.

  • Could this functionality serve as preliminary groundwork for decoupling the Tez framework from YARN? For example, could it pave the way for Tez to run directly on Kubernetes without relying on YARN for resource management?

Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

be aware that these patches have been working for years in downstream distributions

Sounds excellent.

can you please elaborate on how Trino's lack of fault tolerance comes to this picture?

Trino must have SPOF, but still attracts users. Hive on Tez (with LLAP) without fault tolerance is easier to set up than Hive on Tez with fault tolerance. I expect the easy quick start should attract users.

@abstractdog abstractdog changed the title TEZ-4007: Zookeeper based FrameworkServices and AmExtensions (3/3) - initial patch [DRAFT] TEZ-4007: Zookeeper based FrameworkServices and AmExtensions (3/3) - initial patch Sep 11, 2025
@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@abstractdog abstractdog force-pushed the TEZ-4007 branch 2 times, most recently from d3c969a to b3ae071 Compare October 14, 2025 08:21
@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

@abstractdog abstractdog changed the title [DRAFT] TEZ-4007: Zookeeper based FrameworkServices and AmExtensions (3/3) - initial patch [DRAFT] TEZ-4007: Zookeeper based FrameworkServices and AmExtensions (3/3) + refactor Oct 15, 2025
@tez-yetus

This comment was marked as outdated.

@abstractdog abstractdog force-pushed the TEZ-4007 branch 5 times, most recently from ec30327 to db11fb6 Compare October 17, 2025 12:49
@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

This comment was marked as outdated.

@abstractdog abstractdog force-pushed the TEZ-4007 branch 2 times, most recently from 2e44662 to eec88ab Compare October 22, 2025 13:51
@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

…s - checkstyle, spotbugs, javadoc improvements, refactor, test fixes
@tez-yetus

This comment was marked as outdated.

@tez-yetus

This comment was marked as outdated.

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 for the PR, Had a first pass, dropped some comments

Comment on lines 76 to 78
//externalId is optional, if not provided, convert to empty string
this.externalId = (externalId == null) ? "" : externalId;
this.computeName = (computeName == null) ? ZkConfig.DEFAULT_COMPUTE_GROUP_NAME : computeName;
Copy link
Member

Choose a reason for hiding this comment

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

nit, can we do something like:

    this.externalId = Optional.ofNullable(externalId).orElse("");
    this.computeName = Optional.ofNullable(computeName).orElse(ZkConfig.DEFAULT_COMPUTE_GROUP_NAME);

Comment on lines 126 to 154
if (other instanceof AMRecord otherRecord) {
if (other instanceof AMRecord) {
AMRecord otherRecord = (AMRecord) other;
Copy link
Member

Choose a reason for hiding this comment

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

it can be done this way

    if (other instanceof AMRecord otherRecord) {
      return appId.equals(otherRecord.appId)
          && hostName.equals(otherRecord.hostName)
          && hostIp.equals(otherRecord.hostIp)
          && port == otherRecord.port
          && externalId.equals(otherRecord.externalId)
          && computeName.equals(otherRecord.computeName);
    }

Comment on lines +41 to +42
amRegistry.init(conf);
amRegistry.start();
Copy link
Member

Choose a reason for hiding this comment

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

who does stop & close?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added javadoc comment to clarify this:

  /**
   * Returns a singleton {@link AMRegistry} instance backed by ZooKeeper.
   *
   * <p>If the registry has not yet been created, this method initializes and starts
   * a new {@link ZkAMRegistry} using the external AM identifier obtained from the
   * {@code TEZ_AM_EXTERNAL_ID} environment variable.</p>
   *
   * <p>When the registry is used as a service within the DAGAppMaster, the
   * DAGAppMaster is responsible for managing its lifecycle, including closure.</p>
   *
   * @param conf the configuration used to initialize the registry; must not be null
   * @return the initialized and started {@link AMRegistry} instance
   * @throws IllegalStateException if the {@code TEZ_AM_EXTERNAL_ID} environment variable is not set
   * @throws RuntimeException if an error occurs while creating, initializing, or starting the registry
   */


@Override
public AMExtensions getAMExtensions() {
return new ZkStandaloneAMExtensions(this);
Copy link
Member

Choose a reason for hiding this comment

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

we are creating new instance on every invocation? should we create once & then send back the same if not null?


package org.apache.tez.client.registry.zookeeper;

import static org.junit.Assert.*;
Copy link
Member

Choose a reason for hiding this comment

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

nit
should avoid *


private TezConfiguration getTezConfForZkDiscovery() {
TezConfiguration tezConf = new TezConfiguration();
tezConf.set(TezConfiguration.TEZ_FRAMEWORK_MODE, "STANDALONE_ZOOKEEPER");
Copy link
Member

Choose a reason for hiding this comment

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

STANDALONE_ZOOKEEPER.name()

}
}
assertTrue("AM record should be in getAllRecords", found);
LOG.info("Test completed successfully. AM was discovered: {}", amRecord);
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure what value does this log line add :-)

@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 29s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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 14 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 2m 38s Maven dependency ordering for branch
+1 💚 mvninstall 9m 52s master passed
+1 💚 compile 5m 24s master passed
+1 💚 checkstyle 3m 16s master passed
+1 💚 javadoc 4m 4s master passed
+0 🆗 spotbugs 2m 10s tez-api in master has 610 extant spotbugs warnings.
+0 🆗 spotbugs 0m 45s tez-common in master has 13 extant spotbugs warnings.
+0 🆗 spotbugs 1m 11s tez-runtime-library in master has 241 extant spotbugs warnings.
+0 🆗 spotbugs 0m 43s tez-examples in master has 2 extant spotbugs warnings.
+0 🆗 spotbugs 1m 44s tez-dag in master has 785 extant spotbugs warnings.
+0 🆗 spotbugs 6m 56s root in master has 2066 extant spotbugs warnings.
-0 ⚠️ patch 7m 40s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for patch
+1 💚 mvninstall 6m 19s the patch passed
+1 💚 codespell 0m 50s No new issues.
+1 💚 compile 5m 17s the patch passed
+1 💚 javac 5m 17s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 24s tez-api: The patch generated 0 new + 118 unchanged - 3 fixed = 118 total (was 121)
+1 💚 checkstyle 0m 21s The patch passed checkstyle in tez-common
+1 💚 checkstyle 0m 26s The patch passed checkstyle in tez-runtime-library
+1 💚 checkstyle 0m 21s tez-examples: The patch generated 0 new + 10 unchanged - 1 fixed = 10 total (was 11)
-0 ⚠️ checkstyle 0m 33s /results-checkstyle-tez-dag.txt tez-dag: The patch generated 1 new + 610 unchanged - 2 fixed = 611 total (was 612)
-0 ⚠️ checkstyle 0m 44s /results-checkstyle-root.txt root: The patch generated 1 new + 740 unchanged - 6 fixed = 741 total (was 746)
+1 💚 javadoc 3m 55s the patch passed
+1 💚 spotbugs 14m 10s the patch passed
_ Other Tests _
+1 💚 unit 2m 37s tez-api in the patch passed.
+1 💚 unit 0m 44s tez-common in the patch passed.
+1 💚 unit 6m 8s tez-runtime-library in the patch passed.
+1 💚 unit 0m 32s tez-examples in the patch passed.
+1 💚 unit 6m 28s tez-dag in the patch passed.
+1 💚 unit 74m 14s root in the patch passed.
+1 💚 asflicense 2m 46s The patch does not generate ASF License warnings.
171m 18s
Subsystem Report/Notes
Docker ClientAPI=1.52 ServerAPI=1.52 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/30/artifact/out/Dockerfile
GITHUB PR #427
Optional Tests dupname asflicense javac javadoc unit codespell detsecrets xmllint compile spotbugs checkstyle
uname Linux de6817b7aa0a 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-home/workspace/tez-multibranch_PR-427/src/.yetus/personality.sh
git revision master / 731c4df
Default Java Ubuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/30/testReport/
Max. process+thread count 1322 (vs. ulimit of 5500)
modules C: tez-api tez-common tez-runtime-library tez-examples tez-dag . U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/30/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.

@tez-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s 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 14 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 2m 38s Maven dependency ordering for branch
+1 💚 mvninstall 10m 0s master passed
+1 💚 compile 5m 22s master passed
+1 💚 checkstyle 3m 18s master passed
+1 💚 javadoc 4m 3s master passed
+0 🆗 spotbugs 2m 8s tez-api in master has 610 extant spotbugs warnings.
+0 🆗 spotbugs 0m 46s tez-common in master has 13 extant spotbugs warnings.
+0 🆗 spotbugs 1m 14s tez-runtime-library in master has 241 extant spotbugs warnings.
+0 🆗 spotbugs 0m 44s tez-examples in master has 2 extant spotbugs warnings.
+0 🆗 spotbugs 1m 46s tez-dag in master has 785 extant spotbugs warnings.
+0 🆗 spotbugs 6m 58s root in master has 2066 extant spotbugs warnings.
-0 ⚠️ patch 7m 43s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
+1 💚 mvninstall 6m 32s the patch passed
+1 💚 codespell 0m 50s No new issues.
+1 💚 compile 5m 25s the patch passed
+1 💚 javac 5m 25s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 26s tez-api: The patch generated 0 new + 118 unchanged - 3 fixed = 118 total (was 121)
+1 💚 checkstyle 0m 23s The patch passed checkstyle in tez-common
+1 💚 checkstyle 0m 28s The patch passed checkstyle in tez-runtime-library
+1 💚 checkstyle 0m 22s tez-examples: The patch generated 0 new + 10 unchanged - 1 fixed = 10 total (was 11)
-0 ⚠️ checkstyle 0m 34s /results-checkstyle-tez-dag.txt tez-dag: The patch generated 1 new + 610 unchanged - 2 fixed = 611 total (was 612)
-0 ⚠️ checkstyle 0m 46s /results-checkstyle-root.txt root: The patch generated 1 new + 740 unchanged - 6 fixed = 741 total (was 746)
+1 💚 javadoc 3m 57s the patch passed
+1 💚 spotbugs 14m 14s the patch passed
_ Other Tests _
+1 💚 unit 2m 36s tez-api in the patch passed.
+1 💚 unit 0m 44s tez-common in the patch passed.
+1 💚 unit 6m 9s tez-runtime-library in the patch passed.
+1 💚 unit 0m 31s tez-examples in the patch passed.
+1 💚 unit 6m 2s tez-dag in the patch passed.
+1 💚 unit 72m 14s root in the patch passed.
+1 💚 asflicense 2m 42s The patch does not generate ASF License warnings.
169m 38s
Subsystem Report/Notes
Docker ClientAPI=1.52 ServerAPI=1.52 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/31/artifact/out/Dockerfile
GITHUB PR #427
Optional Tests dupname asflicense javac javadoc unit codespell detsecrets xmllint compile spotbugs checkstyle
uname Linux 7c7c4bb63872 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-home/workspace/tez-multibranch_PR-427/src/.yetus/personality.sh
git revision master / 045ff68
Default Java Ubuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/31/testReport/
Max. process+thread count 2109 (vs. ulimit of 5500)
modules C: tez-api tez-common tez-runtime-library tez-examples tez-dag . U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/31/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.

@abstractdog
Copy link
Contributor Author

abstractdog commented Dec 1, 2025

@ayushtkn : all your comments have been addressed, fixed many things according to them, which made this area much better, thanks!

@tez-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 13m 54s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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 14 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 2m 27s Maven dependency ordering for branch
+1 💚 mvninstall 7m 47s master passed
+1 💚 compile 2m 54s master passed
+1 💚 checkstyle 1m 45s master passed
+1 💚 javadoc 2m 11s master passed
+0 🆗 spotbugs 1m 28s tez-api in master has 610 extant spotbugs warnings.
+0 🆗 spotbugs 0m 27s tez-common in master has 13 extant spotbugs warnings.
+0 🆗 spotbugs 0m 38s tez-runtime-library in master has 241 extant spotbugs warnings.
+0 🆗 spotbugs 0m 26s tez-examples in master has 2 extant spotbugs warnings.
+0 🆗 spotbugs 0m 53s tez-dag in master has 785 extant spotbugs warnings.
+0 🆗 spotbugs 3m 40s root in master has 2066 extant spotbugs warnings.
-0 ⚠️ patch 4m 13s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 3m 41s the patch passed
+1 💚 codespell 0m 29s No new issues.
+1 💚 compile 2m 56s the patch passed
+1 💚 javac 2m 56s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 13s tez-api: The patch generated 0 new + 117 unchanged - 3 fixed = 117 total (was 120)
+1 💚 checkstyle 0m 12s The patch passed checkstyle in tez-common
+1 💚 checkstyle 0m 14s The patch passed checkstyle in tez-runtime-library
+1 💚 checkstyle 0m 12s tez-examples: The patch generated 0 new + 11 unchanged - 1 fixed = 11 total (was 12)
-0 ⚠️ checkstyle 0m 18s /results-checkstyle-tez-dag.txt tez-dag: The patch generated 1 new + 610 unchanged - 2 fixed = 611 total (was 612)
-0 ⚠️ checkstyle 0m 21s /results-checkstyle-root.txt root: The patch generated 1 new + 740 unchanged - 6 fixed = 741 total (was 746)
+1 💚 javadoc 2m 15s the patch passed
+1 💚 spotbugs 7m 37s the patch passed
_ Other Tests _
+1 💚 unit 2m 2s tez-api in the patch passed.
+1 💚 unit 0m 27s tez-common in the patch passed.
+1 💚 unit 4m 16s tez-runtime-library in the patch passed.
+1 💚 unit 0m 18s tez-examples in the patch passed.
+1 💚 unit 4m 52s tez-dag in the patch passed.
+1 💚 unit 59m 20s root in the patch passed.
+1 💚 asflicense 1m 43s The patch does not generate ASF License warnings.
133m 34s
Subsystem Report/Notes
Docker ClientAPI=1.52 ServerAPI=1.52 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/33/artifact/out/Dockerfile
GITHUB PR #427
Optional Tests dupname asflicense javac javadoc unit codespell detsecrets xmllint compile spotbugs checkstyle
uname Linux d19566a5022f 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-home/workspace/tez-multibranch_PR-427/src/.yetus/personality.sh
git revision master / 6bf4f1f
Default Java Ubuntu-21.0.9+10-Ubuntu-124.04
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/33/testReport/
Max. process+thread count 2109 (vs. ulimit of 5500)
modules C: tez-api tez-common tez-runtime-library tez-examples tez-dag . U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/33/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.

@tez-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 24s 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 14 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 2m 27s Maven dependency ordering for branch
+1 💚 mvninstall 8m 1s master passed
+1 💚 compile 2m 50s master passed
+1 💚 checkstyle 1m 34s master passed
+1 💚 javadoc 2m 3s master passed
+0 🆗 spotbugs 1m 29s tez-api in master has 610 extant spotbugs warnings.
+0 🆗 spotbugs 0m 24s tez-common in master has 13 extant spotbugs warnings.
+0 🆗 spotbugs 0m 38s tez-runtime-library in master has 241 extant spotbugs warnings.
+0 🆗 spotbugs 0m 23s tez-examples in master has 2 extant spotbugs warnings.
+0 🆗 spotbugs 0m 51s tez-dag in master has 785 extant spotbugs warnings.
+0 🆗 spotbugs 3m 47s root in master has 2066 extant spotbugs warnings.
-0 ⚠️ patch 4m 15s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 3m 54s the patch passed
+1 💚 codespell 0m 31s No new issues.
+1 💚 compile 2m 49s the patch passed
+1 💚 javac 2m 49s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 12s tez-api: The patch generated 0 new + 117 unchanged - 3 fixed = 117 total (was 120)
+1 💚 checkstyle 0m 11s The patch passed checkstyle in tez-common
+1 💚 checkstyle 0m 13s The patch passed checkstyle in tez-runtime-library
+1 💚 checkstyle 0m 11s tez-examples: The patch generated 0 new + 11 unchanged - 1 fixed = 11 total (was 12)
-0 ⚠️ checkstyle 0m 16s /results-checkstyle-tez-dag.txt tez-dag: The patch generated 2 new + 610 unchanged - 2 fixed = 612 total (was 612)
-0 ⚠️ checkstyle 0m 22s /results-checkstyle-root.txt root: The patch generated 2 new + 740 unchanged - 6 fixed = 742 total (was 746)
+1 💚 javadoc 2m 1s the patch passed
+1 💚 spotbugs 7m 39s the patch passed
_ Other Tests _
+1 💚 unit 2m 1s tez-api in the patch passed.
+1 💚 unit 0m 25s tez-common in the patch passed.
+1 💚 unit 4m 6s tez-runtime-library in the patch passed.
+1 💚 unit 0m 20s tez-examples in the patch passed.
+1 💚 unit 4m 33s tez-dag in the patch passed.
+1 💚 unit 60m 3s root in the patch passed.
+1 💚 asflicense 1m 28s The patch does not generate ASF License warnings.
119m 27s
Subsystem Report/Notes
Docker ClientAPI=1.52 ServerAPI=1.52 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/35/artifact/out/Dockerfile
GITHUB PR #427
Optional Tests dupname asflicense javac javadoc unit codespell detsecrets xmllint compile spotbugs checkstyle
uname Linux b839cd43c9e4 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-home/workspace/tez-multibranch_PR-427/src/.yetus/personality.sh
git revision master / f30ec00
Default Java Ubuntu-21.0.9+10-Ubuntu-124.04
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/35/testReport/
Max. process+thread count 2110 (vs. ulimit of 5500)
modules C: tez-api tez-common tez-runtime-library tez-examples tez-dag . U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/35/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.

@tez-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 29s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s 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 14 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 2m 40s Maven dependency ordering for branch
+1 💚 mvninstall 9m 59s master passed
+1 💚 compile 5m 15s master passed
+1 💚 checkstyle 2m 54s master passed
+1 💚 javadoc 4m 26s master passed
+0 🆗 spotbugs 2m 11s tez-api in master has 610 extant spotbugs warnings.
+0 🆗 spotbugs 0m 47s tez-common in master has 13 extant spotbugs warnings.
+0 🆗 spotbugs 1m 11s tez-runtime-library in master has 241 extant spotbugs warnings.
+0 🆗 spotbugs 0m 41s tez-examples in master has 2 extant spotbugs warnings.
+0 🆗 spotbugs 1m 45s tez-dag in master has 785 extant spotbugs warnings.
+0 🆗 spotbugs 7m 21s root in master has 2066 extant spotbugs warnings.
-0 ⚠️ patch 8m 6s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for patch
+1 💚 mvninstall 6m 53s the patch passed
+1 💚 codespell 0m 51s No new issues.
+1 💚 compile 5m 20s the patch passed
+1 💚 javac 5m 20s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 22s /results-checkstyle-tez-api.txt tez-api: The patch generated 1 new + 118 unchanged - 3 fixed = 119 total (was 121)
+1 💚 checkstyle 0m 21s The patch passed checkstyle in tez-common
+1 💚 checkstyle 0m 21s The patch passed checkstyle in tez-runtime-library
+1 💚 checkstyle 0m 19s tez-examples: The patch generated 0 new + 10 unchanged - 1 fixed = 10 total (was 11)
-0 ⚠️ checkstyle 0m 30s /results-checkstyle-tez-dag.txt tez-dag: The patch generated 2 new + 610 unchanged - 2 fixed = 612 total (was 612)
-0 ⚠️ checkstyle 0m 43s /results-checkstyle-root.txt root: The patch generated 3 new + 740 unchanged - 6 fixed = 743 total (was 746)
+1 💚 javadoc 3m 38s the patch passed
+1 💚 spotbugs 14m 43s the patch passed
_ Other Tests _
+1 💚 unit 2m 35s tez-api in the patch passed.
+1 💚 unit 0m 40s tez-common in the patch passed.
+1 💚 unit 5m 58s tez-runtime-library in the patch passed.
+1 💚 unit 0m 26s tez-examples in the patch passed.
+1 💚 unit 6m 1s tez-dag in the patch passed.
+1 💚 unit 73m 2s root in the patch passed.
+1 💚 asflicense 2m 32s The patch does not generate ASF License warnings.
170m 23s
Subsystem Report/Notes
Docker ClientAPI=1.52 ServerAPI=1.52 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/34/artifact/out/Dockerfile
GITHUB PR #427
Optional Tests dupname asflicense javac javadoc unit codespell detsecrets xmllint compile spotbugs checkstyle
uname Linux dee85b6ffdbd 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-home/workspace/tez-multibranch_PR-427/src/.yetus/personality.sh
git revision master / 2e8a6fb
Default Java Ubuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/34/testReport/
Max. process+thread count 2107 (vs. ulimit of 5500)
modules C: tez-api tez-common tez-runtime-library tez-examples tez-dag . U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/34/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.

@tez-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s 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 14 new or modified test files.
_ master Compile Tests _
+0 🆗 mvndep 2m 38s Maven dependency ordering for branch
+1 💚 mvninstall 9m 51s master passed
+1 💚 compile 5m 23s master passed
+1 💚 checkstyle 3m 14s master passed
+1 💚 javadoc 4m 3s master passed
+0 🆗 spotbugs 2m 9s tez-api in master has 610 extant spotbugs warnings.
+0 🆗 spotbugs 0m 47s tez-common in master has 13 extant spotbugs warnings.
+0 🆗 spotbugs 1m 10s tez-runtime-library in master has 241 extant spotbugs warnings.
+0 🆗 spotbugs 0m 45s tez-examples in master has 2 extant spotbugs warnings.
+0 🆗 spotbugs 1m 44s tez-dag in master has 785 extant spotbugs warnings.
+0 🆗 spotbugs 6m 51s root in master has 2066 extant spotbugs warnings.
-0 ⚠️ patch 7m 34s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
+1 💚 mvninstall 6m 21s the patch passed
+1 💚 codespell 0m 50s No new issues.
+1 💚 compile 5m 19s the patch passed
+1 💚 javac 5m 19s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 26s tez-api: The patch generated 0 new + 118 unchanged - 3 fixed = 118 total (was 121)
+1 💚 checkstyle 0m 23s The patch passed checkstyle in tez-common
+1 💚 checkstyle 0m 27s The patch passed checkstyle in tez-runtime-library
+1 💚 checkstyle 0m 23s tez-examples: The patch generated 0 new + 10 unchanged - 1 fixed = 10 total (was 11)
-0 ⚠️ checkstyle 0m 33s /results-checkstyle-tez-dag.txt tez-dag: The patch generated 2 new + 610 unchanged - 2 fixed = 612 total (was 612)
-0 ⚠️ checkstyle 0m 45s /results-checkstyle-root.txt root: The patch generated 2 new + 740 unchanged - 6 fixed = 742 total (was 746)
+1 💚 javadoc 3m 59s the patch passed
+1 💚 spotbugs 14m 13s the patch passed
_ Other Tests _
+1 💚 unit 2m 36s tez-api in the patch passed.
+1 💚 unit 0m 42s tez-common in the patch passed.
+1 💚 unit 6m 9s tez-runtime-library in the patch passed.
+1 💚 unit 0m 32s tez-examples in the patch passed.
+1 💚 unit 6m 7s tez-dag in the patch passed.
+1 💚 unit 73m 45s root in the patch passed.
+1 💚 asflicense 2m 46s The patch does not generate ASF License warnings.
170m 36s
Subsystem Report/Notes
Docker ClientAPI=1.52 ServerAPI=1.52 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/36/artifact/out/Dockerfile
GITHUB PR #427
Optional Tests dupname asflicense javac javadoc unit codespell detsecrets xmllint compile spotbugs checkstyle
uname Linux e3f0c21725bf 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-home/workspace/tez-multibranch_PR-427/src/.yetus/personality.sh
git revision master / 3938781
Default Java Ubuntu-21.0.8+9-Ubuntu-0ubuntu124.04.1
Test Results https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/36/testReport/
Max. process+thread count 1379 (vs. ulimit of 5500)
modules C: tez-api tez-common tez-runtime-library tez-examples tez-dag . U: .
Console output https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-427/36/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.

Minor comments. Rest LGTM

if (other instanceof AMRecord otherRecord) {
return appId.equals(otherRecord.appId)
&& host.equals(otherRecord.host)
&& hostName.equals(otherRecord.hostName)
Copy link
Member

Choose a reason for hiding this comment

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

can this lead to NPE, we don't have any default here

this.hostName = serviceRecord.get(HOST_NAME_RECORD_KEY);


@Override
public String toString() {
return toServiceRecord().attributes().toString();
Copy link
Member

Choose a reason for hiding this comment

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

toString calls toServiceRecord, So, it can lead to initializing the serviceRecord = new ServiceRecord();, are we ok with it. This could lead to issues later, like someone logged it or so, before setting the values and then we have the service record cached as well

AMRecord createAmRecord(ApplicationId appId, String hostName, String hostIp, int port,
String computeName);

void close();
Copy link
Member

Choose a reason for hiding this comment

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

AutoCloseable already defines close, do we need to define again here?

Comment on lines +42 to +44
void add(AMRecord server) throws Exception;

void remove(AMRecord server) throws Exception;
Copy link
Member

Choose a reason for hiding this comment

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

should it be server or record

* <p>Listeners may be registered to receive notifications when AM records
* appear or are removed.</p>
*/
public abstract class AMRegistryClient implements Closeable {
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 implements AutoCloseable?

@Override
public void start() {
try {
amRegistryClient.start();
Copy link
Member

Choose a reason for hiding this comment

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

we should return if isRunning is true here


public class ZkFrameworkClient extends FrameworkClient {

private AMRecord amRecord;
Copy link
Member

Choose a reason for hiding this comment

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

should this be volatile

} else if (modeInEnv != null) {
return getByMode(interfaze, modeInEnv);
} else if (defaultClazz != null) {
return (T) defaultClazz.newInstance();
Copy link
Member

Choose a reason for hiding this comment

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

I think this is deprecated, does this work

defaultClazz.getDeclaredConstructor().newInstance();

String modeInConf = conf != null ? conf.get(TezConfiguration.TEZ_FRAMEWORK_MODE) : null;
String modeInEnv = System.getenv(TezConstants.TEZ_FRAMEWORK_MODE);
try {
if (modeInConf != null) {
Copy link
Member

Choose a reason for hiding this comment

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

should it be StringUtils.isNotEmpty()?

.thenReturn(YarnApplicationState.RUNNING);

//Client 1 start
client.start();
Copy link
Member

Choose a reason for hiding this comment

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

missing close?

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.

5 participants