YarnNodeCapacityManager extends BaseInterceptor { public void incrementNodeCapacity(RMNode rmNode, Resource addedCapacity) { setNodeCapacity(rmNode, Resources.add(rmNode.getTotalCapability(), addedCapacity)); } @Inject  YarnNodeCapacityManager(InterceptorRegistry registry, AbstractYarnScheduler yarnScheduler, RMContext rmContext,
                                 MyriadDriver myriadDriver, OfferLifecycleManager offerLifecycleMgr, NodeStore nodeStore,
                                 SchedulerState state, TaskUtils taskUtils); @Override CallBackFilter getCallBackFilter(); @Override void beforeReleaseContainers(List<ContainerId> containerIds, SchedulerApplicationAttempt attempt); @Override void beforeCompletedContainer(RMContainer rmContainer, ContainerStatus containerStatus, RMContainerEventType type); @Override void afterSchedulerEventHandled(SchedulerEvent event); void incrementNodeCapacity(RMNode rmNode, Resource addedCapacity); void decrementNodeCapacity(RMNode rmNode, Resource removedCapacity); @SuppressWarnings("unchecked") void setNodeCapacity(RMNode rmNode, Resource newCapacity);  }
@Test public void testIncrementNodeCapacity() throws Exception { manager.incrementNodeCapacity(nodeTwo, Resource.newInstance(2048, 4)); assertEquals(3072, nodeTwo.getTotalCapability().getMemory()); assertEquals(6, nodeTwo.getTotalCapability().getVirtualCores()); }