Skip to content

Commit c3c6ddf

Browse files
committed
HADOOP-15984. Fix CheckStyle.
1 parent 7d7ebea commit c3c6ddf

File tree

33 files changed

+123
-180
lines changed

33 files changed

+123
-180
lines changed

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHsWebServicesJobsQuery.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ public void setUp() throws Exception {
109109
public void testJobsQueryStateNone() throws Exception {
110110
WebTarget r = target();
111111

112-
ArrayList<JobState> JOB_STATES = new ArrayList<>(Arrays.asList(JobState.values()));
112+
ArrayList<JobState> jobStates = new ArrayList<>(Arrays.asList(JobState.values()));
113113

114114
// find a state that isn't in use
115115
Map<JobId, Job> jobsMap = appContext.getAllJobs();
116116
for (Map.Entry<JobId, Job> entry : jobsMap.entrySet()) {
117-
JOB_STATES.remove(entry.getValue().getState());
117+
jobStates.remove(entry.getValue().getState());
118118
}
119119

120-
assertTrue("No unused job states", JOB_STATES.size() > 0);
121-
JobState notInUse = JOB_STATES.get(0);
120+
assertTrue("No unused job states", jobStates.size() > 0);
121+
JobState notInUse = jobStates.get(0);
122122

123123
Response response = r
124124
.path("ws")

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHsWebServicesLogs.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,10 @@ protected Application configure() {
163163
private class JerseyBinder extends AbstractBinder {
164164
private Configuration newConf;
165165

166-
public JerseyBinder() {
167-
166+
JerseyBinder() {
168167
}
169168

170-
public JerseyBinder(Configuration newConf) {
169+
JerseyBinder(Configuration newConf) {
171170
this.newConf = newConf;
172171
}
173172

hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/test/java/org/apache/hadoop/mapreduce/v2/hs/webapp/TestHsWebServicesTasks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class TestHsWebServicesTasks extends JerseyTestBase {
8080
private static Configuration conf = new Configuration();
8181
private static MockHistoryContext appContext;
8282
private static HsWebApp webApp;
83-
private final ApplicationClientProtocol acp = mock(ApplicationClientProtocol.class);
83+
private static ApplicationClientProtocol acp = mock(ApplicationClientProtocol.class);
8484

8585
@Override
8686
protected Application configure() {

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/writer/TimelineEntitiesWriter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ public class TimelineEntitiesWriter implements MessageBodyWriter<TimelineEntitie
3737
private ObjectMapper objectMapper = new ObjectMapper();
3838

3939
@Override
40-
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
40+
public boolean isWriteable(Class<?> type, Type genericType,
41+
Annotation[] annotations, MediaType mediaType) {
4142
return type == TimelineEntities.class;
4243
}
4344

4445
@Override
4546
public void writeTo(TimelineEntities timelineEntities, Class<?> type, Type genericType,
46-
Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
47-
throws IOException, WebApplicationException {
47+
Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
48+
OutputStream entityStream) throws IOException, WebApplicationException {
4849
String entity = objectMapper.writeValueAsString(timelineEntities);
4950
entityStream.write(entity.getBytes(StandardCharsets.UTF_8));
5051
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/writer/TimelineEntityWriter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ public class TimelineEntityWriter implements MessageBodyWriter<TimelineEntity> {
3737
private ObjectMapper objectMapper = new ObjectMapper();
3838

3939
@Override
40-
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
40+
public boolean isWriteable(Class<?> type, Type genericType,
41+
Annotation[] annotations, MediaType mediaType) {
4142
return type == TimelineEntity.class;
4243
}
4344

4445
@Override
4546
public void writeTo(TimelineEntity timelineEntity, Class<?> type, Type genericType,
46-
Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
47-
throws IOException, WebApplicationException {
47+
Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
48+
OutputStream entityStream) throws IOException, WebApplicationException {
4849
String entity = objectMapper.writeValueAsString(timelineEntity);
4950
entityStream.write(entity.getBytes(StandardCharsets.UTF_8));
5051
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
@InterfaceAudience.Public
19+
@InterfaceStability.Evolving
20+
package org.apache.hadoop.yarn.api.records.writer;
21+
import org.apache.hadoop.classification.InterfaceAudience;
22+
import org.apache.hadoop.classification.InterfaceStability;
23+

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-api/src/main/java/org/apache/hadoop/yarn/service/client/ApiServiceClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ public int actionCancelUpgrade(
709709
String buffer = jsonSerDeser.toJson(service);
710710
LOG.info("Cancel upgrade in progress. Please wait..");
711711
Response response = getApiClient(getServicePath(appName))
712-
.put(Entity.entity(buffer,MediaType.APPLICATION_JSON));
712+
.put(Entity.entity(buffer, MediaType.APPLICATION_JSON));
713713
result = processResponse(response);
714714
} catch (Exception e) {
715715
LOG.error("Failed to cancel upgrade: ", e);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ public String getNodeHttpAddressFromRMWebString(ContainerLogsRequest request)
15001500

15011501
// Class to handle retry
15021502

1503-
private static class ClientJerseyRetryFilter implements ClientRequestFilter {
1503+
private static final class ClientJerseyRetryFilter implements ClientRequestFilter {
15041504

15051505
@Private
15061506
@VisibleForTesting

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ private RetryPolicy<Object> createRetryPolicy(Configuration conf) {
292292
long retryInterval = conf.getLong(
293293
YarnConfiguration.TIMELINE_SERVICE_CLIENT_RETRY_INTERVAL_MS,
294294
YarnConfiguration.DEFAULT_TIMELINE_SERVICE_CLIENT_RETRY_INTERVAL_MS);
295-
return retryPolicy = new RetryPolicy<>()
295+
return new RetryPolicy<>()
296296
.handle(IOException.class, RuntimeException.class)
297297
.handleIf(e -> e instanceof ProcessingException
298298
&& (e.getCause() instanceof ConnectException

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineReaderClientImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import static org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType.YARN_APPLICATION_ATTEMPT;
5353
import static org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType.YARN_CONTAINER;
5454
import static org.apache.hadoop.yarn.util.StringHelper.PATH_JOINER;
55+
import static javax.ws.rs.core.Response.Status.OK;
5556

5657
/**
5758
* Implementation of TimelineReaderClient interface.
@@ -257,7 +258,7 @@ protected Response doGetUri(URI base, String path, MultivaluedMap<String, String
257258
throw new IOException(e);
258259
}
259260

260-
if (resp == null || resp.getStatusInfo().getStatusCode() != Response.Status.OK.getStatusCode()) {
261+
if (resp == null || resp.getStatusInfo().getStatusCode() != OK.getStatusCode()) {
261262
String msg = "Response from the timeline reader server is " +
262263
((resp == null) ? "null" : "not successful, HTTP error code: " +
263264
resp.getStatus() + ", Server response:\n" + resp.readEntity(String.class));

0 commit comments

Comments
 (0)