Made fixes for whitespace errors and checstyle warnings before merge.
This commit is contained in:
parent
512068a01f
commit
3d00c8f394
@ -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<TimelineDelegationTokenIdentifier> collectorToken =
|
||||
new Token<TimelineDelegationTokenIdentifier> (ident.getBytes(),
|
||||
new Token<TimelineDelegationTokenIdentifier>(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<TimelineDelegationTokenIdentifier> collectorToken1 =
|
||||
new Token<TimelineDelegationTokenIdentifier> (ident.getBytes(),
|
||||
new Token<TimelineDelegationTokenIdentifier>(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;
|
||||
}
|
||||
|
||||
|
@ -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(); }
|
||||
/**
|
||||
|
@ -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();
|
||||
|
@ -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";
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -3188,7 +3188,7 @@
|
||||
<name>yarn.timeline-service.http-cross-origin.enabled</name>
|
||||
<value>false</value>
|
||||
</property>
|
||||
|
||||
|
||||
<property>
|
||||
<description>
|
||||
Flag to enable cross-origin (CORS) support for timeline service v1.x or
|
||||
|
@ -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<String, String> filterConfig;
|
||||
@ -104,15 +105,15 @@ protected Map<String, String> getFilterConfig() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes {@link TimelineAuthenticationFilter}
|
||||
* Initializes {@link TimelineAuthenticationFilter}.
|
||||
* <p>
|
||||
* 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) {
|
||||
|
@ -27,7 +27,9 @@
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
|
||||
/**
|
||||
* Tests {@link TimelineAuthenticationFilterInitializer}.
|
||||
*/
|
||||
public class TestTimelineAuthenticationFilterInitializer {
|
||||
|
||||
@Test
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public enum AppToFlowColumnPrefix implements ColumnPrefix<AppToFlowTable> {
|
||||
private final String columnPrefix;
|
||||
private final byte[] columnPrefixBytes;
|
||||
|
||||
private AppToFlowColumnPrefix(ColumnFamily<AppToFlowTable> columnFamily,
|
||||
AppToFlowColumnPrefix(ColumnFamily<AppToFlowTable> columnFamily,
|
||||
String columnPrefix) {
|
||||
this.columnFamily = columnFamily;
|
||||
this.columnPrefix = columnPrefix;
|
||||
|
@ -91,9 +91,8 @@ public Set<String> 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;
|
||||
|
@ -125,7 +125,7 @@ TimelineEntity getEntity(TimelineReaderContext context,
|
||||
* <li><b>flowRunId</b> - Context flow run id.</li>
|
||||
* <li><b>appId</b> - Context app id.</li>
|
||||
* </ul>
|
||||
* Although entityIdPrefix and entityId are also part of context,
|
||||
* Although entityIdPrefix and entityId are also part of context,
|
||||
* it has no meaning for getEntities.<br>
|
||||
* 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 <cite>TimelineEntity</cite> 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.
|
||||
|
Loading…
Reference in New Issue
Block a user