Skip to content

Commit 8be8008

Browse files
authored
TEZ-4650: Remove useless logic from AM plugin management: processSchedulerDescriptors (#433) (Laszlo Bodor reviewed by Ayush Saxena)
1 parent 3ccfa8d commit 8be8008

2 files changed

Lines changed: 0 additions & 61 deletions

File tree

tez-dag/src/main/java/org/apache/tez/dag/app/PluginManager.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.apache.tez.dag.api.records.DAGProtos.TezNamedEntityDescriptorProto;
2929

3030
import com.google.common.annotations.VisibleForTesting;
31-
import com.google.common.base.Preconditions;
3231
import com.google.common.collect.BiMap;
3332
import com.google.common.collect.HashBiMap;
3433
import com.google.common.collect.Lists;
@@ -127,9 +126,6 @@ public PluginDescriptors parseAllPlugins(boolean isLocal, UserPayload defaultPay
127126
amPluginDescriptorProto.getTaskSchedulersList()),
128127
tezYarnEnabled, uberEnabled, defaultPayload);
129128

130-
// post-process task scheduler plugin descriptors
131-
processSchedulerDescriptors(taskSchedulerDescriptors, isLocal, defaultPayload, taskSchedulers);
132-
133129
// parse container launcher plugins
134130
parsePlugin(containerLauncherDescriptors, containerLaunchers,
135131
(amPluginDescriptorProto == null ||
@@ -192,38 +188,6 @@ public static void addDescriptor(List<NamedEntityDescriptor> list, BiMap<String,
192188
pluginMap.put(list.getLast().getEntityName(), list.size() - 1);
193189
}
194190

195-
/**
196-
* Process scheduler descriptors with framework-specific logic.
197-
*/
198-
public void processSchedulerDescriptors(List<NamedEntityDescriptor> descriptors, boolean isLocal,
199-
UserPayload defaultPayload,
200-
BiMap<String, Integer> schedulerPluginMap) {
201-
if (isLocal) {
202-
boolean foundUberServiceName = false;
203-
for (NamedEntityDescriptor<?> descriptor : descriptors) {
204-
if (descriptor.getEntityName().equals(TezConstants.getTezUberServicePluginName())) {
205-
foundUberServiceName = true;
206-
break;
207-
}
208-
}
209-
Preconditions.checkState(foundUberServiceName);
210-
} else {
211-
boolean foundYarn = false;
212-
for (NamedEntityDescriptor descriptor : descriptors) {
213-
if (descriptor.getEntityName().equals(TezConstants.getTezYarnServicePluginName())) {
214-
foundYarn = true;
215-
break;
216-
}
217-
}
218-
if (!foundYarn) {
219-
NamedEntityDescriptor<?> yarnDescriptor =
220-
new NamedEntityDescriptor(TezConstants.getTezYarnServicePluginName(), null)
221-
.setUserPayload(defaultPayload);
222-
addDescriptor(descriptors, schedulerPluginMap, yarnDescriptor);
223-
}
224-
}
225-
}
226-
227191
/**
228192
* Get the task schedulers map.
229193
*/

tez-dag/src/test/java/org/apache/tez/dag/app/TestDAGAppMaster.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -259,31 +259,6 @@ public void testParseAllPluginsNoneSpecified() throws IOException {
259259
TezConstants.getTezUberServicePluginName());
260260
}
261261

262-
@Test(timeout = 5000)
263-
public void testParseAllPluginsOnlyCustomSpecified() throws IOException {
264-
Configuration conf = new Configuration(false);
265-
conf.set(TEST_KEY, TEST_VAL);
266-
UserPayload defaultPayload = TezUtils.createUserPayloadFromConf(conf);
267-
TezUserPayloadProto payloadProto = TezUserPayloadProto.newBuilder()
268-
.setUserPayload(ByteString.copyFrom(defaultPayload.getPayload())).build();
269-
270-
AMPluginDescriptorProto proto = createAmPluginDescriptor(false, false, true, payloadProto);
271-
272-
// Only plugin, Yarn.
273-
PluginManager pluginManager = new PluginManager(proto);
274-
PluginManager.PluginDescriptors pluginDescriptors = pluginManager.parseAllPlugins(false, defaultPayload);
275-
verifyDescAndMap(pluginDescriptors.getTaskSchedulerDescriptors(),
276-
pluginManager.getTaskSchedulers(), 2, true, TS_NAME,
277-
TezConstants.getTezYarnServicePluginName());
278-
verifyDescAndMap(pluginDescriptors.getContainerLauncherDescriptors(),
279-
pluginManager.getContainerLaunchers(), 1, true, CL_NAME);
280-
verifyDescAndMap(pluginDescriptors.getTaskCommunicatorDescriptors(),
281-
pluginManager.getTaskCommunicators(), 1, true, TC_NAME);
282-
assertEquals(TS_NAME + CLASS_SUFFIX, pluginDescriptors.getTaskSchedulerDescriptors().get(0).getClassName());
283-
assertEquals(CL_NAME + CLASS_SUFFIX, pluginDescriptors.getContainerLauncherDescriptors().get(0).getClassName());
284-
assertEquals(TC_NAME + CLASS_SUFFIX, pluginDescriptors.getTaskCommunicatorDescriptors().get(0).getClassName());
285-
}
286-
287262
@Test(timeout = 5000)
288263
public void testParseAllPluginsCustomAndYarnSpecified() throws IOException {
289264
Configuration conf = new Configuration(false);

0 commit comments

Comments
 (0)