Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions tez-dag/src/main/java/org/apache/tez/dag/app/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
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;
Expand Down Expand Up @@ -127,9 +126,6 @@ public PluginDescriptors parseAllPlugins(boolean isLocal, UserPayload defaultPay
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 ||
Expand Down Expand Up @@ -192,38 +188,6 @@ public static void addDescriptor(List<NamedEntityDescriptor> list, BiMap<String,
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.
*/
Expand Down
25 changes: 0 additions & 25 deletions tez-dag/src/test/java/org/apache/tez/dag/app/TestDAGAppMaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,31 +259,6 @@ public void testParseAllPluginsNoneSpecified() throws IOException {
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);
Expand Down