Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ public class CapacitySchedulerConfiguration extends ReservationSchedulerConfigur
@Private
public static final Integer DEFAULT_CONFIGURATION_APPLICATION_PRIORITY = 0;

@Private
public static final String DEFAULT_APPLICATION_PRIORITY_GLOBAL =
PREFIX + "default-application-priority";

@Private
public static final String AVERAGE_CAPACITY = "average-capacity";

Expand Down Expand Up @@ -1815,11 +1819,17 @@ public Priority getClusterLevelApplicationMaxPriority() {
YarnConfiguration.DEFAULT_CLUSTER_LEVEL_APPLICATION_PRIORITY));
}

public Integer getDefaultApplicationPriorityConfPerQueue(QueuePath queue) {
Integer defaultPriority = getInt(getQueuePrefix(queue)
+ DEFAULT_APPLICATION_PRIORITY,
/**
* Get the global default application priority setting.
* @return global default priority or DEFAULT_CONFIGURATION_APPLICATION_PRIORITY if not set */
private Integer getDefaultApplicationPriority() {
return getInt(DEFAULT_APPLICATION_PRIORITY_GLOBAL,
DEFAULT_CONFIGURATION_APPLICATION_PRIORITY);
return defaultPriority;
}

public Integer getDefaultApplicationPriorityConfPerQueue(QueuePath queue) {
return getInt(getQueuePrefix(queue) + DEFAULT_APPLICATION_PRIORITY,
getDefaultApplicationPriority());
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,20 @@ public void testLimitsComputation() throws Exception {
csConf.getMaximumApplicationMasterResourcePerQueuePercent(
queue.getQueuePathObject()), epsilon);

assertEquals(
(int)CapacitySchedulerConfiguration.DEFAULT_CONFIGURATION_APPLICATION_PRIORITY,
(int)csConf.getDefaultApplicationPriorityConfPerQueue(
queue.getQueuePathObject())
);

csConf.setInt(PREFIX + queue.getQueuePath()
+ ".default-application-priority", 6);

assertEquals((int) 6,
(int) csConf.getDefaultApplicationPriorityConfPerQueue(
queue.getQueuePathObject())
);

assertThat(queue.calculateAndGetAMResourceLimit()).isEqualTo(
Resource.newInstance(800 * GB, 1));
assertThat(queue.getUserAMResourceLimit()).isEqualTo(
Expand Down