Package org.apache.pulsar.compaction
Class CompactedTopicImpl
java.lang.Object
org.apache.pulsar.compaction.CompactedTopicImpl
- All Implemented Interfaces:
CompactedTopic
Note: If you want to guarantee that strong consistency between `compactionHorizon` and `compactedTopicContext`,
you need to call getting them method in "synchronized(CompactedTopicImpl){ ... }" lock block.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidasyncReadEntriesOrWait(ManagedCursor cursor, int maxEntries, long bytesToRead, Position maxReadPosition, boolean isFirstRead, AsyncCallbacks.ReadEntriesCallback callback, Consumer consumer) Deprecated.deleteCompactedLedger(long compactedLedgerId) Getter for CompactedTopicContext.newCompactedLedger(Position p, long compactedLedgerId) voidreset()
-
Constructor Details
-
CompactedTopicImpl
-
-
Method Details
-
newCompactedLedger
public CompletableFuture<CompactedTopicContext> newCompactedLedger(Position p, long compactedLedgerId) - Specified by:
newCompactedLedgerin interfaceCompactedTopic
-
deleteCompactedLedger
- Specified by:
deleteCompactedLedgerin interfaceCompactedTopic
-
asyncReadEntriesOrWait
@Deprecated public void asyncReadEntriesOrWait(ManagedCursor cursor, int maxEntries, long bytesToRead, Position maxReadPosition, boolean isFirstRead, AsyncCallbacks.ReadEntriesCallback callback, Consumer consumer) Deprecated.Description copied from interface:CompactedTopicRead entries from compacted topic.- Specified by:
asyncReadEntriesOrWaitin interfaceCompactedTopic
-
getCompactedTopicContext
public Optional<CompactedTopicContext> getCompactedTopicContext() throws ExecutionException, InterruptedException, TimeoutExceptionGetter for CompactedTopicContext.- Returns:
- CompactedTopicContext
- Throws:
ExecutionExceptionInterruptedExceptionTimeoutException
-
readLastEntryOfCompactedLedger
- Specified by:
readLastEntryOfCompactedLedgerin interfaceCompactedTopic
-
getCompactionHorizon
- Specified by:
getCompactionHorizonin interfaceCompactedTopic
-
reset
public void reset() -
getCompactedTopicContextFuture
-