Search in sources :

Example 6 with SamzaResource

use of org.apache.samza.clustermanager.SamzaResource 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

SamzaResource (org.apache.samza.clustermanager.SamzaResource)6 Test (org.junit.Test)4 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)3 NodeId (org.apache.hadoop.yarn.api.records.NodeId)2 MapConfig (org.apache.samza.config.MapConfig)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Container (org.apache.hadoop.yarn.api.records.Container)1 Resource (org.apache.hadoop.yarn.api.records.Resource)1 SamzaApplicationState (org.apache.samza.clustermanager.SamzaApplicationState)1 Config (org.apache.samza.config.Config)1 JobConfig (org.apache.samza.config.JobConfig)1 JobModelManager (org.apache.samza.coordinator.JobModelManager)1 ContainerModel (org.apache.samza.job.model.ContainerModel)1 JobModel (org.apache.samza.job.model.JobModel)1 SamzaAppMasterMetrics (org.apache.samza.job.yarn.SamzaAppMasterMetrics)1