Search in sources :

Example 96 with ContainerModel

use of org.apache.samza.job.model.ContainerModel 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

ContainerModel (org.apache.samza.job.model.ContainerModel)96 TaskModel (org.apache.samza.job.model.TaskModel)68 TaskName (org.apache.samza.container.TaskName)60 Test (org.junit.Test)57 HashMap (java.util.HashMap)53 JobModel (org.apache.samza.job.model.JobModel)37 MapConfig (org.apache.samza.config.MapConfig)30 Config (org.apache.samza.config.Config)28 Partition (org.apache.samza.Partition)24 SystemStreamPartition (org.apache.samza.system.SystemStreamPartition)22 StorageConfig (org.apache.samza.config.StorageConfig)19 Map (java.util.Map)18 JobConfig (org.apache.samza.config.JobConfig)18 TaskConfig (org.apache.samza.config.TaskConfig)18 HashSet (java.util.HashSet)16 ArrayList (java.util.ArrayList)14 ClusterManagerConfig (org.apache.samza.config.ClusterManagerConfig)12 LocationId (org.apache.samza.runtime.LocationId)12 Collectors (java.util.stream.Collectors)10 SystemStream (org.apache.samza.system.SystemStream)10