Search in sources :

Example 11 with ExponentialSleepStrategy

use of org.apache.samza.util.ExponentialSleepStrategy in project samza by apache.

the class TestLocalityServlet method testReadProcessorLocality.

@Test
public void testReadProcessorLocality() throws Exception {
    URL url = new URL(webApp.getUrl().toString() + "locality?processorId=" + PROCESSOR_ID1);
    String response = HttpUtil.read(url, 1000, new ExponentialSleepStrategy());
    assertEquals("Mismatch in the locality for processor " + PROCESSOR_ID1, mapper.readValue(response, ProcessorLocality.class), PROCESSOR_1_LOCALITY);
}
Also used : ProcessorLocality(org.apache.samza.job.model.ProcessorLocality) ExponentialSleepStrategy(org.apache.samza.util.ExponentialSleepStrategy) URL(java.net.URL) Test(org.junit.Test)

Aggregations

ExponentialSleepStrategy (org.apache.samza.util.ExponentialSleepStrategy)11 Test (org.junit.Test)9 URL (java.net.URL)6 HashMap (java.util.HashMap)5 ImmutableMap (com.google.common.collect.ImmutableMap)4 Map (java.util.Map)4 PartitionInfo (org.apache.kafka.common.PartitionInfo)4 TopicPartition (org.apache.kafka.common.TopicPartition)4 Partition (org.apache.samza.Partition)4 SamzaException (org.apache.samza.SamzaException)4 SystemStreamMetadata (org.apache.samza.system.SystemStreamMetadata)4 SystemStreamPartition (org.apache.samza.system.SystemStreamPartition)4 ImmutableSet (com.google.common.collect.ImmutableSet)3 Collections (java.util.Collections)3 List (java.util.List)3 Set (java.util.Set)3 Collectors (java.util.stream.Collectors)3 Consumer (org.apache.kafka.clients.consumer.Consumer)3 ConsumerConfig (org.apache.kafka.clients.consumer.ConsumerConfig)3 Config (org.apache.samza.config.Config)3