Class GCGeneration
java.lang.Object
org.apache.jackrabbit.oak.segment.file.tar.GCGeneration
Instances of this class represent the garbage collection generation related
information of a segment. It consists of the segment's generation, its full
generation and its compaction flag. The segment's generation records the number
of garbage collection cycles a segment went through and is incremented with
every garbage collection regardless its type. The segment's full generation
records the number of full garbage collection cycles a segment went through.
It is only incremented on full garbage collection cycles. The segment's compaction
flag is set for those segments that have been created by a compaction operation.
It is never set for segments created by normal write operations or defer
compactions triggered by such. Segments written by normal repository writes will
inherit the generation and full generation of the segment written by the previous
compaction process with the compacted flag cleared.
The information recorded in this way allows to determine the reclamation status
of a segment by just looking at the GCGeneration
instances of that segment
and of the segment containing the repository head: Let s
be a segment,
h
be the segment containing the current repository head and n
be
the number of retained generations.
s
is old iffh.generation - s.generation >= n
s
is in the same compaction tail than h iffs.isCompacted && s.fullGeneration == h.fullGeneration
s
is reclaimable iffs
is old ands
is not in the same compaction tail thanh
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionint
compareFullGenerationWith
(@NotNull GCGeneration gcGeneration) Compare this full generation the full generation ofgcGeneration
int
compareWith
(@NotNull GCGeneration gcGeneration) Compare this generation withgcGeneration
boolean
int
int
int
hashCode()
boolean
static GCGeneration
newGCGeneration
(int generation, int fullGeneration, boolean isCompacted) static GCGeneration
newGCGeneration
(SegmentArchiveEntry indexEntry) @NotNull GCGeneration
nextFull()
Create a new instance with the generation and the full generation incremented by one and the compaction flag set.@NotNull GCGeneration
Create a new instance with the compaction flag set and the generation and the full generation left unchanged.@NotNull GCGeneration
nextTail()
Create a new instance with the generation incremented by one, the full generation left unchanged and the compaction flag set.@NotNull GCGeneration
nonGC()
Create a new instance with the compaction flag unset and the generation and the full generation left unchanged.toString()
-
Field Details
-
NULL
-
-
Method Details
-
newGCGeneration
-
newGCGeneration
-
getGeneration
public int getGeneration() -
getFullGeneration
public int getFullGeneration() -
isCompacted
public boolean isCompacted() -
nextFull
Create a new instance with the generation and the full generation incremented by one and the compaction flag set. -
nextTail
Create a new instance with the generation incremented by one, the full generation left unchanged and the compaction flag set. -
nextPartial
Create a new instance with the compaction flag set and the generation and the full generation left unchanged. -
nonGC
Create a new instance with the compaction flag unset and the generation and the full generation left unchanged. -
compareWith
Compare this generation withgcGeneration
- Parameters:
gcGeneration
- the generation this generation is compared against.- Returns:
- Number of generations between this generation and
gcGeneration
-
compareFullGenerationWith
Compare this full generation the full generation ofgcGeneration
- Parameters:
gcGeneration
- the generation this generation is compared against.- Returns:
- Number of generations between the full generations of this generation
and
gcGeneration
-
equals
-
hashCode
public int hashCode() -
toString
-