Search in sources :

Example 1 with LocalityServlet

use of org.apache.samza.coordinator.server.LocalityServlet in project samza by apache.

the class TestLocalityServlet method setup.

@Before
public void setup() throws Exception {
    localityManager = mock(LocalityManager.class);
    when(localityManager.readLocality()).thenReturn(new LocalityModel(ImmutableMap.of(PROCESSOR_ID1, PROCESSOR_1_LOCALITY, PROCESSOR_ID2, PROCESSOR_2_LOCALITY)));
    webApp = new HttpServer("/", 0, "", new ServletHolder(new DefaultServlet()));
    webApp.addServlet("/locality", new LocalityServlet(localityManager));
    webApp.start();
}
Also used : LocalityServlet(org.apache.samza.coordinator.server.LocalityServlet) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) HttpServer(org.apache.samza.coordinator.server.HttpServer) DefaultServlet(org.eclipse.jetty.servlet.DefaultServlet) LocalityManager(org.apache.samza.container.LocalityManager) LocalityModel(org.apache.samza.job.model.LocalityModel) Before(org.junit.Before)

Aggregations

LocalityManager (org.apache.samza.container.LocalityManager)1 HttpServer (org.apache.samza.coordinator.server.HttpServer)1 LocalityServlet (org.apache.samza.coordinator.server.LocalityServlet)1 LocalityModel (org.apache.samza.job.model.LocalityModel)1 DefaultServlet (org.eclipse.jetty.servlet.DefaultServlet)1 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)1 Before (org.junit.Before)1