Class SegmentTracker
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.SegmentTracker
-
- All Implemented Interfaces:
SegmentIdProvider
public class SegmentTracker extends Object implements SegmentIdProvider
Tracker of references to segment identifiers and segment instances that are currently kept in memory and factory for creatingSegmentId
instances.
-
-
Constructor Summary
Constructors Constructor Description SegmentTracker(@NotNull SegmentIdFactory segmentIdFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearSegmentIdTables(@NotNull Set<UUID> reclaimed, @NotNull String gcInfo)
Set<SegmentId>
getReferencedSegmentIds()
Returns all segment identifiers that are currently referenced in memory.int
getSegmentIdCount()
@NotNull SegmentId
newBulkSegmentId()
Create and track a new segment id for bulk segments.@NotNull SegmentId
newDataSegmentId()
Create and track a new segment id for data segments.@NotNull SegmentId
newSegmentId(long msb, long lsb)
Get an existingSegmentId
with the givenmsb
andlsb
or create a new one if no such id exists with this tracker.
-
-
-
Constructor Detail
-
SegmentTracker
public SegmentTracker(@NotNull @NotNull SegmentIdFactory segmentIdFactory)
-
-
Method Detail
-
getSegmentIdCount
public int getSegmentIdCount()
- Specified by:
getSegmentIdCount
in interfaceSegmentIdProvider
- Returns:
- The number of distinct segment ids this provider is tracking.
-
getReferencedSegmentIds
public 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 existingSegmentId
with the givenmsb
andlsb
or create a new one if no such id exists with this tracker.- Specified by:
newSegmentId
in interfaceSegmentIdProvider
- Parameters:
msb
- most significant bits of the segment idlsb
- 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 interfaceSegmentIdProvider
- Returns:
- the segment id
-
newBulkSegmentId
@NotNull public @NotNull SegmentId newBulkSegmentId()
Create and track a new segment id for bulk segments.- Specified by:
newBulkSegmentId
in interfaceSegmentIdProvider
- Returns:
- the segment id
-
-