@Override public int compareTo(@Nonnull ResourceProfile other) { int cmp1 = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); int cmp2 = Double.compare(this.cpuCores, other.cpuCores); return (cmp1 != 0) ? cmp1 : cmp2; }
@Override public int compareTo(@Nonnull ResourceProfile other) { int cmp = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); if (cmp == 0) { cmp = Double.compare(this.cpuCores, other.cpuCores);
@Override public int compareTo(@Nonnull ResourceProfile other) { int cmp = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); if (cmp == 0) { cmp = Double.compare(this.cpuCores, other.cpuCores);
@Override public int compareTo(@Nonnull ResourceProfile other) { int cmp = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); if (cmp == 0) { cmp = Double.compare(this.cpuCores, other.cpuCores);
@Override public Collection<ResourceProfile> startNewWorker(ResourceProfile resourceProfile) { // Priority for worker containers - priorities are intra-application //TODO: set priority according to the resource allocated Priority priority = Priority.newInstance(generatePriority(resourceProfile)); int mem = resourceProfile.getMemoryInMB() < 0 ? defaultTaskManagerMemoryMB : resourceProfile.getMemoryInMB(); int vcore = resourceProfile.getCpuCores() < 1 ? defaultCpus : (int) resourceProfile.getCpuCores(); Resource capability = Resource.newInstance(mem, vcore); requestYarnContainer(capability, priority); return slotsPerWorker; }