• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BatchedListEntries类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries的典型用法代码示例。如果您正苦于以下问题:Java BatchedListEntries类的具体用法?Java BatchedListEntries怎么用?Java BatchedListEntries使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BatchedListEntries类属于org.apache.hadoop.fs.BatchedRemoteIterator包,在下文中一共展示了BatchedListEntries类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: listCacheDirectives

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
BatchedListEntries<CacheDirectiveEntry> listCacheDirectives(
    long startId, CacheDirectiveInfo filter) throws IOException {
  checkOperation(OperationCategory.READ);
  BatchedListEntries<CacheDirectiveEntry> results;
  cacheManager.waitForRescanIfNeeded();
  readLock();
  boolean success = false;
  try {
    checkOperation(OperationCategory.READ);
    results = FSNDNCacheOp.listCacheDirectives(this, cacheManager, startId,
        filter);
    success = true;
  } finally {
    readUnlock();
    logAuditEvent(success, "listCacheDirectives", filter.toString(), null,
        null);
  }
  return results;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:FSNamesystem.java


示例2: listCachePools

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
BatchedListEntries<CachePoolEntry> listCachePools(String prevKey)
    throws IOException {
  BatchedListEntries<CachePoolEntry> results;
  checkOperation(OperationCategory.READ);
  boolean success = false;
  cacheManager.waitForRescanIfNeeded();
  readLock();
  try {
    checkOperation(OperationCategory.READ);
    results = FSNDNCacheOp.listCachePools(this, cacheManager, prevKey);
    success = true;
  } finally {
    readUnlock();
    logAuditEvent(success, "listCachePools", null, null, null);
  }
  return results;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:FSNamesystem.java


示例3: listEncryptionZones

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
BatchedListEntries<EncryptionZone> listEncryptionZones(long prevId)
    throws IOException {
  boolean success = false;
  checkSuperuserPrivilege();
  checkOperation(OperationCategory.READ);
  readLock();
  try {
    checkSuperuserPrivilege();
    checkOperation(OperationCategory.READ);
    final BatchedListEntries<EncryptionZone> ret =
        dir.listEncryptionZones(prevId);
    success = true;
    return ret;
  } finally {
    readUnlock();
    logAuditEvent(success, "listEncryptionZones", null);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:FSNamesystem.java


示例4: listCachePools

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
public BatchedListEntries<CachePoolEntry>
    listCachePools(FSPermissionChecker pc, String prevKey) {
  assert namesystem.hasReadLock();
  final int NUM_PRE_ALLOCATED_ENTRIES = 16;
  ArrayList<CachePoolEntry> results = 
      new ArrayList<CachePoolEntry>(NUM_PRE_ALLOCATED_ENTRIES);
  SortedMap<String, CachePool> tailMap = cachePools.tailMap(prevKey, false);
  int numListed = 0;
  for (Entry<String, CachePool> cur : tailMap.entrySet()) {
    if (numListed++ >= maxListCachePoolsResponses) {
      return new BatchedListEntries<CachePoolEntry>(results, true);
    }
    results.add(cur.getValue().getEntry(pc));
  }
  return new BatchedListEntries<CachePoolEntry>(results, false);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:CacheManager.java


示例5: listEncryptionZones

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
BatchedListEntries<EncryptionZone> listEncryptionZones(long prevId)
    throws IOException {
  boolean success = false;
  checkSuperuserPrivilege();
  checkOperation(OperationCategory.READ);
  readLock();
  try {
    checkSuperuserPrivilege();
    checkOperation(OperationCategory.READ);
    final BatchedListEntries<EncryptionZone> ret =
        FSDirEncryptionZoneOp.listEncryptionZones(dir, prevId);
    success = true;
    return ret;
  } finally {
    readUnlock();
    logAuditEvent(success, "listEncryptionZones", null);
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:19,代码来源:FSNamesystem.java


示例6: listCacheDirectives

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
BatchedListEntries<CacheDirectiveEntry> listCacheDirectives(
    long startId, CacheDirectiveInfo filter) throws IOException {
  checkOperation(OperationCategory.READ);
  final FSPermissionChecker pc = isPermissionEnabled ?
      getPermissionChecker() : null;
  BatchedListEntries<CacheDirectiveEntry> results;
  cacheManager.waitForRescanIfNeeded();
  readLock();
  boolean success = false;
  try {
    checkOperation(OperationCategory.READ);
    results =
        cacheManager.listCacheDirectives(startId, filter, pc);
    success = true;
  } finally {
    readUnlock();
    if (isAuditEnabled() && isExternalInvocation()) {
      logAuditEvent(success, "listCacheDirectives", filter.toString(), null,
          null);
    }
  }
  return results;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:24,代码来源:FSNamesystem.java


示例7: listCachePools

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
public BatchedListEntries<CachePoolEntry> listCachePools(String prevKey)
    throws IOException {
  final FSPermissionChecker pc =
      isPermissionEnabled ? getPermissionChecker() : null;
  BatchedListEntries<CachePoolEntry> results;
  checkOperation(OperationCategory.READ);
  boolean success = false;
  cacheManager.waitForRescanIfNeeded();
  readLock();
  try {
    checkOperation(OperationCategory.READ);
    results = cacheManager.listCachePools(pc, prevKey);
    success = true;
  } finally {
    readUnlock();
    if (isAuditEnabled() && isExternalInvocation()) {
      logAuditEvent(success, "listCachePools", null, null, null);
    }
  }
  return results;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:22,代码来源:FSNamesystem.java


示例8: listCacheDirectives

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
BatchedListEntries<CacheDirectiveEntry> listCacheDirectives(
    long startId, CacheDirectiveInfo filter) throws IOException {
  checkOperation(OperationCategory.READ);
  final FSPermissionChecker pc = isPermissionEnabled ?
      getPermissionChecker() : null;
  BatchedListEntries<CacheDirectiveEntry> results;
  cacheManager.waitForRescanIfNeeded();
  readLock();
  boolean success = false;
  try {
    checkOperation(OperationCategory.READ);
    results =
        cacheManager.listCacheDirectives(startId, filter, pc);
    success = true;
  } finally {
    readUnlock();
    if (isAuditEnabled() && isExternalInvocation()) {
      logAuditEvent(success, "listCacheDirectives", null, null,
          null);
    }
  }
  return results;
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:24,代码来源:FSNamesystem.java


示例9: listEncryptionZones

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
static BatchedListEntries<EncryptionZone> listEncryptionZones(
    final FSDirectory fsd, final long prevId) throws IOException {
  fsd.readLock();
  try {
    return fsd.ezManager.listEncryptionZones(prevId);
  } finally {
    fsd.readUnlock();
  }
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:10,代码来源:FSDirEncryptionZoneOp.java


示例10: listCacheDirectives

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
static BatchedListEntries<CacheDirectiveEntry> listCacheDirectives(
    FSNamesystem fsn, CacheManager cacheManager,
    long startId, CacheDirectiveInfo filter) throws IOException {
  final FSPermissionChecker pc = getFsPermissionChecker(fsn);
  return cacheManager.listCacheDirectives(startId, filter, pc);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:FSNDNCacheOp.java


示例11: listCachePools

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
static BatchedListEntries<CachePoolEntry> listCachePools(
    FSNamesystem fsn, CacheManager cacheManager, String prevKey)
    throws IOException {
  final FSPermissionChecker pc = getFsPermissionChecker(fsn);
  return cacheManager.listCachePools(pc, prevKey);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:FSNDNCacheOp.java


示例12: listCacheDirectives

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
public BatchedListEntries<CacheDirectiveEntry> 
      listCacheDirectives(long prevId,
          CacheDirectiveInfo filter,
          FSPermissionChecker pc) throws IOException {
  assert namesystem.hasReadLock();
  final int NUM_PRE_ALLOCATED_ENTRIES = 16;
  String filterPath = null;
  if (filter.getPath() != null) {
    filterPath = validatePath(filter);
  }
  if (filter.getReplication() != null) {
    throw new InvalidRequestException(
        "Filtering by replication is unsupported.");
  }

  // Querying for a single ID
  final Long id = filter.getId();
  if (id != null) {
    if (!directivesById.containsKey(id)) {
      throw new InvalidRequestException("Did not find requested id " + id);
    }
    // Since we use a tailMap on directivesById, setting prev to id-1 gets
    // us the directive with the id (if present)
    prevId = id - 1;
  }

  ArrayList<CacheDirectiveEntry> replies =
      new ArrayList<CacheDirectiveEntry>(NUM_PRE_ALLOCATED_ENTRIES);
  int numReplies = 0;
  SortedMap<Long, CacheDirective> tailMap =
    directivesById.tailMap(prevId + 1);
  for (Entry<Long, CacheDirective> cur : tailMap.entrySet()) {
    if (numReplies >= maxListCacheDirectivesNumResponses) {
      return new BatchedListEntries<CacheDirectiveEntry>(replies, true);
    }
    CacheDirective curDirective = cur.getValue();
    CacheDirectiveInfo info = cur.getValue().toInfo();

    // If the requested ID is present, it should be the first item.
    // Hitting this case means the ID is not present, or we're on the second
    // item and should break out.
    if (id != null &&
        !(info.getId().equals(id))) {
      break;
    }
    if (filter.getPool() != null && 
        !info.getPool().equals(filter.getPool())) {
      continue;
    }
    if (filterPath != null &&
        !info.getPath().toUri().getPath().equals(filterPath)) {
      continue;
    }
    boolean hasPermission = true;
    if (pc != null) {
      try {
        pc.checkPermission(curDirective.getPool(), FsAction.READ);
      } catch (AccessControlException e) {
        hasPermission = false;
      }
    }
    if (hasPermission) {
      replies.add(new CacheDirectiveEntry(info, cur.getValue().toStats()));
      numReplies++;
    }
  }
  return new BatchedListEntries<CacheDirectiveEntry>(replies, false);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:69,代码来源:CacheManager.java


示例13: listCacheDirectives

import org.apache.hadoop.fs.BatchedRemoteIterator.BatchedListEntries; //导入依赖的package包/类
public BatchedListEntries<CacheDirectiveEntry> 
      listCacheDirectives(long prevId,
          CacheDirectiveInfo filter,
          FSPermissionChecker pc) throws IOException {
  assert namesystem.hasReadLock();
  final int NUM_PRE_ALLOCATED_ENTRIES = 16;
  String filterPath = null;
  if (filter.getId() != null) {
    throw new IOException("Filtering by ID is unsupported.");
  }
  if (filter.getPath() != null) {
    filterPath = validatePath(filter);
  }
  if (filter.getReplication() != null) {
    throw new IOException("Filtering by replication is unsupported.");
  }
  ArrayList<CacheDirectiveEntry> replies =
      new ArrayList<CacheDirectiveEntry>(NUM_PRE_ALLOCATED_ENTRIES);
  int numReplies = 0;
  SortedMap<Long, CacheDirective> tailMap =
    directivesById.tailMap(prevId + 1);
  for (Entry<Long, CacheDirective> cur : tailMap.entrySet()) {
    if (numReplies >= maxListCacheDirectivesNumResponses) {
      return new BatchedListEntries<CacheDirectiveEntry>(replies, true);
    }
    CacheDirective curDirective = cur.getValue();
    CacheDirectiveInfo info = cur.getValue().toInfo();
    if (filter.getPool() != null && 
        !info.getPool().equals(filter.getPool())) {
      continue;
    }
    if (filterPath != null &&
        !info.getPath().toUri().getPath().equals(filterPath)) {
      continue;
    }
    boolean hasPermission = true;
    if (pc != null) {
      try {
        pc.checkPermission(curDirective.getPool(), FsAction.READ);
      } catch (AccessControlException e) {
        hasPermission = false;
      }
    }
    if (hasPermission) {
      replies.add(new CacheDirectiveEntry(info, cur.getValue().toStats()));
      numReplies++;
    }
  }
  return new BatchedListEntries<CacheDirectiveEntry>(replies, false);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:51,代码来源:CacheManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VisualMappingFunctionFactory类代码示例发布时间:2022-05-23
下一篇:
Java AddonArchive类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap