public static class CommitLogReaders.LimitedCommitLogReader extends CommitLogReaders.ForwardingCommitLogReader
CommitLogReader.Factory<T extends CommitLogReader>| Modifier and Type | Field and Description |
|---|---|
private java.util.function.Supplier<java.util.List<Partition>> |
availablePartitions |
private ThroughputLimiter |
limiter |
| Constructor and Description |
|---|
LimitedCommitLogReader(CommitLogReader delegate,
ThroughputLimiter limiter) |
| Modifier and Type | Method and Description |
|---|---|
CommitLogReader.Factory<?> |
asFactory()
Convert instance of this reader to
CommitLogReader.Factory suitable for serialization. |
ObserveHandle |
observe(java.lang.String name,
Position position,
LogObserver observer)
Subscribe observer by name to the commit log.
|
ObserveHandle |
observeBulk(java.lang.String name,
Position position,
boolean stopAtCurrent,
LogObserver observer)
Subscribe to the commit log in a bulk fashion.
|
ObserveHandle |
observeBulkOffsets(java.util.Collection<Offset> offsets,
boolean stopAtCurrent,
LogObserver observer)
Consume from given offsets in a bulk fashion.
|
ObserveHandle |
observeBulkPartitions(java.lang.String name,
java.util.Collection<Partition> partitions,
Position position,
boolean stopAtCurrent,
LogObserver observer)
Subscribe to given partitions in a bulk fashion.
|
ObserveHandle |
observePartitions(java.lang.String name,
java.util.Collection<Partition> partitions,
Position position,
boolean stopAtCurrent,
LogObserver observer)
Subscribe to given set of partitions.
|
private static LogObserver |
throughputLimited(ThroughputLimiter readerLimiter,
java.util.Collection<Partition> readerPartitions,
LogObserver delegate) |
java.lang.String |
toString() |
getPartitions, getUri, hasExternalizableOffsetsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitobserve, observeBulk, observeBulk, observeBulkOffsets, observeBulkPartitions, observeBulkPartitions, observeBulkPartitions, observePartitions, observePartitions, observePartitionsprivate final ThroughputLimiter limiter
private final java.util.function.Supplier<java.util.List<Partition>> availablePartitions
public LimitedCommitLogReader(CommitLogReader delegate, ThroughputLimiter limiter)
public ObserveHandle observe(java.lang.String name, Position position, LogObserver observer)
CommitLogReaderobserve in interface CommitLogReaderobserve in class CommitLogReaders.ForwardingCommitLogReadername - identifier of the consumerposition - the position to seek for in the commit logobserver - the observer to subscribe to the commit logObserveHandle to asynchronously cancel the observationpublic ObserveHandle observePartitions(java.lang.String name, java.util.Collection<Partition> partitions, Position position, boolean stopAtCurrent, LogObserver observer)
CommitLogReaderobservePartitions in interface CommitLogReaderobservePartitions in class CommitLogReaders.ForwardingCommitLogReadername - name of the observerpartitions - the list of partitions to subscribe toposition - the position to seek to in the partitionsstopAtCurrent - when true then stop the observer as soon as it reaches most recent
recordobserver - the observer to subscribe to the partitionsObserveHandle to asynchronously cancel the observationpublic ObserveHandle observeBulk(java.lang.String name, Position position, boolean stopAtCurrent, LogObserver observer)
CommitLogReaderobserveBulk in interface CommitLogReaderobserveBulk in class CommitLogReaders.ForwardingCommitLogReadername - name of the observerposition - the position to seek to in the partitionsstopAtCurrent - when true then stop the observer as soon as it reaches most recent
recordobserver - the observer to subscribeObserveHandle to asynchronously cancel the observationpublic ObserveHandle observeBulkPartitions(java.lang.String name, java.util.Collection<Partition> partitions, Position position, boolean stopAtCurrent, LogObserver observer)
CommitLogReaderobserveBulkPartitions in interface CommitLogReaderobserveBulkPartitions in class CommitLogReaders.ForwardingCommitLogReadername - name of the observerpartitions - the partitions to subscribe toposition - the position to seek to in the partitionsstopAtCurrent - when true then stop the observer as soon as it reaches most recent
recordobserver - the observer to subscribe to the partitionsObserveHandle to asynchronously cancel the observationpublic ObserveHandle observeBulkOffsets(java.util.Collection<Offset> offsets, boolean stopAtCurrent, LogObserver observer)
CommitLogReaderCommitLogReader.observeBulkPartitions(java.lang.String, java.util.Collection<cz.o2.proxima.storage.Partition>, cz.o2.proxima.storage.commitlog.Position, cz.o2.proxima.direct.commitlog.LogObserver), observe for some time, than
interrupt the consumption, store associated offsets and resume the consumption from these
offsets laterobserveBulkOffsets in interface CommitLogReaderobserveBulkOffsets in class CommitLogReaders.ForwardingCommitLogReaderoffsets - the @{link Offset}s to subscribe tostopAtCurrent - true if the processing should stop at current offsetsobserver - the observer to subscribe to the offsetsObserveHandle to asynchronously cancel the observationpublic java.lang.String toString()
toString in class CommitLogReaders.ForwardingCommitLogReaderpublic CommitLogReader.Factory<?> asFactory()
CommitLogReaderCommitLogReader.Factory suitable for serialization.asFactory in interface CommitLogReaderasFactory in class CommitLogReaders.ForwardingCommitLogReaderCommitLogReader.Factory representing this readerprivate static LogObserver throughputLimited(ThroughputLimiter readerLimiter, java.util.Collection<Partition> readerPartitions, LogObserver delegate)
Copyright © 2017–2021. All rights reserved.