本文整理汇总了Java中org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest类的典型用法代码示例。如果您正苦于以下问题:Java ResourceBlacklistRequest类的具体用法?Java ResourceBlacklistRequest怎么用?Java ResourceBlacklistRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceBlacklistRequest类属于org.apache.hadoop.yarn.api.records包,在下文中一共展示了ResourceBlacklistRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: newInstance
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Public
@Stable
public static AllocateRequest newInstance(int responseID, float appProgress,
List<ResourceRequest> resourceAsk,
List<ContainerId> containersToBeReleased,
ResourceBlacklistRequest resourceBlacklistRequest,
List<ContainerResourceIncreaseRequest> increaseRequests) {
AllocateRequest allocateRequest = Records.newRecord(AllocateRequest.class);
allocateRequest.setResponseId(responseID);
allocateRequest.setProgress(appProgress);
allocateRequest.setAskList(resourceAsk);
allocateRequest.setReleaseList(containersToBeReleased);
allocateRequest.setResourceBlacklistRequest(resourceBlacklistRequest);
allocateRequest.setIncreaseRequests(increaseRequests);
return allocateRequest;
}
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:AllocateRequest.java
示例2: newInstance
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Public
@Stable
public static AllocateRequest newInstance(int responseID, float appProgress,
List<ResourceRequest> resourceAsk,
List<ContainerId> containersToBeReleased,
ResourceBlacklistRequest resourceBlacklistRequest,
List<ContainerResourceChangeRequest> increaseRequests,
List<ContainerResourceChangeRequest> decreaseRequests) {
AllocateRequest allocateRequest = Records.newRecord(AllocateRequest.class);
allocateRequest.setResponseId(responseID);
allocateRequest.setProgress(appProgress);
allocateRequest.setAskList(resourceAsk);
allocateRequest.setReleaseList(containersToBeReleased);
allocateRequest.setResourceBlacklistRequest(resourceBlacklistRequest);
allocateRequest.setIncreaseRequests(increaseRequests);
allocateRequest.setDecreaseRequests(decreaseRequests);
return allocateRequest;
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:19,代码来源:AllocateRequest.java
示例3: getBlacklistUpdates
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Override
public ResourceBlacklistRequest getBlacklistUpdates() {
ResourceBlacklistRequest ret;
List<String> blacklist = new ArrayList<>(blacklistNodes);
final int currentBlacklistSize = blacklist.size();
final double failureThreshold = this.blacklistDisableFailureThreshold *
numberOfNodeManagerHosts;
if (currentBlacklistSize < failureThreshold) {
if (LOG.isDebugEnabled()) {
LOG.debug("blacklist size " + currentBlacklistSize + " is less than " +
"failure threshold ratio " + blacklistDisableFailureThreshold +
" out of total usable nodes " + numberOfNodeManagerHosts);
}
ret = ResourceBlacklistRequest.newInstance(blacklist, EMPTY_LIST);
} else {
LOG.warn("Ignoring Blacklists, blacklist size " + currentBlacklistSize
+ " is more than failure threshold ratio "
+ blacklistDisableFailureThreshold + " out of total usable nodes "
+ numberOfNodeManagerHosts);
// TODO: After the threshold hits, we will keep sending a long list
// every time a new AM is to be scheduled.
ret = ResourceBlacklistRequest.newInstance(EMPTY_LIST, blacklist);
}
return ret;
}
开发者ID:hopshadoop,项目名称:hops,代码行数:26,代码来源:SimpleBlacklistManager.java
示例4: testSimpleBlacklistBelowFailureThreshold
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Test
public void testSimpleBlacklistBelowFailureThreshold() {
final int numberOfNodeManagerHosts = 3;
final double blacklistDisableFailureThreshold = 0.8;
BlacklistManager manager = new SimpleBlacklistManager(
numberOfNodeManagerHosts, blacklistDisableFailureThreshold);
String anyNode = "foo";
String anyNode2 = "bar";
manager.addNode(anyNode);
manager.addNode(anyNode2);
ResourceBlacklistRequest blacklist = manager
.getBlacklistUpdates();
List<String> blacklistAdditions = blacklist.getBlacklistAdditions();
Collections.sort(blacklistAdditions);
List<String> blacklistRemovals = blacklist.getBlacklistRemovals();
String[] expectedBlacklistAdditions = new String[]{anyNode2, anyNode};
Assert.assertArrayEquals(
"Blacklist additions was not as expected",
expectedBlacklistAdditions,
blacklistAdditions.toArray());
Assert.assertTrue(
"Blacklist removals should be empty but was " +
blacklistRemovals,
blacklistRemovals.isEmpty());
}
开发者ID:hopshadoop,项目名称:hops,代码行数:27,代码来源:TestBlacklistManager.java
示例5: testDisabledBlacklist
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Test
public void testDisabledBlacklist() {
BlacklistManager disabled = new DisabledBlacklistManager();
String anyNode = "foo";
disabled.addNode(anyNode);
ResourceBlacklistRequest blacklist = disabled
.getBlacklistUpdates();
List<String> blacklistAdditions = blacklist.getBlacklistAdditions();
List<String> blacklistRemovals = blacklist.getBlacklistRemovals();
Assert.assertTrue(
"Blacklist additions should be empty but was " +
blacklistAdditions,
blacklistAdditions.isEmpty());
Assert.assertTrue(
"Blacklist removals should be empty but was " +
blacklistRemovals,
blacklistRemovals.isEmpty());
}
开发者ID:hopshadoop,项目名称:hops,代码行数:20,代码来源:TestBlacklistManager.java
示例6: testAllocateOnHA
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Test(timeout = 15000)
public void testAllocateOnHA() throws YarnException, IOException, InterruptedException {
AllocateRequest request = AllocateRequest.newInstance(0, 50f,
new ArrayList<ResourceRequest>(),
new ArrayList<ContainerId>(),
ResourceBlacklistRequest.newInstance(new ArrayList<String>(),
new ArrayList<String>()));
int nbTry = 0;
AllocateResponse response = null;
while (nbTry < 10) {
try {
response = amClient.allocate(request);
break;
} catch (IOException ex) {
if (!(ex instanceof SecretManager.InvalidToken)) {
throw ex;
}
}
Thread.sleep(200);
nbTry++;
}
Assert.assertEquals(response, this.cluster.createFakeAllocateResponse());
}
开发者ID:hopshadoop,项目名称:hops,代码行数:24,代码来源:TestApplicationMasterServiceProtocolOnHA.java
示例7: newInstance
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
/**
* Use {@link AllocateRequest#newInstance(int, float, List, List,
* ResourceBlacklistRequest, List)} instead
* @param responseID responseId
* @param appProgress appProgress
* @param resourceAsk resourceAsk
* @param containersToBeReleased containersToBeReleased
* @param resourceBlacklistRequest resourceBlacklistRequest
* @param increaseRequests increaseRequests
* @return AllocateRequest
*/
@Deprecated
public static AllocateRequest newInstance(int responseID, float appProgress,
List<ResourceRequest> resourceAsk,
List<ContainerId> containersToBeReleased,
ResourceBlacklistRequest resourceBlacklistRequest,
List<ContainerResourceIncreaseRequest> increaseRequests) {
AllocateRequest allocateRequest = Records.newRecord(AllocateRequest.class);
allocateRequest.setResponseId(responseID);
allocateRequest.setProgress(appProgress);
allocateRequest.setAskList(resourceAsk);
allocateRequest.setReleaseList(containersToBeReleased);
allocateRequest.setResourceBlacklistRequest(resourceBlacklistRequest);
allocateRequest.setIncreaseRequests(increaseRequests);
return allocateRequest;
}
开发者ID:hopshadoop,项目名称:hops,代码行数:27,代码来源:AllocateRequest.java
示例8: getResourceBlacklistRequest
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Override
public ResourceBlacklistRequest getResourceBlacklistRequest() {
AllocateRequestProtoOrBuilder p = viaProto ? proto : builder;
if (this.blacklistRequest != null) {
return this.blacklistRequest;
}
if (!p.hasBlacklistRequest()) {
return null;
}
this.blacklistRequest = convertFromProtoFormat(p.getBlacklistRequest());
return this.blacklistRequest;
}
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:AllocateRequestPBImpl.java
示例9: setResourceBlacklistRequest
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Override
public void setResourceBlacklistRequest(ResourceBlacklistRequest blacklistRequest) {
maybeInitBuilder();
if (blacklistRequest == null) {
builder.clearBlacklistRequest();
}
this.blacklistRequest = blacklistRequest;
}
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:AllocateRequestPBImpl.java
示例10: validateBlacklistRequest
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
public static void validateBlacklistRequest(
ResourceBlacklistRequest blacklistRequest)
throws InvalidResourceBlacklistRequestException {
if (blacklistRequest != null) {
List<String> plus = blacklistRequest.getBlacklistAdditions();
if (plus != null && plus.contains(ResourceRequest.ANY)) {
throw new InvalidResourceBlacklistRequestException(
"Cannot add " + ResourceRequest.ANY + " to the blacklist!");
}
}
}
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:RMServerUtils.java
示例11: testAllocateOnHA
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Test(timeout = 15000)
public void testAllocateOnHA() throws YarnException, IOException {
AllocateRequest request = AllocateRequest.newInstance(0, 50f,
new ArrayList<ResourceRequest>(),
new ArrayList<ContainerId>(),
ResourceBlacklistRequest.newInstance(new ArrayList<String>(),
new ArrayList<String>()));
AllocateResponse response = amClient.allocate(request);
Assert.assertEquals(response, this.cluster.createFakeAllocateResponse());
}
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:TestApplicationMasterServiceProtocolOnHA.java
示例12: makeRemoteRequest
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
protected AllocateResponse makeRemoteRequest() throws YarnException,
IOException {
ResourceBlacklistRequest blacklistRequest =
ResourceBlacklistRequest.newInstance(new ArrayList<String>(blacklistAdditions),
new ArrayList<String>(blacklistRemovals));
AllocateRequest allocateRequest =
AllocateRequest.newInstance(lastResponseID,
super.getApplicationProgress(), new ArrayList<ResourceRequest>(ask),
new ArrayList<ContainerId>(release), blacklistRequest);
AllocateResponse allocateResponse = scheduler.allocate(allocateRequest);
lastResponseID = allocateResponse.getResponseId();
availableResources = allocateResponse.getAvailableResources();
lastClusterNmCount = clusterNmCount;
clusterNmCount = allocateResponse.getNumClusterNodes();
if (ask.size() > 0 || release.size() > 0) {
LOG.info("getResources() for " + applicationId + ":" + " ask="
+ ask.size() + " release= " + release.size() + " newContainers="
+ allocateResponse.getAllocatedContainers().size()
+ " finishedContainers="
+ allocateResponse.getCompletedContainersStatuses().size()
+ " resourcelimit=" + availableResources + " knownNMs="
+ clusterNmCount);
}
ask.clear();
release.clear();
if (blacklistAdditions.size() > 0 || blacklistRemovals.size() > 0) {
LOG.info("Update the blacklist for " + applicationId +
": blacklistAdditions=" + blacklistAdditions.size() +
" blacklistRemovals=" + blacklistRemovals.size());
}
blacklistAdditions.clear();
blacklistRemovals.clear();
return allocateResponse;
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:38,代码来源:RMContainerRequestor.java
示例13: validateBlacklistRequest
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
public static void validateBlacklistRequest(ResourceBlacklistRequest blacklistRequest)
throws InvalidResourceBlacklistRequestException {
if (blacklistRequest != null) {
List<String> plus = blacklistRequest.getBlacklistAdditions();
if (plus != null && plus.contains(ResourceRequest.ANY)) {
throw new InvalidResourceBlacklistRequestException(
"Cannot add " + ResourceRequest.ANY + " to the blacklist!");
}
}
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:11,代码来源:SchedulerUtils.java
示例14: newInstance
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
@Public
@Stable
public static AllocateRequest newInstance(int responseID, float appProgress,
List<ResourceRequest> resourceAsk,
List<ContainerId> containersToBeReleased,
ResourceBlacklistRequest resourceBlacklistRequest) {
AllocateRequest allocateRequest = Records.newRecord(AllocateRequest.class);
allocateRequest.setResponseId(responseID);
allocateRequest.setProgress(appProgress);
allocateRequest.setAskList(resourceAsk);
allocateRequest.setReleaseList(containersToBeReleased);
allocateRequest.setResourceBlacklistRequest(resourceBlacklistRequest);
return allocateRequest;
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:15,代码来源:AllocateRequest.java
示例15: createAllocateRequest
import org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest; //导入依赖的package包/类
private AllocateRequest createAllocateRequest(List<NodeReport> listNode) {
// The test needs AMRMClient to create a real allocate request
AMRMClientImpl<ContainerRequest> amClient =
new AMRMClientImpl<ContainerRequest>();
Resource capability = Resource.newInstance(1024, 2);
Priority priority = Priority.newInstance(1);
List<NodeReport> nodeReports = listNode;
String node = nodeReports.get(0).getNodeId().getHost();
String[] nodes = new String[] { node };
ContainerRequest storedContainer1 =
new ContainerRequest(capability, nodes, null, priority);
amClient.addContainerRequest(storedContainer1);
amClient.addContainerRequest(storedContainer1);
List<ResourceRequest> resourceAsk = new ArrayList<ResourceRequest>();
for (ResourceRequest rr : amClient.ask) {
resourceAsk.add(rr);
}
ResourceBlacklistRequest resourceBlacklistRequest = ResourceBlacklistRequest
.newInstance(new ArrayList<String>(), new ArrayList<String>());
int responseId = 1;
return AllocateRequest.newInstance(responseId, 0, resourceAsk,
new ArrayList<ContainerId>(), resourceBlacklistRequest);
}
开发者ID:hopshadoop,项目名称:hops,代码行数:30,代码来源:TestAMRMProxy.java
注:本文中的org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论