当前位置: 首页>>代码示例>>Java>>正文


Java QueueUserACLInfo类代码示例

本文整理汇总了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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:LeafQueue.java

示例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()]);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TypeConverter.java

示例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;
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:20,代码来源:FSParentQueue.java

示例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);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:17,代码来源:FSLeafQueue.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:GetQueueUserAclsInfoResponsePBImpl.java

示例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));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:GetQueueUserAclsInfoResponsePBImpl.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:34,代码来源:GetQueueUserAclsInfoResponsePBImpl.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:FifoScheduler.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:FSLeafQueue.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:FairScheduler.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:FSParentQueue.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:FSParentQueue.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:ParentQueue.java

示例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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:CapacityScheduler.java

示例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);
  }

}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestCapacityScheduler.java


注:本文中的org.apache.hadoop.yarn.api.records.QueueUserACLInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。