本文整理匯總了Java中org.apache.hadoop.yarn.api.records.Container.setPriority方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.setPriority方法的具體用法?Java Container.setPriority怎麽用?Java Container.setPriority使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.yarn.api.records.Container
的用法示例。
在下文中一共展示了Container.setPriority方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: newContainerInstance
import org.apache.hadoop.yarn.api.records.Container; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
private Container newContainerInstance(int id, Priority priority,
Resource capability, String hostName) throws IOException {
HPCCommandExecutor.setJobState(id, "assigned", conf);
NodeId nodeId = NodeId.newInstance(hostName, 0);
Container container = Records.newRecord(Container.class);
container.setNodeId(nodeId);
container.setPriority(priority);
container.setResource(capability);
container.setId(ContainerId.newInstance(appAttemptId, ++containerId));
Token token = Token.newInstance(nodeId.toString().getBytes(),
nodeId.toString(), nodeId.toString().getBytes(), nodeId.toString());
byte[] bytes = container.getId().toString().getBytes();
ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
buffer.put(bytes);
token.setIdentifier(buffer);
container.setContainerToken(token);
container.setNodeHttpAddress(hostName + ":0");
LOG.info("Allocated container " + container.getId() + " for Job id:" + id);
return container;
}
示例2: newContainerInstance
import org.apache.hadoop.yarn.api.records.Container; //導入方法依賴的package包/類
private Container newContainerInstance(int id, Priority priority,
Resource capability, String hostName) throws IOException {
NodeId nodeId = NodeId.newInstance(hostName, 0);
Container container = Records.newRecord(Container.class);
container.setNodeId(nodeId);
container.setPriority(priority);
container.setResource(capability);
container.setId(ContainerId.newContainerId(appAttemptId, ++containerId));
Token token = Token.newInstance(nodeId.toString().getBytes(),
nodeId.toString(), nodeId.toString().getBytes(), nodeId.toString());
byte[] bytes = container.getId().toString().getBytes();
ByteBuffer buffer = ByteBuffer.allocate(bytes.length);
buffer.put(bytes);
token.setIdentifier(buffer);
container.setContainerToken(token);
container.setNodeHttpAddress(hostName + ":0");
return container;
}
示例3: newContainer
import org.apache.hadoop.yarn.api.records.Container; //導入方法依賴的package包/類
public static Container newContainer(ContainerId containerId, NodeId nodeId,
String nodeHttpAddress, Resource resource, Priority priority,
Token containerToken) {
Container container = recordFactory.newRecordInstance(Container.class);
container.setId(containerId);
container.setNodeId(nodeId);
container.setNodeHttpAddress(nodeHttpAddress);
container.setResource(resource);
container.setPriority(priority);
container.setContainerToken(containerToken);
return container;
}