Interface DatasourceSegmentMetadataReader

All Known Subinterfaces:
DatasourceSegmentCache, SegmentMetadataReadTransaction, SegmentMetadataTransaction
All Known Implementing Classes:
ReadWriteCache

public interface DatasourceSegmentMetadataReader
Performs read operations on the segment metadata for a single datasource.
  • Method Details

    • findExistingSegmentIds

      Set<String> findExistingSegmentIds(Set<SegmentId> segments)
      Retrieves the IDs of segments (out of the given set) which already exist in the metadata store.
    • findUsedSegmentIdsOverlapping

      Set<SegmentId> findUsedSegmentIdsOverlapping(org.joda.time.Interval interval)
      Retrieves IDs of used segments that belong to the datasource and overlap the given interval.
    • findHighestUnusedSegmentId

      @Nullable SegmentId findHighestUnusedSegmentId(org.joda.time.Interval interval, String version)
      Retrieves the ID of the unused segment that has the highest partition number amongst all unused segments that exactly match the given interval and version.
    • findUsedSegmentsOverlappingAnyOf

      Set<DataSegment> findUsedSegmentsOverlappingAnyOf(List<org.joda.time.Interval> intervals)
      Retrieves used segments that overlap with any of the given intervals. If the given list of intervals is empty, all used segments are included in the result.
    • findUsedSegments

      List<DataSegmentPlus> findUsedSegments(Set<SegmentId> segmentIds)
      Retrieves used segments for the given segment IDs.
    • findUsedSegmentsPlusOverlappingAnyOf

      Set<DataSegmentPlus> findUsedSegmentsPlusOverlappingAnyOf(List<org.joda.time.Interval> intervals)
      Retrieves used segments that overlap with any of the given intervals. If the given list of intervals is empty, all used segments are included in the result.
    • findSegment

      @Nullable DataSegment findSegment(SegmentId segmentId)
      Retrieves the segment for the given segment ID.
      Returns:
      null if no such segment exists in the metadata store.
    • findUsedSegment

      @Nullable DataSegment findUsedSegment(SegmentId segmentId)
      Retrieves the used segment for the given segment ID.
      Returns:
      null if no such segment exists in the metadata store.
    • findSegments

      List<DataSegmentPlus> findSegments(Set<SegmentId> segmentIds)
      Retrieves segments for the given segment IDs.
    • findSegmentsWithSchema

      List<DataSegmentPlus> findSegmentsWithSchema(Set<SegmentId> segmentIds)
      Retrieves segments with additional metadata info such as number of rows and schema fingerprint for the given segment IDs.
    • findUnusedSegments

      List<DataSegment> findUnusedSegments(org.joda.time.Interval interval, @Nullable List<String> versions, @Nullable Integer limit, @Nullable org.joda.time.DateTime maxUpdatedTime)
      Retrieves unused segments that are fully contained within the given interval.
      Parameters:
      interval - Returned segments must be fully contained within this interval
      versions - Optional list of segment versions. If passed as null, all segment versions are eligible.
      limit - Maximum number of segments to return. If passed as null, all segments are returned.
      maxUpdatedTime - Returned segments must have a used_status_last_updated which is either null or earlier than this value.
    • findPendingSegmentIds

      List<SegmentIdWithShardSpec> findPendingSegmentIds(String sequenceName, String sequencePreviousId)
      Retrieves pending segment IDs for the given sequence name and previous ID.
    • findPendingSegmentIdsWithExactInterval

      List<SegmentIdWithShardSpec> findPendingSegmentIdsWithExactInterval(String sequenceName, org.joda.time.Interval interval)
      Retrieves pending segment IDs that exactly match the given interval and sequence name.
    • findPendingSegmentsOverlapping

      List<PendingSegmentRecord> findPendingSegmentsOverlapping(org.joda.time.Interval interval)
      Retrieves pending segments overlapping the given interval.
    • findPendingSegmentsWithExactInterval

      List<PendingSegmentRecord> findPendingSegmentsWithExactInterval(org.joda.time.Interval interval)
      Retrieves pending segments whose interval exactly aligns with the given interval.
    • findPendingSegments

      List<PendingSegmentRecord> findPendingSegments(String taskAllocatorId)
      Retrieves pending segments that were allocated for the specified taskAllocatorId.