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

abstractdog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tez.git


The following commit(s) were added to refs/heads/master by this push:
     new 8be80080c TEZ-4650: Remove useless logic from AM plugin management: 
processSchedulerDescriptors (#433) (Laszlo Bodor reviewed by Ayush Saxena)
8be80080c is described below

commit 8be80080c2f1543bcf6fd7aecf0634f77452903b
Author: Bodor Laszlo <[email protected]>
AuthorDate: Mon Oct 13 13:02:00 2025 +0200

    TEZ-4650: Remove useless logic from AM plugin management: 
processSchedulerDescriptors (#433) (Laszlo Bodor reviewed by Ayush Saxena)
---
 .../java/org/apache/tez/dag/app/PluginManager.java | 36 ----------------------
 .../org/apache/tez/dag/app/TestDAGAppMaster.java   | 25 ---------------
 2 files changed, 61 deletions(-)

diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/PluginManager.java 
b/tez-dag/src/main/java/org/apache/tez/dag/app/PluginManager.java
index 24f607758..b9151bd4c 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/PluginManager.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/PluginManager.java
@@ -28,7 +28,6 @@ import 
org.apache.tez.dag.api.records.DAGProtos.AMPluginDescriptorProto;
 import org.apache.tez.dag.api.records.DAGProtos.TezNamedEntityDescriptorProto;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.BiMap;
 import com.google.common.collect.HashBiMap;
 import com.google.common.collect.Lists;
@@ -127,9 +126,6 @@ public class PluginManager {
             amPluginDescriptorProto.getTaskSchedulersList()),
         tezYarnEnabled, uberEnabled, defaultPayload);
 
-    // post-process task scheduler plugin descriptors
-    processSchedulerDescriptors(taskSchedulerDescriptors, isLocal, 
defaultPayload, taskSchedulers);
-
     // parse container launcher plugins
     parsePlugin(containerLauncherDescriptors, containerLaunchers,
         (amPluginDescriptorProto == null ||
@@ -192,38 +188,6 @@ public class PluginManager {
     pluginMap.put(list.getLast().getEntityName(), list.size() - 1);
   }
 
-  /**
-   * Process scheduler descriptors with framework-specific logic.
-   */
-  public void processSchedulerDescriptors(List<NamedEntityDescriptor> 
descriptors, boolean isLocal,
-                                          UserPayload defaultPayload,
-                                          BiMap<String, Integer> 
schedulerPluginMap) {
-    if (isLocal) {
-      boolean foundUberServiceName = false;
-      for (NamedEntityDescriptor<?> descriptor : descriptors) {
-        if 
(descriptor.getEntityName().equals(TezConstants.getTezUberServicePluginName())) 
{
-          foundUberServiceName = true;
-          break;
-        }
-      }
-      Preconditions.checkState(foundUberServiceName);
-    } else {
-      boolean foundYarn = false;
-      for (NamedEntityDescriptor descriptor : descriptors) {
-        if 
(descriptor.getEntityName().equals(TezConstants.getTezYarnServicePluginName())) 
{
-          foundYarn = true;
-          break;
-        }
-      }
-      if (!foundYarn) {
-        NamedEntityDescriptor<?> yarnDescriptor =
-            new 
NamedEntityDescriptor(TezConstants.getTezYarnServicePluginName(), null)
-                .setUserPayload(defaultPayload);
-        addDescriptor(descriptors, schedulerPluginMap, yarnDescriptor);
-      }
-    }
-  }
-
   /**
    * Get the task schedulers map.
    */
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/TestDAGAppMaster.java 
b/tez-dag/src/test/java/org/apache/tez/dag/app/TestDAGAppMaster.java
index 01a61b64e..afe2e8bc3 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/TestDAGAppMaster.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/TestDAGAppMaster.java
@@ -259,31 +259,6 @@ public class TestDAGAppMaster {
         TezConstants.getTezUberServicePluginName());
   }
 
-  @Test(timeout = 5000)
-  public void testParseAllPluginsOnlyCustomSpecified() throws IOException {
-    Configuration conf = new Configuration(false);
-    conf.set(TEST_KEY, TEST_VAL);
-    UserPayload defaultPayload = TezUtils.createUserPayloadFromConf(conf);
-    TezUserPayloadProto payloadProto = TezUserPayloadProto.newBuilder()
-        
.setUserPayload(ByteString.copyFrom(defaultPayload.getPayload())).build();
-
-    AMPluginDescriptorProto proto = createAmPluginDescriptor(false, false, 
true, payloadProto);
-
-    // Only plugin, Yarn.
-    PluginManager pluginManager = new PluginManager(proto);
-    PluginManager.PluginDescriptors pluginDescriptors = 
pluginManager.parseAllPlugins(false, defaultPayload);
-    verifyDescAndMap(pluginDescriptors.getTaskSchedulerDescriptors(),
-        pluginManager.getTaskSchedulers(), 2, true, TS_NAME,
-        TezConstants.getTezYarnServicePluginName());
-    verifyDescAndMap(pluginDescriptors.getContainerLauncherDescriptors(),
-        pluginManager.getContainerLaunchers(), 1, true, CL_NAME);
-    verifyDescAndMap(pluginDescriptors.getTaskCommunicatorDescriptors(),
-        pluginManager.getTaskCommunicators(), 1, true, TC_NAME);
-    assertEquals(TS_NAME + CLASS_SUFFIX, 
pluginDescriptors.getTaskSchedulerDescriptors().get(0).getClassName());
-    assertEquals(CL_NAME + CLASS_SUFFIX, 
pluginDescriptors.getContainerLauncherDescriptors().get(0).getClassName());
-    assertEquals(TC_NAME + CLASS_SUFFIX, 
pluginDescriptors.getTaskCommunicatorDescriptors().get(0).getClassName());
-  }
-
   @Test(timeout = 5000)
   public void testParseAllPluginsCustomAndYarnSpecified() throws IOException {
     Configuration conf = new Configuration(false);

Reply via email to