ElasticsearchScheduler implements Scheduler { @Override public void registered(SchedulerDriver driver, Protos.FrameworkID frameworkId, Protos.MasterInfo masterInfo) { LOGGER.info("Framework registered as " + frameworkId.getValue()); List<Protos.Resource> resources = Resources.buildFrameworkResources(configuration); Protos.Request request = Protos.Request.newBuilder() .addAllResources(resources) .build(); List<Protos.Request> requests = Collections.singletonList(request); driver.requestResources(requests); frameworkState.markRegistered(frameworkId, driver); } ElasticsearchScheduler(Configuration configuration, FrameworkState frameworkState, ClusterState clusterState, TaskInfoFactory taskInfoFactory, OfferStrategy offerStrategy, SerializableState zookeeperStateDriver); Map<String, Task> getTasks(); void run(SchedulerDriver schedulerDriver); void reapTasks(); @Override void registered(SchedulerDriver driver, Protos.FrameworkID frameworkId, Protos.MasterInfo masterInfo); @Override void reregistered(SchedulerDriver driver, Protos.MasterInfo masterInfo); @Override void resourceOffers(SchedulerDriver driver, List<Protos.Offer> offers); @Override void offerRescinded(SchedulerDriver driver, Protos.OfferID offerId); @Override void statusUpdate(SchedulerDriver driver, Protos.TaskStatus status); @Override void frameworkMessage(SchedulerDriver driver, Protos.ExecutorID executorId, Protos.SlaveID slaveId, byte[] data); @Override void disconnected(SchedulerDriver driver); @Override void slaveLost(SchedulerDriver driver, Protos.SlaveID slaveId); @Override void executorLost(SchedulerDriver driver, Protos.ExecutorID executorId, Protos.SlaveID slaveId, int status); @Override void error(SchedulerDriver driver, String message); void shutdown(SchedulerDriver driver);  }
@Test public void testRegistered() { verify(driver).requestResources( Mockito.argThat( new RequestMatcher( configuration.getCpus(), configuration.getMem(), configuration.getDisk(), configuration.getFrameworkRole() ) ) ); }