Search in sources :

Example 1 with NakadiCursorComparator

use of org.zalando.nakadi.service.NakadiCursorComparator in project nakadi by zalando.

the class SubscriptionStreamerFactory method build.

public SubscriptionStreamer build(final Subscription subscription, final StreamParameters streamParameters, final SubscriptionOutput output, final AtomicBoolean connectionReady, final BlacklistService blacklistService) throws InternalNakadiException, NoSuchEventTypeException {
    final Session session = Session.generate(1, streamParameters.getPartitions());
    final String loggingPath = "subscription." + subscription.getId() + "." + session.getId();
    // Create streaming context
    return new StreamingContext.Builder().setOut(output).setStreamMemoryLimitBytes(streamMemoryLimitBytes).setParameters(streamParameters).setSession(session).setTimer(executorService).setZkClient(zkClientFactory.createClient(subscription, loggingPath)).setRebalancer(new SubscriptionRebalancer()).setKafkaPollTimeout(kafkaPollTimeout).setLoggingPath(loggingPath).setConnectionReady(connectionReady).setCursorTokenService(cursorTokenService).setObjectMapper(objectMapper).setBlacklistService(blacklistService).setCursorConverter(cursorConverter).setSubscription(subscription).setMetricRegistry(metricRegistry).setTimelineService(timelineService).setWriter(eventStreamWriterProvider.getWriter()).setAuthorizationValidator(authorizationValidator).setEventTypeChangeListener(eventTypeChangeListener).setCursorComparator(new NakadiCursorComparator(eventTypeCache)).setKpiPublisher(nakadiKpiPublisher).setKpiDataStremedEventType(kpiDataStreamedEventType).setKpiCollectionFrequencyMs(kpiCollectionFrequencyMs).build();
}
Also used : NakadiCursorComparator(org.zalando.nakadi.service.NakadiCursorComparator) Session(org.zalando.nakadi.service.subscription.model.Session)

Example 2 with NakadiCursorComparator

use of org.zalando.nakadi.service.NakadiCursorComparator in project nakadi by zalando.

the class TimelineService method createEventConsumer.

public EventConsumer createEventConsumer(@Nullable final String clientId, final List<NakadiCursor> positions) throws NakadiException, InvalidCursorException {
    final MultiTimelineEventConsumer result = new MultiTimelineEventConsumer(clientId, this, timelineSync, new NakadiCursorComparator(eventTypeCache));
    result.reassign(positions);
    return result;
}
Also used : NakadiCursorComparator(org.zalando.nakadi.service.NakadiCursorComparator) MultiTimelineEventConsumer(org.zalando.nakadi.repository.MultiTimelineEventConsumer)

Aggregations

NakadiCursorComparator (org.zalando.nakadi.service.NakadiCursorComparator)2 MultiTimelineEventConsumer (org.zalando.nakadi.repository.MultiTimelineEventConsumer)1 Session (org.zalando.nakadi.service.subscription.model.Session)1