本文整理汇总了Java中org.apache.hadoop.fs.BatchedRemoteIterator类的典型用法代码示例。如果您正苦于以下问题:Java BatchedRemoteIterator类的具体用法?Java BatchedRemoteIterator怎么用?Java BatchedRemoteIterator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BatchedRemoteIterator类属于org.apache.hadoop.fs包,在下文中一共展示了BatchedRemoteIterator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getAllCacheDirectives
import org.apache.hadoop.fs.BatchedRemoteIterator; //导入依赖的package包/类
List<CacheDirectiveEntry> getAllCacheDirectives(UpstreamManager.Upstream upstream) throws IOException {
CacheDirectiveInfo filter = new CacheDirectiveInfo.Builder().build();
List<CacheDirectiveEntry> directives = new ArrayList<>();
long prevId = -1;
while (true) {
BatchedRemoteIterator.BatchedEntries<CacheDirectiveEntry> it =
upstream.protocol.listCacheDirectives(prevId, filter);
if (it.size() == 0) {
break;
}
for (int i = 0; i < it.size(); i++) {
CacheDirectiveEntry entry = it.get(i);
prevId = entry.getInfo().getId();
directives.add(entry);
}
}
return directives;
}
开发者ID:bytedance,项目名称:nnproxy,代码行数:19,代码来源:CacheRegistry.java
示例2: getAllCachePools
import org.apache.hadoop.fs.BatchedRemoteIterator; //导入依赖的package包/类
List<CachePoolEntry> getAllCachePools(UpstreamManager.Upstream upstream) throws IOException {
String prevPool = "";
List<CachePoolEntry> pools = new ArrayList<>();
while (true) {
BatchedRemoteIterator.BatchedEntries<CachePoolEntry> it = upstream.protocol.listCachePools(prevPool);
if (it.size() == 0) {
break;
}
for (int i = 0; i < it.size(); i++) {
CachePoolEntry entry = it.get(i);
prevPool = entry.getInfo().getPoolName();
pools.add(entry);
}
}
return pools;
}
开发者ID:bytedance,项目名称:nnproxy,代码行数:18,代码来源:CacheRegistry.java
示例3: listCachePools
import org.apache.hadoop.fs.BatchedRemoteIterator; //导入依赖的package包/类
public BatchedRemoteIterator.BatchedListEntries<CachePoolEntry> listCachePools(String prevKey) {
final int NUM_PRE_ALLOCATED_ENTRIES = 16;
ArrayList<CachePoolEntry> results =
new ArrayList<CachePoolEntry>(NUM_PRE_ALLOCATED_ENTRIES);
SortedMap<String, CachePoolEntry> tailMap = cachePools.tailMap(prevKey, false);
int numListed = 0;
for (Map.Entry<String, CachePoolEntry> cur : tailMap.entrySet()) {
if (numListed++ >= maxListCachePoolsResponses) {
return new BatchedRemoteIterator.BatchedListEntries<>(results, true);
}
results.add(cur.getValue());
}
return new BatchedRemoteIterator.BatchedListEntries<>(results, false);
}
开发者ID:bytedance,项目名称:nnproxy,代码行数:15,代码来源:CacheRegistry.java
示例4: listCacheDirectives
import org.apache.hadoop.fs.BatchedRemoteIterator; //导入依赖的package包/类
@Override
public BatchedRemoteIterator.BatchedEntries<CacheDirectiveEntry>
listCacheDirectives(long prevId, CacheDirectiveInfo filter)
throws IOException {
try {
AuthorizationProvider.beginClientOp();
return server.listCacheDirectives(prevId, filter);
} finally {
AuthorizationProvider.endClientOp();
}
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:12,代码来源:AuthorizationProviderProxyClientProtocol.java
示例5: listCachePools
import org.apache.hadoop.fs.BatchedRemoteIterator; //导入依赖的package包/类
@Override
public BatchedRemoteIterator.BatchedEntries<CachePoolEntry> listCachePools(
String prevPool) throws IOException {
try {
AuthorizationProvider.beginClientOp();
return server.listCachePools(prevPool);
} finally {
AuthorizationProvider.endClientOp();
}
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:11,代码来源:AuthorizationProviderProxyClientProtocol.java
示例6: listEncryptionZones
import org.apache.hadoop.fs.BatchedRemoteIterator; //导入依赖的package包/类
@Override
public BatchedRemoteIterator.BatchedEntries<EncryptionZone>
listEncryptionZones(long prevId) throws IOException {
try {
AuthorizationProvider.beginClientOp();
return server.listEncryptionZones(prevId);
} finally {
AuthorizationProvider.endClientOp();
}
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:11,代码来源:AuthorizationProviderProxyClientProtocol.java
示例7: listCacheDirectives
import org.apache.hadoop.fs.BatchedRemoteIterator; //导入依赖的package包/类
public BatchedRemoteIterator.BatchedListEntries<CacheDirectiveEntry> listCacheDirectives(long prevId,
CacheDirectiveInfo filter) throws InvalidRequestException {
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, CacheDirectiveEntry> tailMap =
directivesById.tailMap(prevId + 1);
for (Map.Entry<Long, CacheDirectiveEntry> cur : tailMap.entrySet()) {
if (numReplies >= maxListCacheDirectivesNumResponses) {
return new BatchedRemoteIterator.BatchedListEntries<>(replies, true);
}
CacheDirectiveInfo info = cur.getValue().getInfo();
// 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;
}
replies.add(cur.getValue());
numReplies++;
}
return new BatchedRemoteIterator.BatchedListEntries<>(replies, false);
}
开发者ID:bytedance,项目名称:nnproxy,代码行数:55,代码来源:CacheRegistry.java
注:本文中的org.apache.hadoop.fs.BatchedRemoteIterator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论