TaskType(String memoryConfKey, int defaultMemoryMB, String javaOptsKey) { this.memoryConfKey = memoryConfKey; this.defaultMemoryMB = defaultMemoryMB; this.javaOptsKey = javaOptsKey; String vcoreConfKey = null; int defaultVcores = 0; try { String confFieldName = name() + "_CPU_VCORES"; vcoreConfKey = Job.class.getField(confFieldName).get(null).toString(); String defaultValueFieldName = "DEFAULT_" + confFieldName; defaultVcores = (Integer) Job.class.getField(defaultValueFieldName).get(null); } catch (Exception e) { // OK to ignore // Some older version of hadoop-mr-client doesn't has the VCORES field as vcores was not supported in YARN. } this.vcoreConfKey = vcoreConfKey; this.defaultVcores = defaultVcores; }
TaskType(String memoryConfKey, int defaultMemoryMB, String javaOptsKey) { this.memoryConfKey = memoryConfKey; this.defaultMemoryMB = defaultMemoryMB; this.javaOptsKey = javaOptsKey; String vcoreConfKey = null; int defaultVcores = 0; try { String confFieldName = name() + "_CPU_VCORES"; vcoreConfKey = Job.class.getField(confFieldName).get(null).toString(); String defaultValueFieldName = "DEFAULT_" + confFieldName; defaultVcores = (Integer) Job.class.getField(defaultValueFieldName).get(null); } catch (Exception e) { // OK to ignore // Some older version of hadoop-mr-client doesn't has the VCORES field as vcores was not supported in YARN. } this.vcoreConfKey = vcoreConfKey; this.defaultVcores = defaultVcores; }
name().toLowerCase(), memoryMB, memorySource, maxHeapSize, maxHeapSource, vcores > 0 ? " Virtual cores is " + vcores + ", set " + vcoreSource + "." : ".");
name().toLowerCase(), memoryMB, memorySource, maxHeapSize, maxHeapSource, vcores > 0 ? " Virtual cores is " + vcores + ", set " + vcoreSource + "." : ".");