Class SegmentTracker

  • All Implemented Interfaces:
    SegmentIdProvider

    public class SegmentTracker
    extends java.lang.Object
    implements SegmentIdProvider
    Tracker of references to segment identifiers and segment instances that are currently kept in memory and factory for creating SegmentId instances.
    • Constructor Detail

      • SegmentTracker

        public SegmentTracker​(@NotNull
                              @NotNull SegmentIdFactory segmentIdFactory)
    • Method Detail

      • getSegmentIdCount

        public int getSegmentIdCount()
        Specified by:
        getSegmentIdCount in interface SegmentIdProvider
        Returns:
        The number of distinct segment ids this provider is tracking.
      • getReferencedSegmentIds

        public java.util.Set<SegmentId> getReferencedSegmentIds()
        Returns all segment identifiers that are currently referenced in memory.
        Returns:
        referenced segment identifiers
      • newSegmentId

        @NotNull
        public @NotNull SegmentId newSegmentId​(long msb,
                                               long lsb)
        Get an existing SegmentId with the given msb and lsb or create a new one if no such id exists with this tracker.
        Specified by:
        newSegmentId in interface SegmentIdProvider
        Parameters:
        msb - most significant bits of the segment id
        lsb - least significant bits of the segment id
        Returns:
        the segment id
      • newDataSegmentId

        @NotNull
        public @NotNull SegmentId newDataSegmentId()
        Create and track a new segment id for data segments.
        Specified by:
        newDataSegmentId in interface SegmentIdProvider
        Returns:
        the segment id
      • newBulkSegmentId

        @NotNull
        public @NotNull SegmentId newBulkSegmentId()
        Create and track a new segment id for bulk segments.
        Specified by:
        newBulkSegmentId in interface SegmentIdProvider
        Returns:
        the segment id
      • clearSegmentIdTables

        public void clearSegmentIdTables​(@NotNull
                                         @NotNull java.util.Set<java.util.UUID> reclaimed,
                                         @NotNull
                                         @NotNull java.lang.String gcInfo)