本文整理汇总了Java中org.apache.hadoop.yarn.api.records.QueueUserACLInfo类的典型用法代码示例。如果您正苦于以下问题:Java QueueUserACLInfo类的具体用法?Java QueueUserACLInfo怎么用?Java QueueUserACLInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
QueueUserACLInfo类属于org.apache.hadoop.yarn.api.records包,在下文中一共展示了QueueUserACLInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public synchronized List<QueueUserACLInfo>
getQueueUserAclInfo(UserGroupInformation user) {
QueueUserACLInfo userAclInfo =
recordFactory.newRecordInstance(QueueUserACLInfo.class);
List<QueueACL> operations = new ArrayList<QueueACL>();
for (QueueACL operation : QueueACL.values()) {
if (hasAccess(operation, user)) {
operations.add(operation);
}
}
userAclInfo.setQueueName(getQueueName());
userAclInfo.setUserAcls(operations);
return Collections.singletonList(userAclInfo);
}
示例2: fromYarnQueueUserAclsInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
public static QueueAclsInfo[] fromYarnQueueUserAclsInfo(
List<QueueUserACLInfo> userAcls) {
List<QueueAclsInfo> acls = new ArrayList<QueueAclsInfo>();
for (QueueUserACLInfo aclInfo : userAcls) {
List<String> operations = new ArrayList<String>();
for (QueueACL qAcl : aclInfo.getUserAcls()) {
operations.add(qAcl.toString());
}
QueueAclsInfo acl =
new QueueAclsInfo(aclInfo.getQueueName(),
operations.toArray(new String[operations.size()]));
acls.add(acl);
}
return acls.toArray(new QueueAclsInfo[acls.size()]);
}
示例3: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user) {
List<QueueUserACLInfo> userAcls = new ArrayList<QueueUserACLInfo>();
// Add queue acls
userAcls.add(getUserAclInfo(user));
// Add children queue acls
readLock.lock();
try {
for (FSQueue child : childQueues) {
userAcls.addAll(child.getQueueUserAclInfo(user));
}
} finally {
readLock.unlock();
}
return userAcls;
}
示例4: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user) {
QueueUserACLInfo userAclInfo =
recordFactory.newRecordInstance(QueueUserACLInfo.class);
List<QueueACL> operations = new ArrayList<QueueACL>();
for (QueueACL operation : QueueACL.values()) {
Map<QueueACL, AccessControlList> acls = queueMgr.getQueueAcls(getName());
if (acls.get(operation).isUserAllowed(user)) {
operations.add(operation);
}
}
userAclInfo.setQueueName(getQueueName());
userAclInfo.setUserAcls(operations);
return Collections.singletonList(userAclInfo);
}
示例5: setUserAclsInfoList
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public void setUserAclsInfoList(List<QueueUserACLInfo> queueUserAclsList) {
if (queueUserAclsList == null) {
builder.clearQueueUserAcls();
}
this.queueUserAclsInfoList = queueUserAclsList;
}
示例6: initLocalQueueUserAclsList
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
private void initLocalQueueUserAclsList() {
if (this.queueUserAclsInfoList != null) {
return;
}
GetQueueUserAclsInfoResponseProtoOrBuilder p = viaProto ? proto : builder;
List<QueueUserACLInfoProto> list = p.getQueueUserAclsList();
queueUserAclsInfoList = new ArrayList<QueueUserACLInfo>();
for (QueueUserACLInfoProto a : list) {
queueUserAclsInfoList.add(convertFromProtoFormat(a));
}
}
示例7: addLocalQueueUserACLInfosToProto
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
private void addLocalQueueUserACLInfosToProto() {
maybeInitBuilder();
builder.clearQueueUserAcls();
if (queueUserAclsInfoList == null)
return;
Iterable<QueueUserACLInfoProto> iterable = new Iterable<QueueUserACLInfoProto>() {
@Override
public Iterator<QueueUserACLInfoProto> iterator() {
return new Iterator<QueueUserACLInfoProto>() {
Iterator<QueueUserACLInfo> iter = queueUserAclsInfoList.iterator();
@Override
public boolean hasNext() {
return iter.hasNext();
}
@Override
public QueueUserACLInfoProto next() {
return convertToProtoFormat(iter.next());
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
builder.addAllQueueUserAcls(iterable);
}
示例8: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public List<QueueUserACLInfo> getQueueUserAclInfo(
UserGroupInformation unused) {
QueueUserACLInfo queueUserAclInfo =
recordFactory.newRecordInstance(QueueUserACLInfo.class);
queueUserAclInfo.setQueueName(DEFAULT_QUEUE_NAME);
queueUserAclInfo.setUserAcls(Arrays.asList(QueueACL.values()));
return Collections.singletonList(queueUserAclInfo);
}
示例9: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public List<QueueUserACLInfo> getQueueUserAclInfo(UserGroupInformation user) {
QueueUserACLInfo userAclInfo =
recordFactory.newRecordInstance(QueueUserACLInfo.class);
List<QueueACL> operations = new ArrayList<QueueACL>();
for (QueueACL operation : QueueACL.values()) {
if (hasAccess(operation, user)) {
operations.add(operation);
}
}
userAclInfo.setQueueName(getQueueName());
userAclInfo.setUserAcls(operations);
return Collections.singletonList(userAclInfo);
}
示例10: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public List<QueueUserACLInfo> getQueueUserAclInfo() {
UserGroupInformation user;
try {
user = UserGroupInformation.getCurrentUser();
} catch (IOException ioe) {
return new ArrayList<QueueUserACLInfo>();
}
return queueMgr.getRootQueue().getQueueUserAclInfo(user);
}
示例11: getUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
private synchronized QueueUserACLInfo getUserAclInfo(
UserGroupInformation user) {
QueueUserACLInfo userAclInfo =
recordFactory.newRecordInstance(QueueUserACLInfo.class);
List<QueueACL> operations = new ArrayList<QueueACL>();
for (QueueACL operation : QueueACL.values()) {
if (hasAccess(operation, user)) {
operations.add(operation);
}
}
userAclInfo.setQueueName(getQueueName());
userAclInfo.setUserAcls(operations);
return userAclInfo;
}
示例12: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public synchronized List<QueueUserACLInfo> getQueueUserAclInfo(
UserGroupInformation user) {
List<QueueUserACLInfo> userAcls = new ArrayList<QueueUserACLInfo>();
// Add queue acls
userAcls.add(getUserAclInfo(user));
// Add children queue acls
for (FSQueue child : childQueues) {
userAcls.addAll(child.getQueueUserAclInfo(user));
}
return userAcls;
}
示例13: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
public synchronized List<QueueUserACLInfo> getQueueUserAclInfo(
UserGroupInformation user) {
List<QueueUserACLInfo> userAcls = new ArrayList<QueueUserACLInfo>();
// Add parent queue acls
userAcls.add(getUserAclInfo(user));
// Add children queue acls
for (CSQueue child : childQueues) {
userAcls.addAll(child.getQueueUserAclInfo(user));
}
return userAcls;
}
示例14: getQueueUserAclInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Override
@Lock(Lock.NoLock.class)
public List<QueueUserACLInfo> getQueueUserAclInfo() {
UserGroupInformation user = null;
try {
user = UserGroupInformation.getCurrentUser();
} catch (IOException ioe) {
// should never happen
return new ArrayList<QueueUserACLInfo>();
}
return root.getQueueUserAclInfo(user);
}
示例15: testCapacitySchedulerInfo
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; //导入依赖的package包/类
@Test
public void testCapacitySchedulerInfo() throws Exception {
QueueInfo queueInfo = resourceManager.getResourceScheduler().getQueueInfo("a", true, true);
Assert.assertEquals(queueInfo.getQueueName(), "a");
Assert.assertEquals(queueInfo.getChildQueues().size(), 2);
List<QueueUserACLInfo> userACLInfo = resourceManager.getResourceScheduler().getQueueUserAclInfo();
Assert.assertNotNull(userACLInfo);
for (QueueUserACLInfo queueUserACLInfo : userACLInfo) {
Assert.assertEquals(getQueueCount(userACLInfo, queueUserACLInfo.getQueueName()), 1);
}
}