diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SchedulerConfigurationMutationRequest.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SchedulerConfigurationMutationRequest.java new file mode 100644 index 0000000..9a465ed --- /dev/null +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SchedulerConfigurationMutationRequest.java @@ -0,0 +1,65 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.api.protocolrecords; + +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.api.ApplicationClientProtocol; +import org.apache.hadoop.yarn.api.records.SchedulerConfigurationMutation; +import org.apache.hadoop.yarn.util.Records; + + +/** + *
+ * The request sent by the client to the ResourceManager to add or
+ * remove or update scheduler configurations.
+ *
+ * The request includes the {@link SchedulerConfigurationMutation} + *
+ * + * @see ApplicationClientProtocol#mutateSchedulerConfiguration(SchedulerConfigurationMutationRequest) + */ + +@Public +@Unstable +public abstract class SchedulerConfigurationMutationRequest { + public static SchedulerConfigurationMutationRequest newInstance( + SchedulerConfigurationMutation schedulerConfigurationMutation) { + SchedulerConfigurationMutationRequest request = + Records.newRecord(SchedulerConfigurationMutationRequest.class); + request.setSchedulerConfigurationMutation(schedulerConfigurationMutation); + return request; + } + + /** + * Get theSchedulerConfigurationMutation.
+ *
+ * @return SchedulerConfigurationMutation
+ */
+ public abstract SchedulerConfigurationMutation getSchedulerConfigurationMutation();
+
+ /**
+ * Set the SchedulerConfigurationMutation.
+ *
+ * @param schedulerConfigurationMutation SchedulerConfigurationMutation
+ */
+ public abstract void setSchedulerConfigurationMutation(
+ SchedulerConfigurationMutation schedulerConfigurationMutation);
+}
diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SchedulerConfigurationMutationResponse.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SchedulerConfigurationMutationResponse.java
new file mode 100644
index 0000000..625c7d3
--- /dev/null
+++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/SchedulerConfigurationMutationResponse.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.yarn.api.protocolrecords;
+
+import org.apache.hadoop.classification.InterfaceAudience.Public;
+import org.apache.hadoop.classification.InterfaceStability.Unstable;
+import org.apache.hadoop.yarn.util.Records;
+
+
+/**
+ *
+ * The response sent by the ResourceManager to the client on add or
+ * remove or update scheduler configurations.
+ *
+ * A response without exception means that the configuration mutation has completed + * successfully. + *
+ */ +@Public +@Unstable +public abstract class SchedulerConfigurationMutationResponse { + + public static SchedulerConfigurationMutationResponse newInstance() { + SchedulerConfigurationMutationResponse response = + Records.newRecord(SchedulerConfigurationMutationResponse.class); + return response; + } +} diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueConfigurationMutation.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueConfigurationMutation.java new file mode 100644 index 0000000..d7f657c --- /dev/null +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/QueueConfigurationMutation.java @@ -0,0 +1,100 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.yarn.api.records; + +import org.apache.hadoop.classification.InterfaceAudience.Private; +import org.apache.hadoop.classification.InterfaceAudience.Public; +import org.apache.hadoop.classification.InterfaceStability.Stable; +import org.apache.hadoop.classification.InterfaceStability.Unstable; +import org.apache.hadoop.yarn.util.Records; + +import java.util.Map; + +/** + *QueueConfigurationMutation encapsulates mutations for a
+ * single queue's configuration.
SchedulerOperationType of this queue
+ * configuration change
+ */
+ @Private
+ @Unstable
+ public abstract SchedulerOperationType getOperationType();
+
+ /**
+ * Set the SchedulerOperationType of this
+ * queue configuration change
+ * @param operationType operation type of this queue configuration change
+ */
+ @Private
+ @Unstable
+ public abstract void setOperationType(SchedulerOperationType operationType);
+
+ /**
+ * Get the params for this queue configuration change
+ * @return Map of key-value pairs for this configuration change
+ */
+ @Private
+ @Unstable
+ public abstract MapSchedulerConfigurationMutation encapsulates mutations
+ * for scheduler configuration.