Class TransactionalSegmentPublisher

java.lang.Object
org.apache.druid.segment.realtime.appenderator.TransactionalSegmentPublisher

public abstract class TransactionalSegmentPublisher extends Object
  • Constructor Details

    • TransactionalSegmentPublisher

      public TransactionalSegmentPublisher()
  • Method Details

    • publishAnnotatedSegments

      public abstract SegmentPublishResult publishAnnotatedSegments(@Nullable Set<DataSegment> segmentsToBeOverwritten, Set<DataSegment> segmentsToPublish, @Nullable Object commitMetadata, @Nullable SegmentSchemaMapping segmentSchemaMapping) throws IOException
      Publish segments, along with some commit metadata, in a single transaction.
      Returns:
      publish result that indicates if segments were published or not. If it is unclear if the segments were published or not, this method must throw an exception. The behavior is similar to IndexerSQLMetadataStorageCoordinator's announceHistoricalSegments.
      Throws:
      IOException - if there was an I/O error when publishing
      RuntimeException - if we cannot tell if the segments were published or not, for some other reason
    • publishSegments

      public final SegmentPublishResult publishSegments(@Nullable Set<DataSegment> segmentsToBeOverwritten, Set<DataSegment> segmentsToPublish, Function<Set<DataSegment>,Set<DataSegment>> outputSegmentsAnnotateFunction, @Nullable Object commitMetadata, @Nullable SegmentSchemaMapping segmentSchemaMapping) throws IOException
      Applies the given annotate function on the segments and tries to publish them. If the action fails with a retryable failure, it can be retried upto MAX_RETRIES times.
      Throws:
      IOException
    • supportsEmptyPublish

      public boolean supportsEmptyPublish()
      Returns:
      true if this publisher has action to take when publishing with an empty segment set. The publisher used by the seekable stream tasks is an example where this is true.