From 3d00c8f3942da931150de79f42cd4913bf751123 Mon Sep 17 00:00:00 2001 From: Varun Saxena Date: Wed, 30 Aug 2017 01:17:40 +0530 Subject: [PATCH] Made fixes for whitespace errors and checstyle warnings before merge. --- .../v2/app/rm/TestRMContainerAllocator.java | 13 +++++------ ...askAttemptUnsuccessfulCompletionEvent.java | 6 ++--- .../mapred/TestMRTimelineEventHandling.java | 2 +- .../hadoop/yarn/conf/YarnConfiguration.java | 2 +- .../TestDistributedShell.java | 2 +- .../yarn/client/api/TimelineV2Client.java | 1 - .../src/main/resources/yarn-default.xml | 2 +- ...melineAuthenticationFilterInitializer.java | 11 +++++----- ...melineAuthenticationFilterInitializer.java | 4 +++- .../security/authorize/NMPolicyProvider.java | 22 +++++++++---------- .../apptoflow/AppToFlowColumnPrefix.java | 2 +- .../storage/reader/EntityTypeReader.java | 5 ++--- .../storage/TimelineReader.java | 4 ++-- 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/rm/TestRMContainerAllocator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/rm/TestRMContainerAllocator.java index 6c74a7a12b..e4a8a1a90b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/rm/TestRMContainerAllocator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/rm/TestRMContainerAllocator.java @@ -142,7 +142,6 @@ import org.apache.hadoop.yarn.server.resourcemanager.scheduler.event.SchedulerEvent; import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler; import org.apache.hadoop.yarn.server.resourcemanager.security.AMRMTokenSecretManager; -import org.apache.hadoop.yarn.server.timelineservice.security.TimelineV2DelegationTokenSecretManagerService.TimelineV2DelegationTokenSecretManager; import org.apache.hadoop.yarn.server.utils.BuilderUtils; import org.apache.hadoop.yarn.util.Clock; import org.apache.hadoop.yarn.util.ControlledClock; @@ -777,7 +776,7 @@ public void testUpdateCollectorInfo() throws Exception { new Text("renewer"), null); ident.setSequenceNumber(1); Token collectorToken = - new Token (ident.getBytes(), + new Token(ident.getBytes(), new byte[0], TimelineDelegationTokenIdentifier.KIND_NAME, new Text(localAddr)); org.apache.hadoop.yarn.api.records.Token token = @@ -825,7 +824,7 @@ protected ApplicationMasterProtocol createSchedulerProxy() { // new token. ident.setSequenceNumber(100); Token collectorToken1 = - new Token (ident.getBytes(), + new Token(ident.getBytes(), new byte[0], TimelineDelegationTokenIdentifier.KIND_NAME, new Text(localAddr)); token = org.apache.hadoop.yarn.api.records.Token.newInstance( @@ -3585,15 +3584,15 @@ public void completeContainer(ContainerId containerId) { } } - private static class MockSchedulerForTimelineCollector + private final static class MockSchedulerForTimelineCollector implements ApplicationMasterProtocol { - CollectorInfo collectorInfo; + private CollectorInfo collectorInfo; - public MockSchedulerForTimelineCollector(CollectorInfo info) { + private MockSchedulerForTimelineCollector(CollectorInfo info) { this.collectorInfo = info; } - void updateCollectorInfo(CollectorInfo info) { + private void updateCollectorInfo(CollectorInfo info) { collectorInfo = info; } diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/TaskAttemptUnsuccessfulCompletionEvent.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/TaskAttemptUnsuccessfulCompletionEvent.java index 1529125c2f..9afa09384c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/TaskAttemptUnsuccessfulCompletionEvent.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/jobhistory/TaskAttemptUnsuccessfulCompletionEvent.java @@ -62,7 +62,7 @@ public class TaskAttemptUnsuccessfulCompletionEvent implements HistoryEvent { private long startTime; private static final Counters EMPTY_COUNTERS = new Counters(); - /** + /** * Create an event to record the unsuccessful completion of attempts. * @param id Attempt ID * @param taskType Type of the task @@ -227,12 +227,12 @@ public long getStartTime() { public String getHostname() { return hostname; } /** Gets the rpc port for the host where the attempt executed. */ public int getPort() { return port; } - + /** Gets the rack name of the node where the attempt ran. */ public String getRackName() { return rackName == null ? null : rackName.toString(); } - + /** Gets the error string. */ public String getError() { return error.toString(); } /** diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRTimelineEventHandling.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRTimelineEventHandling.java index 9434d460cd..19313d3c8d 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRTimelineEventHandling.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/TestMRTimelineEventHandling.java @@ -398,7 +398,7 @@ private void verifyEntity(File entityFile, String eventId, LOG.info("strLine.trim()= " + strLine.trim()); if (checkIdPrefix) { - Assert.assertTrue("Entity ID prefix expected to be > 0" , + Assert.assertTrue("Entity ID prefix expected to be > 0", entity.getIdPrefix() > 0); if (idPrefix == -1) { idPrefix = entity.getIdPrefix(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java index be45ddfd8b..49448217e9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java @@ -2116,7 +2116,7 @@ public static boolean isAclEnabled(Configuration conf) { TIMELINE_SERVICE_PREFIX + "reader.class"; public static final String DEFAULT_TIMELINE_SERVICE_READER_CLASS = - "org.apache.hadoop.yarn.server.timelineservice.storage" + + "org.apache.hadoop.yarn.server.timelineservice.storage" + ".HBaseTimelineReaderImpl"; /** diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java index 47485aefc7..fc270cb79f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java @@ -652,7 +652,7 @@ private void verifyEntityForTimelineV2(File entityFile, String expectedEvent, if (checkIdPrefix) { TimelineEntity entity = FileSystemTimelineReaderImpl. getTimelineRecordFromJSON(entityLine, TimelineEntity.class); - Assert.assertTrue("Entity ID prefix expected to be > 0" , + Assert.assertTrue("Entity ID prefix expected to be > 0", entity.getIdPrefix() > 0); if (idPrefix == -1) { idPrefix = entity.getIdPrefix(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/TimelineV2Client.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/TimelineV2Client.java index da81a91e5a..423c059319 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/TimelineV2Client.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/TimelineV2Client.java @@ -24,7 +24,6 @@ import org.apache.hadoop.service.CompositeService; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.CollectorInfo; -import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity; import org.apache.hadoop.yarn.client.api.impl.TimelineV2ClientImpl; import org.apache.hadoop.yarn.exceptions.YarnException; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml index ae022e4e9c..17d04965dd 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml @@ -3188,7 +3188,7 @@ yarn.timeline-service.http-cross-origin.enabled false - + Flag to enable cross-origin (CORS) support for timeline service v1.x or diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/timeline/security/TimelineAuthenticationFilterInitializer.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/timeline/security/TimelineAuthenticationFilterInitializer.java index 06f9868e4d..3d8ce05895 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/timeline/security/TimelineAuthenticationFilterInitializer.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/timeline/security/TimelineAuthenticationFilterInitializer.java @@ -53,7 +53,8 @@ public class TimelineAuthenticationFilterInitializer extends FilterInitializer { /** * The configuration prefix of timeline HTTP authentication. */ - public static final String PREFIX = "yarn.timeline-service.http-authentication."; + public static final String PREFIX = + "yarn.timeline-service.http-authentication."; @VisibleForTesting Map filterConfig; @@ -104,15 +105,15 @@ protected Map getFilterConfig() { } /** - * Initializes {@link TimelineAuthenticationFilter} + * Initializes {@link TimelineAuthenticationFilter}. *

* Propagates to {@link TimelineAuthenticationFilter} configuration all YARN - * configuration properties prefixed with {@value #PREFIX} + * configuration properties prefixed with {@value #PREFIX}. * * @param container - * The filter container + * The filter container. * @param conf - * Configuration for run-time parameters + * Configuration for run-time parameters. */ @Override public void initFilter(FilterContainer container, Configuration conf) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/timeline/security/TestTimelineAuthenticationFilterInitializer.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/timeline/security/TestTimelineAuthenticationFilterInitializer.java index 430911eaa3..44f63ead34 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/timeline/security/TestTimelineAuthenticationFilterInitializer.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/timeline/security/TestTimelineAuthenticationFilterInitializer.java @@ -27,7 +27,9 @@ import org.junit.Test; import org.mockito.Mockito; - +/** + * Tests {@link TimelineAuthenticationFilterInitializer}. + */ public class TestTimelineAuthenticationFilterInitializer { @Test diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/security/authorize/NMPolicyProvider.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/security/authorize/NMPolicyProvider.java index cc668f7bd4..7b28659131 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/security/authorize/NMPolicyProvider.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/security/authorize/NMPolicyProvider.java @@ -33,21 +33,21 @@ @InterfaceStability.Unstable public class NMPolicyProvider extends PolicyProvider { - private static final Service[] nodeManagerServices = + private static final Service[] NODE_MANAGER_SERVICES = new Service[] { - new Service( - YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_CONTAINER_MANAGEMENT_PROTOCOL, - ContainerManagementProtocolPB.class), - new Service(YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCE_LOCALIZER, - LocalizationProtocolPB.class), - new Service(YarnConfiguration. - YARN_SECURITY_SERVICE_AUTHORIZATION_COLLECTOR_NODEMANAGER_PROTOCOL, + new Service(YarnConfiguration. + YARN_SECURITY_SERVICE_AUTHORIZATION_CONTAINER_MANAGEMENT_PROTOCOL, + ContainerManagementProtocolPB.class), + new Service(YarnConfiguration. + YARN_SECURITY_SERVICE_AUTHORIZATION_RESOURCE_LOCALIZER, + LocalizationProtocolPB.class), + new Service(YarnConfiguration. + YARN_SECURITY_SERVICE_AUTHORIZATION_COLLECTOR_NODEMANAGER_PROTOCOL, CollectorNodemanagerProtocolPB.class) - }; + }; @Override public Service[] getServices() { - return nodeManagerServices; + return NODE_MANAGER_SERVICES; } - } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/apptoflow/AppToFlowColumnPrefix.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/apptoflow/AppToFlowColumnPrefix.java index f1e4495608..752a3803fe 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/apptoflow/AppToFlowColumnPrefix.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/apptoflow/AppToFlowColumnPrefix.java @@ -58,7 +58,7 @@ public enum AppToFlowColumnPrefix implements ColumnPrefix { private final String columnPrefix; private final byte[] columnPrefixBytes; - private AppToFlowColumnPrefix(ColumnFamily columnFamily, + AppToFlowColumnPrefix(ColumnFamily columnFamily, String columnPrefix) { this.columnFamily = columnFamily; this.columnPrefix = columnPrefix; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java index fd858784b5..05570f1f53 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/EntityTypeReader.java @@ -91,9 +91,8 @@ public Set readEntityTypes(Configuration hbaseConf, int counter = 0; while (true) { - try (ResultScanner results - = getResult(hbaseConf, conn, typeFilterList, currRowKey, nextRowKey)) - { + try (ResultScanner results = + getResult(hbaseConf, conn, typeFilterList, currRowKey, nextRowKey)) { TimelineEntity entity = parseEntityForType(results.next()); if (entity == null) { break; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/TimelineReader.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/TimelineReader.java index 1e77155b00..16d623ab46 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/TimelineReader.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/TimelineReader.java @@ -125,7 +125,7 @@ TimelineEntity getEntity(TimelineReaderContext context, *

  • flowRunId - Context flow run id.
  • *
  • appId - Context app id.
  • * - * Although entityIdPrefix and entityId are also part of context, + * Although entityIdPrefix and entityId are also part of context, * it has no meaning for getEntities.
    * Fields in context which are mandatory depends on entity type. Entity * type is always mandatory. In addition to entity type, below is the list @@ -161,7 +161,7 @@ TimelineEntity getEntity(TimelineReaderContext context, * {@link TimelineDataToRetrieve} for details. * @return A set of TimelineEntity instances of the given entity * type in the given context scope which matches the given predicates - * ordered by enitityIdPrefix(for generic entities only). + * ordered by enitityIdPrefix(for generic entities only). * Each entity will only contain * the metadata(id, type , idPrefix and created time) plus the given * fields to retrieve.