private void displayQueueAclsInfoForCurrentUser() throws IOException { QueueAclsInfo[] queueAclsInfoList = jc.getQueueAclsForCurrentUser(); UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); if (queueAclsInfoList.length > 0) { System.out.println("Queue acls for user : " + ugi.getShortUserName()); System.out.println("\nQueue Operations"); System.out.println("====================="); for (QueueAclsInfo queueInfo : queueAclsInfoList) { System.out.print(queueInfo.getQueueName() + " "); String[] ops = queueInfo.getOperations(); Arrays.sort(ops); int max = ops.length - 1; for (int j = 0; j < ops.length; j++) { System.out.print(ops[j].replaceFirst("acl-", "")); if (j < max) { System.out.print(","); } } System.out.println(); } } else { System.out.println("User " + ugi.getShortUserName() + " does not have access to any queue. \n"); } }
private void displayQueueAclsInfoForCurrentUser() throws IOException { QueueAclsInfo[] queueAclsInfoList = jc.getQueueAclsForCurrentUser(); UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); if (queueAclsInfoList.length > 0) { System.out.println("Queue acls for user : " + ugi.getShortUserName()); System.out.println("\nQueue Operations"); System.out.println("====================="); for (QueueAclsInfo queueInfo : queueAclsInfoList) { System.out.print(queueInfo.getQueueName() + " "); String[] ops = queueInfo.getOperations(); Arrays.sort(ops); int max = ops.length - 1; for (int j = 0; j < ops.length; j++) { System.out.print(ops[j].replaceFirst("acl-", "")); if (j < max) { System.out.print(","); } } System.out.println(); } } else { System.out.println("User " + ugi.getShortUserName() + " does not have access to any queue. \n"); } }
private void displayQueueAclsInfoForCurrentUser() throws IOException { QueueAclsInfo[] queueAclsInfoList = jc.getQueueAclsForCurrentUser(); UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); if (queueAclsInfoList.length > 0) { System.out.println("Queue acls for user : " + ugi.getShortUserName()); System.out.println("\nQueue Operations"); System.out.println("====================="); for (QueueAclsInfo queueInfo : queueAclsInfoList) { System.out.print(queueInfo.getQueueName() + " "); String[] ops = queueInfo.getOperations(); int max = ops.length - 1; for (int j = 0; j < ops.length; j++) { System.out.print(ops[j].replaceFirst("acl-", "")); if (j < max) { System.out.print(","); } } System.out.println(); } } else { System.out.println("User " + ugi.getShortUserName() + " does not have access to any queue. \n"); } }
private void displayQueueAclsInfoForCurrentUser() throws IOException { QueueAclsInfo[] queueAclsInfoList = jc.getQueueAclsForCurrentUser(); UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); if (queueAclsInfoList.length > 0) { System.out.println("Queue acls for user : " + ugi.getShortUserName()); System.out.println("\nQueue Operations"); System.out.println("====================="); for (QueueAclsInfo queueInfo : queueAclsInfoList) { System.out.print(queueInfo.getQueueName() + " "); String[] ops = queueInfo.getOperations(); Arrays.sort(ops); int max = ops.length - 1; for (int j = 0; j < ops.length; j++) { System.out.print(ops[j].replaceFirst("acl-", "")); if (j < max) { System.out.print(","); } } System.out.println(); } } else { System.out.println("User " + ugi.getShortUserName() + " does not have access to any queue. \n"); } }
private void displayQueueAclsInfoForCurrentUser() throws IOException { QueueAclsInfo[] queueAclsInfoList = jc.getQueueAclsForCurrentUser(); UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); if (queueAclsInfoList.length > 0) { System.out.println("Queue acls for user : " + ugi.getShortUserName()); System.out.println("\nQueue Operations"); System.out.println("====================="); for (QueueAclsInfo queueInfo : queueAclsInfoList) { System.out.print(queueInfo.getQueueName() + " "); String[] ops = queueInfo.getOperations(); Arrays.sort(ops); int max = ops.length - 1; for (int j = 0; j < ops.length; j++) { System.out.print(ops[j].replaceFirst("acl-", "")); if (j < max) { System.out.print(","); } } System.out.println(); } } else { System.out.println("User " + ugi.getShortUserName() + " does not have access to any queue. \n"); } }
private void displayQueueAclsInfoForCurrentUser() throws IOException { QueueAclsInfo[] queueAclsInfoList = jc.getQueueAclsForCurrentUser(); UserGroupInformation ugi = UserGroupInformation.readFrom(getConf()); if (queueAclsInfoList.length > 0) { System.out.println("Queue acls for user : " + ugi.getUserName()); System.out.println("\nQueue Operations"); System.out.println("====================="); for (QueueAclsInfo queueInfo : queueAclsInfoList) { System.out.print(queueInfo.getQueueName() + " "); String[] ops = queueInfo.getOperations(); int max = ops.length - 1; for (int j = 0; j < ops.length; j++) { System.out.print(ops[j].replaceFirst("acl-", "")); if (j < max) { System.out.print(","); } } System.out.println(); } } else { System.out.println("User " + ugi.getUserName() + " does not have access to any queue. \n"); } }
/** * Submit job for the current configuration provided by this implementation. * * @return RunningJob implementation */ @Override public RunningJob submit() throws IOException, ClassNotFoundException, InterruptedException { JobClient jobClient = createJobClient(); if ( YarnQueueAclsVerifier.verify( jobClient.getQueueAclsForCurrentUser() ) ) { return new RunningJobProxy( jobClient.submitJob( this ) ); } else { throw new YarnQueueAclsException( BaseMessages.getString( ConfigurationProxy.class, "ConfigurationProxy.UserHasNoPermissions", UserGroupInformation.getCurrentUser().getUserName() ) ); } }
assertEquals(qi.getQueueState(), "running"); QueueAclsInfo[] aai = client.getQueueAclsForCurrentUser(); assertEquals(aai.length, 2); assertEquals(aai[0].getQueueName(), "root");