Search in sources :

Example 6 with JobModelManager

use of org.apache.samza.coordinator.JobModelManager in project samza by apache.

the class TestApplicationMasterRestClient method createSamzaApplicationState.

private SamzaApplicationState createSamzaApplicationState() {
    HashMap<String, ContainerModel> containers = generateContainers();
    JobModel mockJobModel = mock(JobModel.class);
    when(mockJobModel.getContainers()).thenReturn(containers);
    JobModelManager mockJobModelManager = mock(JobModelManager.class);
    when(mockJobModelManager.jobModel()).thenReturn(mockJobModel);
    SamzaApplicationState samzaApplicationState = new SamzaApplicationState(mockJobModelManager);
    samzaApplicationState.runningProcessors.put(YARN_CONTAINER_ID_3, new SamzaResource(1, 2, "dummyNodeHost1", "dummyResourceId1"));
    samzaApplicationState.runningProcessors.put(YARN_CONTAINER_ID_2, new SamzaResource(2, 4, "dummyNodeHost2", "dummyResourceId2"));
    return samzaApplicationState;
}
Also used : SamzaApplicationState(org.apache.samza.clustermanager.SamzaApplicationState) JobModelManager(org.apache.samza.coordinator.JobModelManager) JobModel(org.apache.samza.job.model.JobModel) SamzaResource(org.apache.samza.clustermanager.SamzaResource) ContainerModel(org.apache.samza.job.model.ContainerModel)

Aggregations

JobModelManager (org.apache.samza.coordinator.JobModelManager)6 JobModel (org.apache.samza.job.model.JobModel)5 ContainerModel (org.apache.samza.job.model.ContainerModel)4 HashMap (java.util.HashMap)3 TaskName (org.apache.samza.container.TaskName)3 TaskModel (org.apache.samza.job.model.TaskModel)3 Config (org.apache.samza.config.Config)2 HttpServer (org.apache.samza.coordinator.server.HttpServer)2 MetricsRegistryMap (org.apache.samza.metrics.MetricsRegistryMap)2 DefaultServlet (org.eclipse.jetty.servlet.DefaultServlet)2 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)2 Map (java.util.Map)1 SamzaApplicationState (org.apache.samza.clustermanager.SamzaApplicationState)1 SamzaResource (org.apache.samza.clustermanager.SamzaResource)1 SerializerConfig (org.apache.samza.config.SerializerConfig)1 StorageConfig (org.apache.samza.config.StorageConfig)1 SystemConfig (org.apache.samza.config.SystemConfig)1 TaskConfig (org.apache.samza.config.TaskConfig)1 LocalityManager (org.apache.samza.container.LocalityManager)1 CoordinatorStreamStore (org.apache.samza.coordinator.metadatastore.CoordinatorStreamStore)1