Skip to content

Commit 3f1c658

Browse files
committed
YARN-11536. Fix CheckStyle.
1 parent fc1fe56 commit 3f1c658

File tree

5 files changed

+93
-5
lines changed

5 files changed

+93
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.yarn.server.api.protocolrecords;
19+
20+
import org.apache.hadoop.classification.InterfaceAudience;
21+
import org.apache.hadoop.classification.InterfaceAudience.Private;
22+
import org.apache.hadoop.classification.InterfaceAudience.Public;
23+
import org.apache.hadoop.classification.InterfaceStability.Unstable;
24+
import org.apache.hadoop.yarn.util.Records;
25+
26+
import java.util.List;
27+
28+
/**
29+
* In Federation mode,
30+
* we will support batch save queues policies to FederationStateStore.
31+
*/
32+
@Private
33+
@Unstable
34+
public abstract class BatchSaveFederationQueuePoliciesRequest {
35+
36+
@Private
37+
@Unstable
38+
public static BatchSaveFederationQueuePoliciesRequest newInstance(
39+
List<FederationQueueWeight> federationQueueWeights) {
40+
BatchSaveFederationQueuePoliciesRequest request =
41+
Records.newRecord(BatchSaveFederationQueuePoliciesRequest.class);
42+
request.setFederationQueueWeights(federationQueueWeights);
43+
return request;
44+
}
45+
46+
@Public
47+
@Unstable
48+
public abstract List<FederationQueueWeight> getFederationQueueWeights();
49+
50+
@Private
51+
@Unstable
52+
public abstract void setFederationQueueWeights(
53+
List<FederationQueueWeight> federationQueueWeights);
54+
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/proto/server/yarn_server_resourcemanager_service_protos.proto

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ message SaveFederationQueuePolicyResponseProto {
180180
required string message = 1;
181181
}
182182

183+
message BatchSaveFederationQueuePoliciesRequestProto {
184+
repeated FederationQueueWeightProto federationQueueWeights = 1;
185+
}
186+
187+
message BatchSaveFederationQueuePoliciesResponseProto {
188+
required string message = 1;
189+
}
190+
183191
//////////////////////////////////////////////////////////////////
184192
///////////// RM Failover related records ////////////////////////
185193
//////////////////////////////////////////////////////////////////

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/RouterCLI.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,12 @@ private int handleSavePolicy(String policy) {
381381
}
382382
}
383383

384+
private int handBatchSavePolicies(String format, String policyFile) {
385+
LOG.info("Batch Save Federation Policies. Format = {}, PolicyFile = {}.",
386+
format, policyFile);
387+
return 1;
388+
}
389+
384390
/**
385391
* We will parse the policy, and it has specific formatting requirements.
386392
*

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/FederationQueueWeightPBImpl.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,42 @@ public void setHeadRoomAlpha(String headRoomAlpha) {
116116

117117
@Override
118118
public String getQueue() {
119+
FederationQueueWeightProtoOrBuilder p = this.viaProto ? this.proto : this.builder;
120+
boolean hasQueue = p.hasQueue();
121+
if (hasQueue) {
122+
return p.getQueue();
123+
}
119124
return null;
120125
}
121126

122127
@Override
123128
public void setQueue(String queue) {
124-
129+
maybeInitBuilder();
130+
if (queue == null) {
131+
builder.clearQueue();
132+
return;
133+
}
134+
builder.setQueue(queue);
125135
}
126136

127137
@Override
128138
public String getPolicyManagerClassName() {
139+
FederationQueueWeightProtoOrBuilder p = this.viaProto ? this.proto : this.builder;
140+
boolean hasPolicyManagerClassName = p.hasPolicyManagerClassName();
141+
if (hasPolicyManagerClassName) {
142+
return p.getPolicyManagerClassName();
143+
}
129144
return null;
130145
}
131146

132147
@Override
133148
public void setPolicyManagerClassName(String policyManagerClassName) {
134-
149+
maybeInitBuilder();
150+
if (policyManagerClassName == null) {
151+
builder.clearPolicyManagerClassName();
152+
return;
153+
}
154+
builder.setPolicyManagerClassName(policyManagerClassName);
135155
}
136156

137157
@Override

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
"broccoli-merge-trees": "1.1.1",
2828
"ember-array-contains-helper": "1.0.2",
2929
"ember-bootstrap": "0.5.1",
30-
"ember-cli": "1.13.14",
30+
"ember-cli": "3.0.0",
3131
"ember-cli-app-version": "1.0.0",
32-
"ember-cli-babel": "5.1.6",
32+
"ember-cli-babel": "6.6.0",
3333
"ember-cli-content-security-policy": "0.4.0",
3434
"ember-cli-dependency-checker": "1.2.0",
3535
"ember-cli-htmlbars": "1.0.2",
3636
"ember-cli-htmlbars-inline-precompile": "0.3.1",
37-
"ember-cli-ic-ajax": "0.2.1",
37+
"ember-cli-ic-ajax": "1.0.0",
3838
"ember-cli-inject-live-reload": "1.4.0",
3939
"ember-cli-jquery-ui": "0.0.20",
4040
"ember-cli-moment-shim": "0.7.3",

0 commit comments

Comments
 (0)