public ApplicationImpl(Dispatcher dispatcher, String user, ApplicationId appId, Credentials credentials, Context context) { this.dispatcher = dispatcher; this.user = user; this.appId = appId; this.credentials = credentials; this.aclsManager = context.getApplicationACLsManager(); this.context = context; ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); readLock = lock.readLock(); writeLock = lock.writeLock(); stateMachine = stateMachineFactory.make(this); }
public ApplicationImpl(Dispatcher dispatcher, String user, ApplicationId appId, Credentials credentials, Context context) { this.dispatcher = dispatcher; this.user = user; this.appId = appId; this.credentials = credentials; this.aclsManager = context.getApplicationACLsManager(); this.context = context; ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); readLock = lock.readLock(); writeLock = lock.writeLock(); stateMachine = stateMachineFactory.make(this); }
public ApplicationImpl(Dispatcher dispatcher, String user, ApplicationId appId, Credentials credentials, Context context, String userFolder) { this.dispatcher = dispatcher; this.user = user; this.userFolder = userFolder; this.appId = appId; this.credentials = credentials; this.aclsManager = context.getApplicationACLsManager(); this.context = context; ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); readLock = lock.readLock(); writeLock = lock.writeLock(); stateMachine = stateMachineFactory.make(this); }
protected Boolean hasAccess(String user, ApplicationId appId, HttpServletRequest hsr) { // Check for the authorization. UserGroupInformation callerUGI = getCallerUserGroupInformation(hsr, true); if (callerUGI != null && !(this.nmContext.getApplicationACLsManager() .checkAccess(callerUGI, ApplicationAccessType.VIEW_APP, user, appId))) { return false; } return true; }
public ApplicationImpl(Dispatcher dispatcher, String user, FlowContext flowContext, ApplicationId appId, Credentials credentials, Context context, long recoveredLogInitedTime) { this.dispatcher = dispatcher; this.user = user; this.appId = appId; this.credentials = credentials; this.aclsManager = context.getApplicationACLsManager(); Configuration conf = context.getConf(); if (YarnConfiguration.timelineServiceV2Enabled(conf)) { if (flowContext == null) { throw new IllegalArgumentException("flow context cannot be null"); } this.flowContext = flowContext; if (YarnConfiguration.systemMetricsPublisherEnabled(conf)) { context.getNMTimelinePublisher().createTimelineClient(appId); } } this.context = context; this.appStateStore = context.getNMStateStore(); ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); readLock = lock.readLock(); writeLock = lock.writeLock(); stateMachine = stateMachineFactory.make(this); setAppLogInitedTimestamp(recoveredLogInitedTime); }
private static void checkAccess(String remoteUser, Application application, Context context) throws YarnException { UserGroupInformation callerUGI = null; if (remoteUser != null) { callerUGI = UserGroupInformation.createRemoteUser(remoteUser); } if (callerUGI != null && !context.getApplicationACLsManager().checkAccess(callerUGI, ApplicationAccessType.VIEW_APP, application.getUser(), application.getAppId())) { throw new YarnException( "User [" + remoteUser + "] is not authorized to view the logs for application " + application.getAppId()); } }
private static void checkAccess(String remoteUser, Application application, Context context) throws YarnException { UserGroupInformation callerUGI = null; if (remoteUser != null) { callerUGI = UserGroupInformation.createRemoteUser(remoteUser); } if (callerUGI != null && !context.getApplicationACLsManager().checkAccess(callerUGI, ApplicationAccessType.VIEW_APP, application.getUser(), application.getAppId())) { throw new YarnException( "User [" + remoteUser + "] is not authorized to view the logs for application " + application.getAppId()); } }
private static void checkAccess(String remoteUser, Application application, Context context) throws YarnException { UserGroupInformation callerUGI = null; if (remoteUser != null) { callerUGI = UserGroupInformation.createRemoteUser(remoteUser); } if (callerUGI != null && !context.getApplicationACLsManager().checkAccess(callerUGI, ApplicationAccessType.VIEW_APP, application.getUser(), application.getAppId())) { throw new YarnException( "User [" + remoteUser + "] is not authorized to view the logs for application " + application.getAppId()); } }
private static void checkAccess(String remoteUser, Application application, Context context) throws YarnException { UserGroupInformation callerUGI = null; if (remoteUser != null) { callerUGI = UserGroupInformation.createRemoteUser(remoteUser); } if (callerUGI != null && !context.getApplicationACLsManager().checkAccess(callerUGI, ApplicationAccessType.VIEW_APP, application.getUser(), application.getAppId())) { throw new YarnException( "User [" + remoteUser + "] is not authorized to view the logs for application " + application.getAppId()); } }