本文整理了Java中org.apache.hadoop.yarn.util.YarnVersionInfo.getVersion()
方法的一些代码示例,展示了YarnVersionInfo.getVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnVersionInfo.getVersion()
方法的具体详情如下:
包路径:org.apache.hadoop.yarn.util.YarnVersionInfo
类名称:YarnVersionInfo
方法名:getVersion
[英]Get the YARN version.
[中]得到纱线版本。
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public MockNM(String nodeIdStr, Resource capability,
ResourceTrackerService resourceTracker) {
this(nodeIdStr, capability, resourceTracker,
YarnVersionInfo.getVersion());
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public MockNM(String nodeIdStr, int memory, int vcores,
ResourceTrackerService resourceTracker) {
this(nodeIdStr, memory, vcores, resourceTracker,
YarnVersionInfo.getVersion());
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
public MockNM(String nodeIdStr, int memory, int vcores,
ResourceTrackerService resourceTracker) {
this(nodeIdStr, memory, vcores, resourceTracker, YarnVersionInfo.getVersion());
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
public static void main(String[] args) {
LOG.debug("version: "+ getVersion());
System.out.println("YARN " + getVersion());
System.out.println("Subversion " + getUrl() + " -r " + getRevision());
System.out.println("Compiled by " + getUser() + " on " + getDate());
System.out.println("From source with checksum " + getSrcChecksum());
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common
public static void main(String[] args) {
LOG.debug("version: "+ getVersion());
System.out.println("Yarn " + getVersion());
System.out.println("Subversion " + getUrl() + " -r " + getRevision());
System.out.println("Compiled by " + getUser() + " on " + getDate());
System.out.println("From source with checksum " + getSrcChecksum());
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common
public static void main(String[] args) {
LOG.debug("version: "+ getVersion());
System.out.println("Yarn " + getVersion());
System.out.println("Subversion " + getUrl() + " -r " + getRevision());
System.out.println("Compiled by " + getUser() + " on " + getDate());
System.out.println("From source with checksum " + getSrcChecksum());
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-nodemanager
@Override
protected void serviceStart() throws Exception {
// NodeManager is the last service to start, so NodeId is available.
this.nodeId = this.context.getNodeId();
LOG.info("Node ID assigned is : " + this.nodeId);
this.httpPort = this.context.getHttpPort();
this.nodeManagerVersionId = YarnVersionInfo.getVersion();
try {
// Registration has to be in start so that ContainerManager can get the
// perNM tokens needed to authenticate ContainerTokens.
this.resourceTracker = getRMClient();
registerWithRM();
super.serviceStart();
startStatusUpdater();
} catch (Exception e) {
String errorMessage = "Unexpected error starting NodeStatusUpdater";
LOG.error(errorMessage, e);
throw new YarnRuntimeException(e);
}
}
代码示例来源:origin: io.hops/hadoop-yarn-server-nodemanager
@Override
protected void serviceStart() throws Exception {
// NodeManager is the last service to start, so NodeId is available.
this.nodeId = this.context.getNodeId();
LOG.info("Node ID assigned is : " + this.nodeId);
this.httpPort = this.context.getHttpPort();
this.nodeManagerVersionId = YarnVersionInfo.getVersion();
try {
// Registration has to be in start so that ContainerManager can get the
// perNM tokens needed to authenticate ContainerTokens.
this.resourceTracker = getRMClient();
registerWithRM();
super.serviceStart();
startStatusUpdater();
} catch (Exception e) {
String errorMessage = "Unexpected error starting NodeStatusUpdater";
LOG.error(errorMessage, e);
throw new YarnRuntimeException(e);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-nodemanager
@Override
protected void serviceStart() throws Exception {
// NodeManager is the last service to start, so NodeId is available.
this.nodeId = this.context.getNodeId();
this.httpPort = this.context.getHttpPort();
this.nodeManagerVersionId = YarnVersionInfo.getVersion();
try {
// Registration has to be in start so that ContainerManager can get the
// perNM tokens needed to authenticate ContainerTokens.
this.resourceTracker = getRMClient();
registerWithRM();
super.serviceStart();
startStatusUpdater();
} catch (Exception e) {
String errorMessage = "Unexpected error starting NodeStatusUpdater";
LOG.error(errorMessage, e);
throw new YarnRuntimeException(e);
}
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-nodemanager
@Override
protected void serviceStart() throws Exception {
// NodeManager is the last service to start, so NodeId is available.
this.nodeId = this.context.getNodeId();
this.httpPort = this.context.getHttpPort();
this.nodeManagerVersionId = YarnVersionInfo.getVersion();
try {
// Registration has to be in start so that ContainerManager can get the
// perNM tokens needed to authenticate ContainerTokens.
this.resourceTracker = getRMClient();
registerWithRM();
super.serviceStart();
startStatusUpdater();
} catch (Exception e) {
String errorMessage = "Unexpected error starting NodeStatusUpdater";
LOG.error(errorMessage, e);
throw new YarnRuntimeException(e);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
public MockNM registerNode(String nodeIdStr, int memory, int vCores,
List<ApplicationId> runningApplications) throws Exception {
MockNM nm =
new MockNM(nodeIdStr, memory, vCores, getResourceTrackerService(),
YarnVersionInfo.getVersion());
nm.registerNode(runningApplications);
return nm;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public ClusterInfo(ResourceManager rm) {
long ts = ResourceManager.getClusterTimeStamp();
this.id = ts;
this.state = rm.getServiceState();
this.haState = rm.getRMContext().getHAServiceState();
this.rmStateStoreName = rm.getRMContext().getStateStore().getClass()
.getName();
this.startedOn = ts;
this.resourceManagerVersion = YarnVersionInfo.getVersion();
this.resourceManagerBuildVersion = YarnVersionInfo.getBuildVersion();
this.resourceManagerVersionBuiltOn = YarnVersionInfo.getDate();
this.hadoopVersion = VersionInfo.getVersion();
this.hadoopBuildVersion = VersionInfo.getBuildVersion();
this.hadoopVersionBuiltOn = VersionInfo.getDate();
this.haZooKeeperConnectionState =
rm.getRMContext().getHAZookeeperConnectionState();
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public MockNM registerNode(String nodeIdStr, int memory, int vCores,
List<ApplicationId> runningApplications) throws Exception {
MockNM nm =
new MockNM(nodeIdStr, memory, vCores, getResourceTrackerService(),
YarnVersionInfo.getVersion());
nm.registerNode(runningApplications);
drainEventsImplicitly();
return nm;
}
代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager
public ClusterInfo(ResourceManager rm) {
long ts = ResourceManager.getClusterTimeStamp();
this.id = ts;
this.state = rm.getServiceState();
this.haState = rm.getRMContext().getHAServiceState();
this.rmStateStoreName = rm.getRMContext().getStateStore().getClass()
.getName();
this.startedOn = ts;
this.resourceManagerVersion = YarnVersionInfo.getVersion();
this.resourceManagerBuildVersion = YarnVersionInfo.getBuildVersion();
this.resourceManagerVersionBuiltOn = YarnVersionInfo.getDate();
this.hadoopVersion = VersionInfo.getVersion();
this.hadoopBuildVersion = VersionInfo.getBuildVersion();
this.hadoopVersionBuiltOn = VersionInfo.getDate();
this.haZooKeeperConnectionState =
rm.getRMContext().getRMAdminService().getHAZookeeperConnectionState();
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager
public ClusterInfo(ResourceManager rm) {
long ts = ResourceManager.getClusterTimeStamp();
this.id = ts;
this.state = rm.getServiceState();
this.haState = rm.getRMContext().getHAServiceState();
this.rmStateStoreName = rm.getRMContext().getStateStore().getClass()
.getName();
this.startedOn = ts;
this.resourceManagerVersion = YarnVersionInfo.getVersion();
this.resourceManagerBuildVersion = YarnVersionInfo.getBuildVersion();
this.resourceManagerVersionBuiltOn = YarnVersionInfo.getDate();
this.hadoopVersion = VersionInfo.getVersion();
this.hadoopBuildVersion = VersionInfo.getBuildVersion();
this.hadoopVersionBuiltOn = VersionInfo.getDate();
this.haZooKeeperConnectionState =
rm.getRMContext().getRMAdminService().getHAZookeeperConnectionState();
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common
public static TimelineAbout createTimelineAbout(String about) {
TimelineAbout tsInfo = new TimelineAbout(about);
tsInfo.setHadoopBuildVersion(VersionInfo.getBuildVersion());
tsInfo.setHadoopVersion(VersionInfo.getVersion());
tsInfo.setHadoopVersionBuiltOn(VersionInfo.getDate());
tsInfo.setTimelineServiceBuildVersion(YarnVersionInfo.getBuildVersion());
tsInfo.setTimelineServiceVersion(YarnVersionInfo.getVersion());
tsInfo.setTimelineServiceVersionBuiltOn(YarnVersionInfo.getDate());
return tsInfo;
}
代码示例来源:origin: io.hops/hadoop-yarn-common
/**
* Test the yarn version info routines.
* @throws IOException
*/
@Test
public void versionInfoGenerated() throws IOException {
// can't easily know what the correct values are going to be so just
// make sure they aren't Unknown
assertTrue("getVersion returned Unknown", !YarnVersionInfo.getVersion().equals("Unknown"));
assertTrue("getUser returned Unknown", !YarnVersionInfo.getUser().equals("Unknown"));
assertTrue("getUrl returned Unknown", !YarnVersionInfo.getUrl().equals("Unknown"));
assertTrue("getSrcChecksum returned Unknown", !YarnVersionInfo.getSrcChecksum().equals("Unknown"));
// these could be Unknown if the VersionInfo generated from code not in svn or git
// so just check that they return something
assertNotNull("getRevision returned null", YarnVersionInfo.getRevision());
assertNotNull("getBranch returned null", YarnVersionInfo.getBranch());
assertTrue("getBuildVersion check doesn't contain: source checksum",
YarnVersionInfo.getBuildVersion().contains("source checksum"));
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
private RMNodeImpl getNewRMNode(String host, int port, int memory) {
NodeId nodeId = NodeId.newInstance(host, port);
RMNodeImpl nodeImpl = new RMNodeImpl(nodeId, rm.getRMContext(),
nodeId.getHost(), nodeId.getPort(), nodeId.getPort() + 1,
RackResolver.resolve(nodeId.getHost()), Resource.newInstance(memory, 4),
YarnVersionInfo.getVersion());
rm.getRMContext().getRMNodes().put(nodeId, nodeImpl);
return nodeImpl;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
private void registerNode(ResourceManager rm, NodeId nodeId)
throws YarnException, IOException {
ResourceTrackerService resourceTrackerService =
rm.getResourceTrackerService();
RegisterNodeManagerRequest req =
Records.newRecord(RegisterNodeManagerRequest.class);
Resource capability = BuilderUtils.newResource(1024, 1);
req.setResource(capability);
req.setNodeId(nodeId);
req.setHttpPort(1234);
req.setNMVersion(YarnVersionInfo.getVersion());
resourceTrackerService.registerNodeManager(req);
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager
public NodeManager(String hostName, int containerManagerPort, int httpPort,
String rackName, Resource capability,
ResourceManager resourceManager)
throws IOException, YarnException {
this.containerManagerAddress = hostName + ":" + containerManagerPort;
this.nodeHttpAddress = hostName + ":" + httpPort;
this.rackName = rackName;
this.resourceTrackerService = resourceManager.getResourceTrackerService();
this.capability = capability;
Resources.addTo(available, capability);
this.nodeId = NodeId.newInstance(hostName, containerManagerPort);
RegisterNodeManagerRequest request = recordFactory
.newRecordInstance(RegisterNodeManagerRequest.class);
request.setHttpPort(httpPort);
request.setResource(capability);
request.setNodeId(this.nodeId);
request.setNMVersion(YarnVersionInfo.getVersion());
resourceTrackerService.registerNodeManager(request);
this.resourceManager = resourceManager;
resourceManager.getResourceScheduler().getNodeReport(this.nodeId);
}
内容来源于网络,如有侵权,请联系作者删除!