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();
}
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;
}
Aggregations