@Override protected void startUp() throws Exception { LOGGER.info("Starting the YarnService"); // Register itself with the EventBus for container-related requests this.eventBus.register(this); this.amrmClientAsync.start(); this.nmClientAsync.start(); // The ApplicationMaster registration response is used to determine the maximum resource capacity of the cluster RegisterApplicationMasterResponse response = this.amrmClientAsync.registerApplicationMaster( GobblinClusterUtils.getHostname(), -1, ""); LOGGER.info("ApplicationMaster registration response: " + response); this.maxResourceCapacity = Optional.of(response.getMaximumResourceCapability()); LOGGER.info("Requesting initial containers"); requestInitialContainers(this.initialContainers); }
private void yarnReport() { RegisterApplicationMasterResponse response = yarn.getRegistrationResponse(); LOG.info("YARN queue: " + response.getQueue()); Resource resource = response.getMaximumResourceCapability(); LOG.info("YARN max resource: " + resource.getMemory() + " MB, " + resource.getVirtualCores() + " cores"); EnumSet<SchedulerResourceTypes> types = response .getSchedulerResourceTypes(); StringBuilder buf = new StringBuilder(); String sep = ""; for (SchedulerResourceTypes type : types) { buf.append(sep); buf.append(type.toString()); sep = ", "; } LOG.info("YARN scheduler resource types: " + buf.toString()); }
/** * Called when the caller has completed start-up and the controller should * become live. */ @Override public synchronized void started() throws YarnFacadeException, AMException { nodeInventory = new NodeInventory(yarn); // Verify that no resource seeks a container larger than // what YARN can provide. Ensures a graceful exit in this // case. Resource maxResource = yarn.getRegistrationResponse() .getMaximumResourceCapability(); for (SchedulerStateActions group : prioritizedGroups) { group.getScheduler().limitContainerSize(maxResource); } state = State.LIVE; }
jstormMasterContext.maxMemory = response.getMaximumResourceCapability().getMemory(); LOG.info("Max mem capability of resources in this cluster " + jstormMasterContext.maxMemory); jstormMasterContext.maxVcores = response.getMaximumResourceCapability().getVirtualCores(); LOG.info("Max vcores capability of resources in this cluster " + jstormMasterContext.maxVcores);
int maxMem = response.getMaximumResourceCapability().getMemory(); LOG.info("Max mem capabililty of resources in this cluster " + maxMem); int maxVCores = response.getMaximumResourceCapability().getVirtualCores(); LOG.info("Max vcores capabililty of resources in this cluster " + maxVCores); maasHandler = new MaaSHandler(zkQuorum, zkRoot);
@Override protected void startUp() throws Exception { Preconditions.checkNotNull(trackerAddr, "Tracker address not set."); Preconditions.checkNotNull(trackerUrl, "Tracker URL not set."); amrmClient.start(); RegisterApplicationMasterResponse response = amrmClient.registerApplicationMaster(trackerAddr.getHostName(), trackerAddr.getPort(), trackerUrl.toString()); maxCapability = response.getMaximumResourceCapability(); nmClient.startAndWait(); }
@Override protected void startUp() throws Exception { Preconditions.checkNotNull(trackerAddr, "Tracker address not set."); Preconditions.checkNotNull(trackerUrl, "Tracker URL not set."); amrmClient.start(); RegisterApplicationMasterResponse response = amrmClient.registerApplicationMaster(trackerAddr.getHostName(), trackerAddr.getPort(), trackerUrl.toString()); maxCapability = response.getMaximumResourceCapability(); nmClient.startAndWait(); }
@Override protected void startUp() throws Exception { Preconditions.checkNotNull(trackerAddr, "Tracker address not set."); Preconditions.checkNotNull(trackerUrl, "Tracker URL not set."); amrmClient.start(); String url = String.format("%s:%d", trackerUrl.getHost(), trackerUrl.getPort() == -1 ? trackerUrl.getDefaultPort() : trackerUrl.getPort()); RegisterApplicationMasterResponse response = amrmClient.registerApplicationMaster(trackerAddr.getHostName(), trackerAddr.getPort(), url); maxCapability = response.getMaximumResourceCapability(); minCapability = response.getMinimumResourceCapability(); }
@Override protected void startUp() throws Exception { LOGGER.info("Starting the YarnService"); // Register itself with the EventBus for container-related requests this.eventBus.register(this); this.amrmClientAsync.start(); this.nmClientAsync.start(); // The ApplicationMaster registration response is used to determine the maximum resource capacity of the cluster RegisterApplicationMasterResponse response = this.amrmClientAsync.registerApplicationMaster( GobblinClusterUtils.getHostname(), -1, ""); LOGGER.info("ApplicationMaster registration response: " + response); this.maxResourceCapacity = Optional.of(response.getMaximumResourceCapability()); LOGGER.info("Requesting initial containers"); requestInitialContainers(this.initialContainers); }
private synchronized int getMemory(final int requestedMemory) { final int result; if (!this.registration.isPresent()) { LOG.log(Level.WARNING, "AM doesn't seem to be registered. Proceed with fingers crossed."); result = requestedMemory; } else { final int maxMemory = registration.getRegistration().getMaximumResourceCapability().getMemory(); if (requestedMemory > maxMemory) { LOG.log(Level.WARNING, "Asking for {0}MB of memory, but max on this cluster is {1}MB ", new Object[]{requestedMemory, maxMemory}); result = maxMemory; } else { result = requestedMemory; } } return result; }
private synchronized int getMemory(final int requestedMemory) { final int result; if (!this.registration.isPresent()) { LOG.log(Level.WARNING, "AM doesn't seem to be registered. Proceed with fingers crossed."); result = requestedMemory; } else { final int maxMemory = registration.getRegistration().getMaximumResourceCapability().getMemory(); if (requestedMemory > maxMemory) { LOG.log(Level.WARNING, "Asking for {0}MB of memory, but max on this cluster is {1}MB ", new Object[]{requestedMemory, maxMemory}); result = maxMemory; } else { result = requestedMemory; } } return result; }
rmClient.registerApplicationMaster(addr.getHostName(), port, null); LOG.info("Got a registration response " + resp); LOG.info("Max Capability " + resp.getMaximumResourceCapability()); rmClient.setMaxResource(resp.getMaximumResourceCapability()); LOG.info("Starting HB thread"); server.initAndStartHeartbeat(rmClient, launcherQueue,
int maxMem = response.getMaximumResourceCapability().getMemory(); LOG.info("Max mem capability of resources in this cluster " + maxMem); int maxVCores = response.getMaximumResourceCapability().getVirtualCores(); LOG.info("Max vcores capability of resources in this cluster " + maxVCores);
getConf().get(ADVERTISED_HOSTNAME_KEY, ""), getConf().getInt(ADVERTISED_PORT_KEY, 0), urlWithoutScheme); maxResource = response.getMaximumResourceCapability(); nodes = Collections.synchronizedMap(new HashMap<String, Resource>()); for (NodeReport nodeReport : yarnClient.getNodeReports()) {
@Override public void start() { try { RegisterApplicationMasterResponse response; synchronized (this) { amRmClient.start(); response = amRmClient.registerApplicationMaster(appHostName, appHostPort, appTrackingUrl); } // upcall to app outside locks getContext().setApplicationRegistrationData( response.getMaximumResourceCapability(), response.getApplicationACLs(), response.getClientToAMTokenMasterKey(), response.getQueue()); delayedContainerManager.start(); } catch (YarnException e) { LOG.error("Yarn Exception while registering", e); throw new TezUncheckedException(e); } catch (IOException e) { LOG.error("IO Exception while registering", e); throw new TezUncheckedException(e); } }
scheduler.registerApplicationMaster(request); isApplicationMasterRegistered = true; maxContainerCapability = response.getMaximumResourceCapability(); this.context.getClusterInfo().setMaxContainerCapability( maxContainerCapability);
scheduler.registerApplicationMaster(request); isApplicationMasterRegistered = true; maxContainerCapability = response.getMaximumResourceCapability(); this.context.getClusterInfo().setMaxContainerCapability( maxContainerCapability);
scheduler.registerApplicationMaster(request); isApplicationMasterRegistered = true; maxContainerCapability = response.getMaximumResourceCapability(); this.context.getClusterInfo().setMaxContainerCapability( maxContainerCapability);
public RegisterApplicationMasterResponse registerApplicationMaster(String host, int port) throws YarnRemoteException { if (amResourceManager == null) throw new IllegalStateException( "Cannot register application master before connecting to the resource manager!"); RegisterApplicationMasterRequest request = Records .newRecord(RegisterApplicationMasterRequest.class); request.setApplicationAttemptId(appAttemptId); request.setHost(host); request.setRpcPort(port); request.setTrackingUrl("http://some-place.com/some/endpoint"); LOG.info("Sending application registration request" + ", masterHost=" + request.getHost() + ", masterRpcPort=" + request.getRpcPort() + ", trackingUrl=" + request.getTrackingUrl() + ", applicationAttempt=" + request.getApplicationAttemptId() + ", applicationId=" + request.getApplicationAttemptId().getApplicationId()); RegisterApplicationMasterResponse response = amResourceManager.registerApplicationMaster(request); LOG.debug("Received a registration response" + ", min=" + response.getMinimumResourceCapability().getMemory() + ", max=" + response.getMaximumResourceCapability().getMemory()); return response; }
ContainerUpdateType.INCREASE_RESOURCE, Resources.add( registerResponse.getMaximumResourceCapability(), Resources.createResource(1)), null))); Assert.assertEquals(1, response.getUpdateErrors().size());