本文整理汇总了Java中org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes类的典型用法代码示例。如果您正苦于以下问题:Java SchedulerResourceTypes类的具体用法?Java SchedulerResourceTypes怎么用?Java SchedulerResourceTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SchedulerResourceTypes类属于org.apache.hadoop.yarn.proto.YarnServiceProtos包,在下文中一共展示了SchedulerResourceTypes类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: start
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
@Override
public void start() throws Exception {
super.start();
client.start();
if (shouldReuseContainers) {
reuseExecutor = createExecutor();
}
TaskSchedulerContext ctx = getContext();
RegisterApplicationMasterResponse response = client.registerApplicationMaster(
ctx.getAppHostName(), ctx.getAppClientPort(), ctx.getAppTrackingUrl());
ctx.setApplicationRegistrationData(response.getMaximumResourceCapability(),
response.getApplicationACLs(), response.getClientToAMTokenMasterKey(),
response.getQueue());
if (response.getSchedulerResourceTypes().contains(SchedulerResourceTypes.CPU)) {
resourceCalculator = new MemCpuResourceCalculator();
} else {
resourceCalculator = new MemResourceCalculator();
}
}
开发者ID:apache,项目名称:tez,代码行数:20,代码来源:DagAwareYarnTaskScheduler.java
示例2: initSchedulerResourceTypes
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
private void initSchedulerResourceTypes() {
if (this.schedulerResourceTypes != null) {
return;
}
RegisterApplicationMasterResponseProtoOrBuilder p =
viaProto ? proto : builder;
List<SchedulerResourceTypes> list = p.getSchedulerResourceTypesList();
if (list.isEmpty()) {
this.schedulerResourceTypes =
EnumSet.noneOf(SchedulerResourceTypes.class);
} else {
this.schedulerResourceTypes = EnumSet.copyOf(list);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:RegisterApplicationMasterResponsePBImpl.java
示例3: addSchedulerResourceTypes
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
private void addSchedulerResourceTypes() {
maybeInitBuilder();
builder.clearSchedulerResourceTypes();
if (schedulerResourceTypes == null) {
return;
}
Iterable<? extends SchedulerResourceTypes> values =
new Iterable<SchedulerResourceTypes>() {
@Override
public Iterator<SchedulerResourceTypes> iterator() {
return new Iterator<SchedulerResourceTypes>() {
Iterator<SchedulerResourceTypes> settingsIterator =
schedulerResourceTypes.iterator();
@Override
public boolean hasNext() {
return settingsIterator.hasNext();
}
@Override
public SchedulerResourceTypes next() {
return settingsIterator.next();
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
this.builder.addAllSchedulerResourceTypes(values);
}
开发者ID:naver,项目名称:hadoop,代码行数:35,代码来源:RegisterApplicationMasterResponsePBImpl.java
示例4: setSchedulerResourceTypes
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
@Override
public void setSchedulerResourceTypes(EnumSet<SchedulerResourceTypes> types) {
if (types == null) {
return;
}
initSchedulerResourceTypes();
this.schedulerResourceTypes.clear();
this.schedulerResourceTypes.addAll(types);
}
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:RegisterApplicationMasterResponsePBImpl.java
示例5: getSchedulingResourceTypes
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public EnumSet<SchedulerResourceTypes> getSchedulingResourceTypes() {
if (calculator.getClass().getName()
.equals(DefaultResourceCalculator.class.getName())) {
return EnumSet.of(SchedulerResourceTypes.MEMORY);
}
return EnumSet
.of(SchedulerResourceTypes.MEMORY, SchedulerResourceTypes.CPU, SchedulerResourceTypes.GPU);
}
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:CapacityScheduler.java
示例6: computeAvailableContainers
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
public static int computeAvailableContainers(Resource available,
Resource required, EnumSet<SchedulerResourceTypes> resourceTypes) {
if (resourceTypes.contains(SchedulerResourceTypes.CPU)) {
if (required.getGpuCores() == 0) {
return Math.min(available.getMemory() / required.getMemory(),
available.getVirtualCores() / required.getVirtualCores());
}
else {
return Math.min(available.getMemory() / required.getMemory(),
Math.min(available.getVirtualCores() / required.getVirtualCores(),
available.getGpuCores() / required.getGpuCores()));
}
}
return available.getMemory() / required.getMemory();
}
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:ResourceCalculatorUtils.java
示例7: divideAndCeilContainers
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
public static int divideAndCeilContainers(Resource required, Resource factor,
EnumSet<SchedulerResourceTypes> resourceTypes) {
if (resourceTypes.contains(SchedulerResourceTypes.CPU)) {
if (factor.getGpuCores() == 0) {
return Math.max(divideAndCeil(required.getMemory(), factor.getMemory()),
divideAndCeil(required.getVirtualCores(), factor.getVirtualCores()));
}
else {
return Math.max(divideAndCeil(required.getMemory(), factor.getMemory()),
Math.max(divideAndCeil(required.getVirtualCores(), factor.getVirtualCores()),
divideAndCeil(required.getGpuCores(), factor.getGpuCores())));
}
}
return divideAndCeil(required.getMemory(), factor.getMemory());
}
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:ResourceCalculatorUtils.java
示例8: RMCommunicator
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
public RMCommunicator(ClientService clientService, AppContext context) {
super("RMCommunicator");
this.clientService = clientService;
this.context = context;
this.eventHandler = context.getEventHandler();
this.applicationId = context.getApplicationID();
this.stopped = new AtomicBoolean(false);
this.heartbeatCallbacks = new ConcurrentLinkedQueue<Runnable>();
this.schedulerResourceTypes = EnumSet.of(SchedulerResourceTypes.MEMORY);
}
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:RMCommunicator.java
示例9: getSchedulingResourceTypes
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public EnumSet<SchedulerResourceTypes> getSchedulingResourceTypes() {
if (calculator.getClass().getName()
.equals(DefaultResourceCalculator.class.getName())) {
return EnumSet.of(SchedulerResourceTypes.MEMORY);
}
return EnumSet.of(SchedulerResourceTypes.MEMORY, SchedulerResourceTypes.CPU);
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:10,代码来源:CapacityScheduler.java
示例10: computeAvailableContainers
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
public static int computeAvailableContainers(Resource available,
Resource required, EnumSet<SchedulerResourceTypes> resourceTypes) {
if (resourceTypes.contains(SchedulerResourceTypes.CPU)) {
return Math.min(
calculateRatioOrMaxValue(available.getMemory(), required.getMemory()),
calculateRatioOrMaxValue(available.getVirtualCores(), required
.getVirtualCores()));
}
return calculateRatioOrMaxValue(
available.getMemory(), required.getMemory());
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:12,代码来源:ResourceCalculatorUtils.java
示例11: divideAndCeilContainers
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
public static int divideAndCeilContainers(Resource required, Resource factor,
EnumSet<SchedulerResourceTypes> resourceTypes) {
if (resourceTypes.contains(SchedulerResourceTypes.CPU)) {
return Math.max(divideAndCeil(required.getMemory(), factor.getMemory()),
divideAndCeil(required.getVirtualCores(), factor.getVirtualCores()));
}
return divideAndCeil(required.getMemory(), factor.getMemory());
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:9,代码来源:ResourceCalculatorUtils.java
示例12: getSchedulingResourceTypes
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public EnumSet<SchedulerResourceTypes> getSchedulingResourceTypes() {
if (calculator.getClass().getName()
.equals(DefaultResourceCalculator.class.getName())) {
return EnumSet.of(SchedulerResourceTypes.MEMORY);
}
return EnumSet
.of(SchedulerResourceTypes.MEMORY, SchedulerResourceTypes.CPU);
}
开发者ID:yncxcw,项目名称:big-c,代码行数:11,代码来源:CapacityScheduler.java
示例13: computeAvailableContainers
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
public static int computeAvailableContainers(Resource available,
Resource required, EnumSet<SchedulerResourceTypes> resourceTypes) {
if (resourceTypes.contains(SchedulerResourceTypes.CPU)) {
return Math.min(available.getMemory() / required.getMemory(),
available.getVirtualCores() / required.getVirtualCores());
}
return available.getMemory() / required.getMemory();
}
开发者ID:yncxcw,项目名称:big-c,代码行数:9,代码来源:ResourceCalculatorUtils.java
示例14: getSchedulingResourceTypes
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public EnumSet<SchedulerResourceTypes> getSchedulingResourceTypes() {
if (calculator.getClass().getName()
.equals(DefaultResourceCalculator.class.getName())) {
return EnumSet.of(SchedulerResourceTypes.MEMORY);
}
return EnumSet.of(SchedulerResourceTypes.MEMORY, SchedulerResourceTypes.CPU, SchedulerResourceTypes.GPU);
}
开发者ID:hopshadoop,项目名称:hops,代码行数:10,代码来源:CapacityScheduler.java
示例15: computeAvailableContainers
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
public static int computeAvailableContainers(Resource available,
Resource required, EnumSet<SchedulerResourceTypes> resourceTypes) {
if (resourceTypes.contains(SchedulerResourceTypes.CPU)) {
return Math.min(
calculateRatioOrMaxValue(available.getMemorySize(), required.getMemorySize()),
calculateRatioOrMaxValue(available.getVirtualCores(), required
.getVirtualCores()));
}
return calculateRatioOrMaxValue(
available.getMemorySize(), required.getMemorySize());
}
开发者ID:hopshadoop,项目名称:hops,代码行数:12,代码来源:ResourceCalculatorUtils.java
示例16: divideAndCeilContainers
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
public static int divideAndCeilContainers(Resource required, Resource factor,
EnumSet<SchedulerResourceTypes> resourceTypes) {
if (resourceTypes.contains(SchedulerResourceTypes.CPU)) {
return Math.max(divideAndCeil(required.getMemorySize(), factor.getMemorySize()),
divideAndCeil(required.getVirtualCores(), factor.getVirtualCores()));
}
return divideAndCeil(required.getMemorySize(), factor.getMemorySize());
}
开发者ID:hopshadoop,项目名称:hops,代码行数:9,代码来源:ResourceCalculatorUtils.java
示例17: getSupportedResourceTypes
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes; //导入依赖的package包/类
@Override
public Set<String> getSupportedResourceTypes(RegisterApplicationMasterResponse response) {
EnumSet<SchedulerResourceTypes> supportedResourceTypes = response.getSchedulerResourceTypes();
Set<String> supportedTypes = new HashSet<String>();
for (SchedulerResourceTypes resourceType : supportedResourceTypes) {
supportedTypes.add(resourceType.name());
}
return supportedTypes;
}
开发者ID:apache,项目名称:tez,代码行数:10,代码来源:HadoopShim27.java
注:本文中的org.apache.hadoop.yarn.proto.YarnServiceProtos.SchedulerResourceTypes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论