@Test public void testTwoAllocationsOnFourContainersAvailableInDefaultRack() throws InjectionException { containerManager = injector.getInstance(ContainerManager.class); sendNodeDescriptors(); resourceManager = new ResourceManager(containerManager, mockResourceAllocationHandler, mockRuntimeStatusHandler, JVM_HEAP_SLACK, configurationSerializer, remoteManager, filenames, loggingScopeFactory); final ResourceRequestEvent request = ResourceRequestEventImpl.newBuilder().setResourceCount(2).setVirtualCores(1) .setMemorySize(64).build(); resourceManager.onResourceRequest(request); verify(mockResourceAllocationHandler, times(2)).onNext(any(ResourceAllocationEvent.class)); verify(mockRuntimeStatusHandler, times(3)).onNext(any(RuntimeStatusEvent.class)); }
void onResourceRequest(final ResourceRequestEvent resourceRequest) { synchronized (this.theContainers) { this.requestQueue.add(new ResourceRequest(resourceRequest)); this.checkRequestQueue(); } }
ResourceManager { void onResourceRequest(final ResourceRequestEvent resourceRequest) { synchronized (this.theContainers) { this.requestQueue.add(new ResourceRequest(resourceRequest)); this.checkRequestQueue(); } } }
ResourceManager { void onResourceRequest(final ResourceRequestEvent resourceRequest) { synchronized (this.theContainers) { this.requestQueue.add(new ResourceRequest(resourceRequest)); this.checkRequestQueue(); } } @Inject  ResourceManager(
      final ContainerManager containerManager,
      @Parameter(RuntimeParameters.ResourceAllocationHandler.class)
      final EventHandler<ResourceAllocationEvent> allocationHandler,
      @Parameter(RuntimeParameters.RuntimeStatusHandler.class)
      final EventHandler<RuntimeStatusEvent> runtimeStatusHandlerEventHandler,
      @Parameter(JVMHeapSlack.class) final double jvmHeapSlack,
      final ConfigurationSerializer configurationSerializer,
      final RemoteManager remoteManager,
      final REEFFileNames fileNames,
      final LoggingScopeFactory loggingScopeFactory); }
ResourceManager { void onResourceRequest(final ResourceRequestEvent resourceRequest) { synchronized (this.theContainers) { this.requestQueue.add(new ResourceRequest(resourceRequest)); this.checkRequestQueue(); } } @Inject  ResourceManager(
      final ContainerManager containerManager,
      @Parameter(RuntimeParameters.ResourceAllocationHandler.class)
      final EventHandler<ResourceAllocationEvent> allocationHandler,
      @Parameter(RuntimeParameters.RuntimeStatusHandler.class)
      final EventHandler<RuntimeStatusEvent> runtimeStatusHandlerEventHandler,
      @Parameter(JVMHeapSlack.class) final double jvmHeapSlack,
      final ConfigurationSerializer configurationSerializer,
      final RemoteManager remoteManager,
      final REEFFileNames fileNames,
      final LoggingScopeFactory loggingScopeFactory); void onEvaluatorExit(final String evaluatorId); }
ResourceManager { void onResourceRequest(final ResourceRequestEvent resourceRequest) { synchronized (this.theContainers) { this.requestQueue.add(new ResourceRequest(resourceRequest)); this.checkRequestQueue(); } } @Inject  ResourceManager(
      final ContainerManager containerManager,
      @Parameter(RuntimeParameters.ResourceAllocationHandler.class)
      final EventHandler<ResourceAllocationEvent> allocationHandler,
      @Parameter(RuntimeParameters.RuntimeStatusHandler.class)
      final EventHandler<RuntimeStatusEvent> runtimeStatusHandlerEventHandler,
      @Parameter(JVMHeapSlack.class) final double jvmHeapSlack,
      final ConfigurationSerializer configurationSerializer,
      final RemoteManager remoteManager,
      final REEFFileNames fileNames,
      final LoggingScopeFactory loggingScopeFactory); void onEvaluatorExit(final String evaluatorId);  }