Search in sources :

Example 1 with Index

use of io.mantisrx.runtime.source.Index in project mantis by Netflix.

the class KafkaSourceTest method testKafkaSourceSingleConsumerReadsAllMessagesInOrderFromSinglePartition.

@Test
public void testKafkaSourceSingleConsumerReadsAllMessagesInOrderFromSinglePartition() throws InterruptedException {
    String testTopic = "testTopic" + topicNum.incrementAndGet();
    int numPartitions = 1;
    kafkaServer.createTopic(testTopic, numPartitions);
    int numMessages = 10;
    for (int i = 0; i < numMessages; i++) {
        ProducerRecord<String, String> keyedMessage = new ProducerRecord<>(testTopic, "{\"messageNum\":" + i + "}");
        kafkaServer.sendMessages(keyedMessage);
    }
    KafkaSource kafkaSource = new KafkaSource(new NoopRegistry());
    Context context = mock(Context.class);
    Parameters params = ParameterTestUtils.createParameters(KafkaSourceParameters.TOPIC, testTopic, KafkaSourceParameters.PREFIX + ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest", KafkaSourceParameters.PREFIX + ConsumerConfig.GROUP_ID_CONFIG, "testKafkaConsumer-" + random.nextInt());
    when(context.getParameters()).then((Answer<Parameters>) invocation -> params);
    when(context.getWorkerInfo()).then((Answer<WorkerInfo>) invocation -> new WorkerInfo("testJobName", "testJobName-1", 1, 0, 1, MantisJobDurationType.Perpetual, "1.1.1.1"));
    when(context.getJobId()).then((Answer<String>) invocation -> "testJobName-1");
    Index index = new Index(0, 10);
    Observable<Observable<KafkaAckable>> sourceObs = kafkaSource.call(context, index);
    final CountDownLatch latch = new CountDownLatch(numMessages);
    final AtomicInteger counter = new AtomicInteger(0);
    sourceObs.flatMap(kafkaAckableObs -> kafkaAckableObs).map(kafkaAckable -> {
        Optional<Map<String, Object>> parsedEvent = kafkaAckable.getKafkaData().getParsedEvent();
        assertTrue(parsedEvent.isPresent());
        assertEquals(counter.getAndIncrement(), parsedEvent.get().get("messageNum"));
        LOGGER.info("got message on topic {} consumer Id {}", parsedEvent.get(), kafkaAckable.getKafkaData().getMantisKafkaConsumerId());
        kafkaAckable.ack();
        latch.countDown();
        return parsedEvent;
    }).subscribe();
    assertTrue("timed out waiting to get all messages from Kafka", latch.await(10, TimeUnit.SECONDS));
    kafkaServer.deleteTopic(testTopic);
}
Also used : Context(io.mantisrx.runtime.Context) NoopRegistry(com.netflix.spectator.api.NoopRegistry) Index(io.mantisrx.runtime.source.Index) KafkaSourceParameters(io.mantisrx.connector.kafka.KafkaSourceParameters) ProducerRecord(org.apache.kafka.clients.producer.ProducerRecord) BeforeClass(org.junit.BeforeClass) MantisJobDurationType(io.mantisrx.runtime.MantisJobDurationType) LoggerFactory(org.slf4j.LoggerFactory) ParameterTestUtils(io.mantisrx.connector.kafka.ParameterTestUtils) Parameters(io.mantisrx.runtime.parameter.Parameters) Random(java.util.Random) Observable(rx.Observable) Answer(org.mockito.stubbing.Answer) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) KafkaAckable(io.mantisrx.connector.kafka.KafkaAckable) Map(java.util.Map) AfterClass(org.junit.AfterClass) Logger(org.slf4j.Logger) TestCase.fail(junit.framework.TestCase.fail) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Assert.assertTrue(org.junit.Assert.assertTrue) Set(java.util.Set) ConsumerConfig(org.apache.kafka.clients.consumer.ConsumerConfig) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Context(io.mantisrx.runtime.Context) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) ConcurrentSkipListSet(java.util.concurrent.ConcurrentSkipListSet) Ignore(org.junit.Ignore) KafkaUnit(info.batey.kafka.unit.KafkaUnit) Optional(java.util.Optional) Assert.assertEquals(org.junit.Assert.assertEquals) Mockito.mock(org.mockito.Mockito.mock) WorkerInfo(io.mantisrx.runtime.WorkerInfo) KafkaSourceParameters(io.mantisrx.connector.kafka.KafkaSourceParameters) Parameters(io.mantisrx.runtime.parameter.Parameters) Optional(java.util.Optional) WorkerInfo(io.mantisrx.runtime.WorkerInfo) Index(io.mantisrx.runtime.source.Index) CountDownLatch(java.util.concurrent.CountDownLatch) Observable(rx.Observable) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) NoopRegistry(com.netflix.spectator.api.NoopRegistry) ProducerRecord(org.apache.kafka.clients.producer.ProducerRecord) Test(org.junit.Test)

Example 2 with Index

use of io.mantisrx.runtime.source.Index in project mantis by Netflix.

the class HttpSourceImplTest method testTimeoutShouldUnsubscribeServer.

@Test
public void testTimeoutShouldUnsubscribeServer() throws Exception {
    HttpClientFactory<ByteBuf, ByteBuf> factory = new HttpClientFactory<ByteBuf, ByteBuf>() {

        @Override
        public HttpClient<ByteBuf, ByteBuf> createClient(ServerInfo server) {
            ClientConfig clientConfig = new ClientConfig.Builder().readTimeout(10, TimeUnit.MILLISECONDS).build();
            return new HttpClientBuilder<ByteBuf, ByteBuf>(server.getHost(), server.getPort()).config(clientConfig).build();
        }
    };
    HttpSourceImpl<ByteBuf, ByteBuf, ServerContext<ByteBuf>> source = HttpSourceImpl.builder(factory, HttpRequestFactories.createGetFactory("test/timeout?timeout=10000"), HttpSourceImpl.<ByteBuf>contextWrapper()).withActivityObserver(sourceObserver).resumeWith(new ClientResumePolicy<ByteBuf, ByteBuf>() {

        @Override
        public Observable<HttpClientResponse<ByteBuf>> onError(ServerClientContext<ByteBuf, ByteBuf> clientContext, int attempts, Throwable error) {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public Observable<HttpClientResponse<ByteBuf>> onCompleted(ServerClientContext<ByteBuf, ByteBuf> clientContext, int attempts) {
            // TODO Auto-generated method stub
            return null;
        }
    }).withServerProvider(new HttpServerProvider() {

        @Override
        public Observable<ServerInfo> getServersToAdd() {
            return Observable.from(localServerProvider.getServers()).map(new Func1<Server, ServerInfo>() {

                @Override
                public ServerInfo call(Server server) {
                    return toServerInfo(server);
                }
            });
        }

        @Override
        public Observable<ServerInfo> getServersToRemove() {
            return Observable.empty();
        }
    }).build();
    final CountDownLatch latch = new CountDownLatch(1);
    final AtomicReference<Throwable> ex = new AtomicReference<>();
    final AtomicReference<ServerContext<ByteBuf>> items = new AtomicReference<>();
    Observable.merge(source.call(new Context(), new Index(1, 1))).subscribe(new Subscriber<ServerContext<ByteBuf>>() {

        @Override
        public void onCompleted() {
            latch.countDown();
        }

        @Override
        public void onError(Throwable e) {
            ex.set(e);
            latch.countDown();
        }

        @Override
        public void onNext(ServerContext<ByteBuf> pair) {
            items.set(pair);
        }
    });
    if (!latch.await(5, TimeUnit.SECONDS)) {
        fail("The test case should finish way sooner than 5 seconds. ");
    }
    Assert.assertNull("The timeout error should be captured by the client so it does not surface to the source", ex.get());
    Assert.assertNull("There should be no emitted item due to connection timeout", items.get());
    for (Server server : localServerProvider.getServers()) {
        ServerInfo serverInfo = toServerInfo(server);
        assertEquals("There should be no source level error", 0, sourceObserver.getErrorCount());
        assertEquals("There should be one connection attempt per server", 1, sourceObserver.getCount(serverInfo, EventType.CONNECTION_ATTEMPTED));
        assertEquals("There should be no established connection per server due to read timeout. ", 0, sourceObserver.getCount(serverInfo, EventType.CONNECTION_ESTABLISHED));
        assertEquals("There should no subscribed server because of read timeout", 0, sourceObserver.getCount(serverInfo, EventType.SUBSCRIPTION_ESTABLISHED));
    }
}
Also used : Server(io.mantisrx.runtime.source.http.LocalServerProvider.Server) ServerInfo(mantis.io.reactivex.netty.client.RxClient.ServerInfo) HttpClientBuilder(mantis.io.reactivex.netty.protocol.http.client.HttpClientBuilder) Builder(io.mantisrx.runtime.source.http.impl.HttpSourceImpl.Builder) Index(io.mantisrx.runtime.source.Index) HttpClientBuilder(mantis.io.reactivex.netty.protocol.http.client.HttpClientBuilder) ByteBuf(io.netty.buffer.ByteBuf) ClientConfig(mantis.io.reactivex.netty.client.RxClient.ClientConfig) HttpClientFactory(io.mantisrx.runtime.source.http.HttpClientFactory) Context(io.mantisrx.runtime.Context) AtomicReference(java.util.concurrent.atomic.AtomicReference) CountDownLatch(java.util.concurrent.CountDownLatch) Observable(rx.Observable) HttpServerProvider(io.mantisrx.runtime.source.http.HttpServerProvider) Test(org.junit.Test)

Example 3 with Index

use of io.mantisrx.runtime.source.Index in project mantis by Netflix.

the class HttpSourceImplTest method testResumeOnCompletionButNotOnRemovedServers.

@Test
public void testResumeOnCompletionButNotOnRemovedServers() throws Exception {
    final int maxRepeat = 10;
    final int cutOff = 5;
    final CountDownLatch countGate = new CountDownLatch(localServerProvider.serverSize() * (cutOff - 1));
    final ConcurrentHashMap<ServerInfo, AtomicInteger> resumptionCounts = new ConcurrentHashMap<>();
    final ConcurrentHashMap<ServerInfo, AtomicInteger> counterPerServer = new ConcurrentHashMap<>();
    for (Server server : localServerProvider.getServers()) {
        ServerInfo serverInfo = toServerInfo(server);
        resumptionCounts.put(serverInfo, new AtomicInteger(0));
        counterPerServer.put(serverInfo, new AtomicInteger(0));
    }
    HttpSourceImpl<ByteBuf, ByteBuf, ServerContext<ByteBuf>> source = createSingleEntitySource(new ClientResumePolicy<ByteBuf, ByteBuf>() {

        @Override
        public Observable<HttpClientResponse<ByteBuf>> onError(ServerClientContext<ByteBuf, ByteBuf> clientContext, int attempts, Throwable error) {
            return null;
        }

        @Override
        public Observable<HttpClientResponse<ByteBuf>> onCompleted(ServerClientContext<ByteBuf, ByteBuf> clientContext, int attempts) {
            resumptionCounts.get(clientContext.getServer()).incrementAndGet();
            countGate.countDown();
            if (attempts < maxRepeat) {
                return clientContext.newResponse();
            } else {
                return null;
            }
        }
    });
    final AtomicInteger counter = new AtomicInteger();
    final CountDownLatch done = new CountDownLatch(1);
    Observable.merge(source.call(new Context(), new Index(1, 1))).map(new Func1<ServerContext<ByteBuf>, ServerContext<String>>() {

        @Override
        public ServerContext<String> call(ServerContext<ByteBuf> pair) {
            return new ServerContext<>(pair.getServer(), pair.getValue().toString(Charset.defaultCharset()));
        }
    }).doOnNext(new Action1<ServerContext<String>>() {

        @Override
        public void call(ServerContext<String> context) {
            counter.incrementAndGet();
            assertEquals(RequestProcessor.SINGLE_ENTITY_RESPONSE, context.getValue());
            ServerInfo server = context.getServer();
            counterPerServer.get(server).incrementAndGet();
            if (counterPerServer.get(server).get() > cutOff) {
                localServerProvider.removeServer(server);
            }
        }
    }).doOnError(new Action1<Throwable>() {

        @Override
        public void call(Throwable throwable) {
            fail("Unexpected failure: " + throwable);
        }
    }).doAfterTerminate(new Action0() {

        @Override
        public void call() {
            try {
                countGate.await();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            done.countDown();
        }
    }).subscribe();
    long wait = 5;
    if (!done.await(wait, TimeUnit.SECONDS)) {
        fail(String.format("All streaming should be done within %d seconds. ", wait));
    }
    assertEquals("All server should be resumed", localServerProvider.serverSize(), resumptionCounts.size());
    for (ServerInfo server : resumptionCounts.keySet()) {
        assertTrue(String.format("The server %s:%s should be resumed fewer than %d times", server.getHost(), server.getPort(), maxRepeat), maxRepeat > resumptionCounts.get(server).get());
    }
    assertTrue(String.format("There should be at least %d response from each of the %d servers", cutOff + 1, localServerProvider.serverSize()), (cutOff + 1) * localServerProvider.serverSize() <= counter.get());
    for (Server server : localServerProvider.getServers()) {
        ServerInfo serverInfo = toServerInfo(server);
        assertEquals("There should be no error", 0, sourceObserver.getCount(serverInfo, EventType.SUBSCRIPTION_FAILED));
    }
    assertEquals(String.format("There are %d repeats, but there should be only one final completion", maxRepeat - 1), 1, sourceObserver.getCompletionCount());
    assertEquals("There should be no error", 0, sourceObserver.getErrorCount());
    Set<EventType> events = sourceObserver.getEvents();
    Set<EventType> expectedEvents = new HashSet<>();
    expectedEvents.addAll(Arrays.asList(EventType.SUBSCRIPTION_CANCELED, EventType.SERVER_FOUND, EventType.CONNECTION_ATTEMPTED, EventType.CONNECTION_ESTABLISHED, EventType.SUBSCRIPTION_ESTABLISHED, EventType.SOURCE_COMPLETED, EventType.SUBSCRIPTION_ENDED, EventType.CONNECTION_UNSUBSCRIBED));
    assertEquals(expectedEvents, events);
    assertEquals("Each connection should be unsubscribed once by the subscriber", localServerProvider.serverSize(), sourceObserver.getEventCount(CONNECTION_UNSUBSCRIBED));
    for (EventType eventType : new EventType[] { EventType.SOURCE_COMPLETED, EventType.SUBSCRIPTION_ESTABLISHED, EventType.CONNECTION_ATTEMPTED, EventType.CONNECTION_ESTABLISHED }) {
        assertTrue(String.format("Event %s should be recorded at least %d times per server", eventType, cutOff), (cutOff + 1) * localServerProvider.serverSize() <= sourceObserver.getEventCount(eventType));
    }
    for (EventType eventType : new EventType[] { EventType.SERVER_FOUND, EventType.SUBSCRIPTION_CANCELED }) {
        assertEquals(String.format("Event %s should be recorded exactly once per server", eventType), localServerProvider.serverSize(), sourceObserver.getEventCount(eventType));
    }
}
Also used : Server(io.mantisrx.runtime.source.http.LocalServerProvider.Server) EventType(io.mantisrx.runtime.source.http.impl.HttpSourceImpl.HttpSourceEvent.EventType) ServerInfo(mantis.io.reactivex.netty.client.RxClient.ServerInfo) Index(io.mantisrx.runtime.source.Index) ByteBuf(io.netty.buffer.ByteBuf) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashSet(java.util.HashSet) Context(io.mantisrx.runtime.Context) Action0(rx.functions.Action0) Action1(rx.functions.Action1) CountDownLatch(java.util.concurrent.CountDownLatch) Observable(rx.Observable) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Test(org.junit.Test)

Example 4 with Index

use of io.mantisrx.runtime.source.Index in project mantis by Netflix.

the class HttpSourceImplTest method testResumeOnCompletion.

@Test
public void testResumeOnCompletion() throws Exception {
    final int maxRepeat = 10;
    final CountDownLatch countGate = new CountDownLatch(maxRepeat * localServerProvider.serverSize());
    HttpSourceImpl<ByteBuf, ByteBuf, ServerContext<ByteBuf>> source = createSingleEntitySource(new ClientResumePolicy<ByteBuf, ByteBuf>() {

        @Override
        public Observable<HttpClientResponse<ByteBuf>> onError(ServerClientContext<ByteBuf, ByteBuf> clientContext, int attempts, Throwable error) {
            return null;
        }

        @Override
        public Observable<HttpClientResponse<ByteBuf>> onCompleted(ServerClientContext<ByteBuf, ByteBuf> clientContext, int attempts) {
            countGate.countDown();
            if (attempts < maxRepeat) {
                return clientContext.newResponse();
            } else {
                return null;
            }
        }
    });
    final AtomicInteger counter = new AtomicInteger();
    final CountDownLatch done = new CountDownLatch(1);
    Observable.merge(source.call(new Context(), new Index(1, 1))).map(new Func1<ServerContext<ByteBuf>, ServerContext<String>>() {

        @Override
        public ServerContext<String> call(ServerContext<ByteBuf> pair) {
            try {
                return new ServerContext<>(pair.getServer(), pair.getValue().retain().toString(Charset.defaultCharset()));
            } catch (Throwable e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        }
    }).doOnNext(new Action1<ServerContext<String>>() {

        @Override
        public void call(ServerContext<String> pair) {
            counter.incrementAndGet();
            assertEquals(RequestProcessor.SINGLE_ENTITY_RESPONSE, pair.getValue());
        }
    }).doOnError(new Action1<Throwable>() {

        @Override
        public void call(Throwable throwable) {
            fail("Unexpected failure: " + throwable);
        }
    }).doAfterTerminate(new Action0() {

        @Override
        public void call() {
            try {
                countGate.await();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            done.countDown();
        }
    }).subscribe();
    long wait = 5;
    if (!done.await(5, TimeUnit.SECONDS)) {
        fail(String.format("All streaming should be done within %d seconds. ", wait));
    }
    assertEquals(String.format("There should be exactly %d response from each of the %d servers", maxRepeat, localServerProvider.serverSize()), maxRepeat * localServerProvider.serverSize(), counter.get());
    for (Server server : localServerProvider.getServers()) {
        ServerInfo serverInfo = toServerInfo(server);
        assertEquals(String.format("There should be %d completion per server as resumption function should called %d times", maxRepeat, maxRepeat - 1), maxRepeat, sourceObserver.getCount(serverInfo, EventType.SOURCE_COMPLETED));
        assertEquals("There should be no error", 0, sourceObserver.getCount(serverInfo, EventType.SUBSCRIPTION_FAILED));
        assertEquals(String.format("Connection per server should have been established %d times", maxRepeat), 10, sourceObserver.getCount(serverInfo, EventType.SUBSCRIPTION_ESTABLISHED));
    }
    assertEquals(String.format("There are %d repeats, but there should be only one final completion", maxRepeat - 1), 1, sourceObserver.getCompletionCount());
    assertEquals(0, sourceObserver.getErrorCount());
    Set<EventType> events = sourceObserver.getEvents();
    assertEquals(EXPECTED_EVENTS_SETS, events);
    assertEquals("Each connection should be unsubscribed once by the subscriber", localServerProvider.serverSize(), sourceObserver.getEventCount(CONNECTION_UNSUBSCRIBED));
    for (EventType eventType : new EventType[] { EventType.SOURCE_COMPLETED, EventType.SUBSCRIPTION_ESTABLISHED, EventType.CONNECTION_ATTEMPTED, EventType.CONNECTION_ESTABLISHED }) {
        assertEquals(String.format("Event %s should be recorded exactly %d times per server", eventType, maxRepeat), maxRepeat * localServerProvider.serverSize(), sourceObserver.getEventCount(eventType));
    }
    assertEquals("Event SERVER_FOUND should be recorded exactly once per server", localServerProvider.serverSize(), sourceObserver.getEventCount(EventType.SERVER_FOUND));
}
Also used : Server(io.mantisrx.runtime.source.http.LocalServerProvider.Server) EventType(io.mantisrx.runtime.source.http.impl.HttpSourceImpl.HttpSourceEvent.EventType) ServerInfo(mantis.io.reactivex.netty.client.RxClient.ServerInfo) Index(io.mantisrx.runtime.source.Index) ByteBuf(io.netty.buffer.ByteBuf) Context(io.mantisrx.runtime.Context) Action0(rx.functions.Action0) Action1(rx.functions.Action1) CountDownLatch(java.util.concurrent.CountDownLatch) Observable(rx.Observable) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Test(org.junit.Test)

Example 5 with Index

use of io.mantisrx.runtime.source.Index in project mantis by Netflix.

the class HttpSourceTest method sourceEchoStreamFromPost.

private void sourceEchoStreamFromPost(HttpSource<ServerSentEvent, ServerSentEvent> source, String postContent) throws Exception {
    final AtomicInteger counter = new AtomicInteger();
    final CountDownLatch done = new CountDownLatch(1);
    final ConcurrentHashMap<String, AtomicInteger> result = new ConcurrentHashMap<>();
    Observable.merge(source.call(new Context(), new Index(1, 1))).doOnNext(new Action1<ServerSentEvent>() {

        @Override
        public void call(ServerSentEvent event) {
            counter.incrementAndGet();
            String msg = event.contentAsString();
            result.putIfAbsent(msg, new AtomicInteger());
            result.get(msg).incrementAndGet();
        }
    }).doOnError(new Action1<Throwable>() {

        @Override
        public void call(Throwable throwable) {
            fail("Unexpected failure: " + throwable);
        }
    }).doAfterTerminate(new Action0() {

        @Override
        public void call() {
            done.countDown();
        }
    }).subscribe();
    long waitSeconds = 30000;
    boolean timedout = !done.await(waitSeconds, TimeUnit.SECONDS);
    if (timedout) {
        fail(String.format("Waited at least %d seconds for the test to finish. Something is wrong", waitSeconds));
    }
    Assert.assertEquals(String.format("%d servers => the result has %d times of a single echo", localServerProvider.serverSize(), localServerProvider.serverSize()), localServerProvider.serverSize(), counter.get());
    assertEquals(String.format("%d servers => %d identical copies per message", localServerProvider.serverSize(), localServerProvider.serverSize()), localServerProvider.serverSize(), result.get(postContent).get());
    for (ServerInfo server : localServerProvider.getServerInfos()) {
        assertEquals("There should be one completion per server", 1, sourceObserver.getCount(server, EventType.SOURCE_COMPLETED));
        assertEquals("There should be one un-subscription per server", 1, sourceObserver.getCount(server, EventType.CONNECTION_UNSUBSCRIBED));
        assertEquals("There should be no error", 0, sourceObserver.getCount(server, EventType.SUBSCRIPTION_FAILED));
        assertEquals("There should be one connection per server", 1, sourceObserver.getCount(server, EventType.CONNECTION_ESTABLISHED));
    }
    assertEquals(1, sourceObserver.getCompletionCount());
    assertEquals(0, sourceObserver.getErrorCount());
    Set<EventType> events = sourceObserver.getEvents();
    assertEquals(EXPECTED_EVENTS_SETS, events);
    for (EventType event : events) {
        assertEquals("Each event should be recorded exactly once per server", localServerProvider.serverSize(), sourceObserver.getEventCount(event));
    }
}
Also used : Context(io.mantisrx.runtime.Context) Action0(rx.functions.Action0) Action1(rx.functions.Action1) EventType(io.mantisrx.runtime.source.http.impl.HttpSourceImpl.HttpSourceEvent.EventType) ServerInfo(mantis.io.reactivex.netty.client.RxClient.ServerInfo) ServerSentEvent(mantis.io.reactivex.netty.protocol.http.sse.ServerSentEvent) Index(io.mantisrx.runtime.source.Index) CountDownLatch(java.util.concurrent.CountDownLatch) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap)

Aggregations

Index (io.mantisrx.runtime.source.Index)21 Context (io.mantisrx.runtime.Context)19 CountDownLatch (java.util.concurrent.CountDownLatch)18 Test (org.junit.Test)16 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)14 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)13 ServerInfo (mantis.io.reactivex.netty.client.RxClient.ServerInfo)12 Observable (rx.Observable)11 Action1 (rx.functions.Action1)11 ByteBuf (io.netty.buffer.ByteBuf)10 EventType (io.mantisrx.runtime.source.http.impl.HttpSourceImpl.HttpSourceEvent.EventType)9 Action0 (rx.functions.Action0)8 Server (io.mantisrx.runtime.source.http.LocalServerProvider.Server)7 ServerSentEvent (mantis.io.reactivex.netty.protocol.http.sse.ServerSentEvent)7 Set (java.util.Set)5 NoopRegistry (com.netflix.spectator.api.NoopRegistry)4 KafkaUnit (info.batey.kafka.unit.KafkaUnit)4 KafkaAckable (io.mantisrx.connector.kafka.KafkaAckable)4 KafkaSourceParameters (io.mantisrx.connector.kafka.KafkaSourceParameters)4 ParameterTestUtils (io.mantisrx.connector.kafka.ParameterTestUtils)4