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()); }
@Override public void register(String trackingUrl) throws YarnFacadeException { String thisHostName = NetUtils.getHostname(); LOG.debug("Host Name from YARN: " + thisHostName); if (trackingUrl != null) { // YARN seems to provide multiple names: MACHNAME.local/10.250.56.235 // The second seems to be the IP address, which is what we want. String names[] = thisHostName.split("/"); amHost = names[names.length - 1]; appMasterTrackingUrl = trackingUrl.replace("<host>", amHost); LOG.info("Tracking URL: " + appMasterTrackingUrl); } try { LOG.trace("Registering with YARN"); registration = resourceMgr.registerApplicationMaster(thisHostName, 0, appMasterTrackingUrl); } catch (YarnException | IOException e) { throw new YarnFacadeException("Register AM failed", e); } // Some distributions (but not the stock YARN) support Disk // resources. Since Drill compiles against Apache YARN, without disk // resources, we have to use an indirect mechnanism to look for the // disk enum at runtime when we don't have that enum value at compile time. for (SchedulerResourceTypes type : registration .getSchedulerResourceTypes()) { if (type.name().equals("DISK")) { supportsDisks = true; } } }
LOG.info("queue: " + queue); job.setQueueName(queue); this.schedulerResourceTypes.addAll(response.getSchedulerResourceTypes()); } catch (Exception are) { LOG.error("Exception while registering", are);
LOG.info("queue: " + queue); job.setQueueName(queue); this.schedulerResourceTypes.addAll(response.getSchedulerResourceTypes()); } catch (Exception are) { LOG.error("Exception while registering", are);
LOG.info("queue: " + queue); job.setQueueName(queue); this.schedulerResourceTypes.addAll(response.getSchedulerResourceTypes()); } catch (Exception are) { LOG.error("Exception while registering", are);
MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId()); RegisterApplicationMasterResponse resp = am1.registerAppAttempt(); EnumSet<SchedulerResourceTypes> types = resp.getSchedulerResourceTypes(); LOG.info("types = " + types.toString()); Assert.assertEquals(expectedValue, types);
MockAM am1 = rm.sendAMLaunched(attempt1.getAppAttemptId()); RegisterApplicationMasterResponse resp = am1.registerAppAttempt(); EnumSet<SchedulerResourceTypes> types = resp.getSchedulerResourceTypes(); LOG.info("types = " + types.toString()); Assert.assertEquals(expectedValue, types);