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 creatingSegmentIdinstances.
-
-
Constructor Summary
Constructors Constructor Description SegmentTracker(@NotNull SegmentIdFactory segmentIdFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearSegmentIdTables(@NotNull Set<UUID> reclaimed, @NotNull String gcInfo)Set<SegmentId>getReferencedSegmentIds()Returns all segment identifiers that are currently referenced in memory.intgetSegmentIdCount()@NotNull SegmentIdnewBulkSegmentId()Create and track a new segment id for bulk segments.@NotNull SegmentIdnewDataSegmentId()Create and track a new segment id for data segments.@NotNull SegmentIdnewSegmentId(long msb, long lsb)Get an existingSegmentIdwith the givenmsbandlsbor 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:
getSegmentIdCountin 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 existingSegmentIdwith the givenmsbandlsbor create a new one if no such id exists with this tracker.- Specified by:
newSegmentIdin 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:
newDataSegmentIdin interfaceSegmentIdProvider- Returns:
- the segment id
-
newBulkSegmentId
@NotNull public @NotNull SegmentId newBulkSegmentId()
Create and track a new segment id for bulk segments.- Specified by:
newBulkSegmentIdin interfaceSegmentIdProvider- Returns:
- the segment id
-
-