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 19 package org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event; 20 21 import java.util.Map; 22 23 import org.apache.hadoop.security.Credentials; 24 import org.apache.hadoop.yarn.api.records.ApplicationId; 25 import org.apache.hadoop.yarn.api.records.ApplicationAccessType; 26 import org.apache.hadoop.yarn.api.records.LogAggregationContext; 27 import org.apache.hadoop.yarn.logaggregation.ContainerLogsRetentionPolicy; 28 29 public class LogHandlerAppStartedEvent extends LogHandlerEvent { 30 31 private final ApplicationId applicationId; 32 private final ContainerLogsRetentionPolicy retentionPolicy; 33 private final String user; 34 private final Credentials credentials; 35 private final Map<ApplicationAccessType, String> appAcls; 36 private final LogAggregationContext logAggregationContext; 37 LogHandlerAppStartedEvent(ApplicationId appId, String user, Credentials credentials, ContainerLogsRetentionPolicy retentionPolicy, Map<ApplicationAccessType, String> appAcls)38 public LogHandlerAppStartedEvent(ApplicationId appId, String user, 39 Credentials credentials, ContainerLogsRetentionPolicy retentionPolicy, 40 Map<ApplicationAccessType, String> appAcls) { 41 this(appId, user, credentials, retentionPolicy, appAcls, null); 42 } 43 LogHandlerAppStartedEvent(ApplicationId appId, String user, Credentials credentials, ContainerLogsRetentionPolicy retentionPolicy, Map<ApplicationAccessType, String> appAcls, LogAggregationContext logAggregationContext)44 public LogHandlerAppStartedEvent(ApplicationId appId, String user, 45 Credentials credentials, ContainerLogsRetentionPolicy retentionPolicy, 46 Map<ApplicationAccessType, String> appAcls, 47 LogAggregationContext logAggregationContext) { 48 super(LogHandlerEventType.APPLICATION_STARTED); 49 this.applicationId = appId; 50 this.user = user; 51 this.credentials = credentials; 52 this.retentionPolicy = retentionPolicy; 53 this.appAcls = appAcls; 54 this.logAggregationContext = logAggregationContext; 55 } 56 getApplicationId()57 public ApplicationId getApplicationId() { 58 return this.applicationId; 59 } 60 getCredentials()61 public Credentials getCredentials() { 62 return this.credentials; 63 } 64 getLogRetentionPolicy()65 public ContainerLogsRetentionPolicy getLogRetentionPolicy() { 66 return this.retentionPolicy; 67 } 68 getUser()69 public String getUser() { 70 return this.user; 71 } 72 getApplicationAcls()73 public Map<ApplicationAccessType, String> getApplicationAcls() { 74 return this.appAcls; 75 } 76 getLogAggregationContext()77 public LogAggregationContext getLogAggregationContext() { 78 return this.logAggregationContext; 79 } 80 } 81