本文整理汇总了Java中org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest类的典型用法代码示例。如果您正苦于以下问题:Java LocalResourceRequest类的具体用法?Java LocalResourceRequest怎么用?Java LocalResourceRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LocalResourceRequest类属于org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer包,在下文中一共展示了LocalResourceRequest类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: cleanup
import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest; //导入依赖的package包/类
@SuppressWarnings("unchecked") // dispatcher not typed
public void cleanup() {
Map<LocalResourceVisibility, Collection<LocalResourceRequest>> rsrc =
new HashMap<LocalResourceVisibility,
Collection<LocalResourceRequest>>();
if (!publicRsrcs.isEmpty()) {
rsrc.put(LocalResourceVisibility.PUBLIC, publicRsrcs);
}
if (!privateRsrcs.isEmpty()) {
rsrc.put(LocalResourceVisibility.PRIVATE, privateRsrcs);
}
if (!appRsrcs.isEmpty()) {
rsrc.put(LocalResourceVisibility.APPLICATION, appRsrcs);
}
dispatcher.getEventHandler().handle(
new ContainerLocalizationCleanupEvent(this, rsrc));
}
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:ContainerImpl.java
示例2: matches
import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest; //导入依赖的package包/类
@Override
public boolean matches(Object o) {
if (!(o instanceof ContainerLocalizationCleanupEvent)) {
return false;
}
ContainerLocalizationCleanupEvent evt =
(ContainerLocalizationCleanupEvent) o;
final HashSet<LocalResourceRequest> expected =
new HashSet<LocalResourceRequest>(resources);
for (Collection<LocalResourceRequest> rc : evt.getResources().values()) {
for (LocalResourceRequest rsrc : rc) {
if (!expected.remove(rsrc)) {
return false;
}
}
}
return expected.isEmpty();
}
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestContainer.java
示例3: doLocalizeResources
import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest; //导入依赖的package包/类
public Map<Path, List<String>> doLocalizeResources(
boolean checkLocalizingState, int skipRsrcCount)
throws URISyntaxException {
Path cache = new Path("file:///cache");
Map<Path, List<String>> localPaths =
new HashMap<Path, List<String>>();
int counter = 0;
for (Entry<String, LocalResource> rsrc : localResources.entrySet()) {
if (counter++ < skipRsrcCount) {
continue;
}
if (checkLocalizingState) {
assertEquals(ContainerState.LOCALIZING, c.getContainerState());
}
LocalResourceRequest req = new LocalResourceRequest(rsrc.getValue());
Path p = new Path(cache, rsrc.getKey());
localPaths.put(p, Arrays.asList(rsrc.getKey()));
// rsrc copied to p
c.handle(new ContainerResourceLocalizedEvent(c.getContainerId(),
req, p));
}
drainDispatcherEvents();
return localPaths;
}
开发者ID:naver,项目名称:hadoop,代码行数:25,代码来源:TestContainer.java
示例4: handle
import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest; //导入依赖的package包/类
@Override
public void handle(SharedCacheUploadEvent event) {
if (enabled) {
Map<LocalResourceRequest,Path> resources = event.getResources();
for (Map.Entry<LocalResourceRequest,Path> e: resources.entrySet()) {
SharedCacheUploader uploader =
new SharedCacheUploader(e.getKey(), e.getValue(), event.getUser(),
getConfig(), scmClient, fs, localFs);
// fire off an upload task
uploaderPool.submit(uploader);
}
}
}
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:SharedCacheUploadService.java
示例5: SharedCacheUploadEvent
import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest; //导入依赖的package包/类
public SharedCacheUploadEvent(Map<LocalResourceRequest,Path> resources,
ContainerLaunchContext context, String user,
SharedCacheUploadEventType eventType) {
super(eventType);
this.resources = resources;
this.context = context;
this.user = user;
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:SharedCacheUploadEvent.java
示例6: checkNotEqual
import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest; //导入依赖的package包/类
static void checkNotEqual(LocalResourceRequest a, LocalResourceRequest b) {
assertFalse(a.equals(b));
assertFalse(b.equals(a));
assertFalse(a.hashCode() == b.hashCode());
assertFalse(0 == a.compareTo(b));
assertFalse(0 == b.compareTo(a));
}
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestLocalResource.java
示例7: ResourcesReleasedMatcher
import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest; //导入依赖的package包/类
ResourcesReleasedMatcher(Map<String, LocalResource> allResources,
EnumSet<LocalResourceVisibility> vis) throws URISyntaxException {
for (Entry<String, LocalResource> e : allResources.entrySet()) {
if (vis.contains(e.getValue().getVisibility())) {
resources.add(new LocalResourceRequest(e.getValue()));
}
}
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestContainer.java
注:本文中的org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论