Skip to content

Commit

Permalink
YARN-11525. [Federation] Router CLI Supports Save the SubClusterPolic…
Browse files Browse the repository at this point in the history
…yConfiguration Of Queues.
  • Loading branch information
slfan1989 committed Jul 7, 2023
1 parent 9a804c2 commit d3dfffd
Show file tree
Hide file tree
Showing 9 changed files with 612 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/**
* 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.server.api.protocolrecords;

import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.util.Records;

/**
* Queue weights for representing Federation.
*/
@Private
@Unstable
public abstract class FederationQueueWeight {

@Private
@Unstable
public static FederationQueueWeight newInstance(String queue, String routerWeight,
String amrmWeight, String headRoomAlpha) {
FederationQueueWeight federationQueueWeight = Records.newRecord(FederationQueueWeight.class);
federationQueueWeight.setQueue(queue);
federationQueueWeight.setRouterWeight(routerWeight);
federationQueueWeight.setAmrmWeight(amrmWeight);
federationQueueWeight.setHeadRoomAlpha(headRoomAlpha);
return federationQueueWeight;
}

@Public
@Unstable
public abstract String getQueue();

@Public
@Unstable
public abstract void setQueue(String queue);

@Public
@Unstable
public abstract String getRouterWeight();

@Public
@Unstable
public abstract void setRouterWeight(String routerWeight);

@Public
@Unstable
public abstract String getAmrmWeight();

@Public
@Unstable
public abstract void setAmrmWeight(String amrmWeight);

@Public
@Unstable
public abstract String getHeadRoomAlpha();

@Public
@Unstable
public abstract void setHeadRoomAlpha(String headRoomAlpha);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* 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.server.api.protocolrecords;

import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.yarn.util.Records;

@Private
@Unstable
public abstract class ListFedQueuePolicyRequest {

@Private
@Unstable
public static ListFedQueuePolicyRequest newInstance(String queue) {
ListFedQueuePolicyRequest request = Records.newRecord(ListFedQueuePolicyRequest.class);
request.setQueue(queue);
return request;
}

/**
* Get the queue.
*
* @return queue.
*/
@Public
@Unstable
public abstract String getQueue();

/**
* Set the queue.
*
* @param queue queue.
*/
@Private
@InterfaceStability.Unstable
public abstract void setQueue(String queue);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* 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.server.api.protocolrecords;

import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.util.Records;

@Private
@Unstable
public abstract class SaveFederationQueuePolicyRequest {
@Private
@Unstable
public static SaveFederationQueuePolicyRequest newInstance(
FederationQueueWeight federationQueueWeight) {
SaveFederationQueuePolicyRequest request =
Records.newRecord(SaveFederationQueuePolicyRequest.class);
request.setFederationQueueWeight(federationQueueWeight);
return request;
}

/**
* Get the queue.
*
* @return queue.
*/
@Public
@Unstable
public abstract FederationQueueWeight getFederationQueueWeight();

/**
* Set the queue.
*
* @param queue queue.
*/
@Private
@Unstable
public abstract void setFederationQueueWeight(FederationQueueWeight queue);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* 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.server.api.protocolrecords;

import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceStability.Unstable;

@Private
@Unstable
public abstract class SaveFederationQueuePolicyResponse {
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ message DeregisterSubClusterResponseProto {
repeated DeregisterSubClustersProto deregisterSubClusters = 1;
}

message SaveFederationQueuePolicyRequestProto {
required FederationQueueWeightProto federationQueueWeight = 1;
}

message SaveFederationQueuePolicyResponseProto {
}

//////////////////////////////////////////////////////////////////
///////////// RM Failover related records ////////////////////////
//////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,13 @@ message DeregisterSubClustersProto {
optional string subClusterState = 5;
}

message FederationQueueWeightProto {
optional string queue = 1;
optional string routerWeight = 2;
optional string amrmWeight = 3;
optional string headRoomAlpha = 4;
}

////////////////////////////////////////////////////////////////////////
////// From AM_RM_Protocol /////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit d3dfffd

Please sign in to comment.