Interface SegmentAllocator


  • public interface SegmentAllocator
    • Method Detail

      • allocate

        @Nullable
        SegmentIdWithShardSpec allocate​(org.apache.druid.data.input.InputRow row,
                                        String sequenceName,
                                        @Nullable
                                        String previousSegmentId,
                                        boolean skipSegmentLineageCheck)
                                 throws IOException
        Allocates a new segment for a given timestamp. Even though its name is "allocate", this method is actually idempotent: given the same sequenceName, previousSegmentId, and skipSegmentLineageCheck, the implementation must return the same segment ID.
        Parameters:
        row - the event which triggered this allocation request
        sequenceName - sequenceName for this allocation
        previousSegmentId - segment identifier returned on the previous call to allocate for your sequenceName. When skipSegmentLineageCheck is false, this can be null if it is the first call for the same sequenceName. When skipSegmentLineageCheck is true, this will be ignored.
        skipSegmentLineageCheck - if false, perform lineage validation using previousSegmentId for this sequence. Should be set to false if replica tasks would index events in same order
        Returns:
        the pending segment identifier, or null if it was impossible to allocate a new segment
        Throws:
        IOException