public final class GCGeneration extends Object
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 iff h.generation - s.generation >= n
s
is in the same compaction tail than h iff
s.isCompacted && s.fullGeneration == h.fullGeneration
s
is reclaimable iff s
is old and s
is not in the same compaction tail than h
Modifier and Type | Field and Description |
---|---|
static GCGeneration |
NULL |
Modifier and Type | Method and Description |
---|---|
int |
compareFullGenerationWith(@NotNull GCGeneration gcGeneration)
Compare this full generation the full generation of
gcGeneration |
int |
compareWith(@NotNull GCGeneration gcGeneration)
Compare this generation with
gcGeneration |
boolean |
equals(Object other) |
int |
getFullGeneration() |
int |
getGeneration() |
int |
hashCode() |
boolean |
isCompacted() |
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 left unchanged.
|
@NotNull GCGeneration |
nextTail()
Create a new instance with the generation incremented by one and the full
generation and the compaction flag left unchanged.
|
@NotNull GCGeneration |
nonGC()
Create a new instance with the compaction flag unset and the generation and the
full generation left unchanged.
|
String |
toString() |
public static final GCGeneration NULL
public static GCGeneration newGCGeneration(int generation, int fullGeneration, boolean isCompacted)
public static GCGeneration newGCGeneration(SegmentArchiveEntry indexEntry)
public int getGeneration()
public int getFullGeneration()
public boolean isCompacted()
@NotNull public @NotNull GCGeneration nextFull()
@NotNull public @NotNull GCGeneration nextTail()
@NotNull public @NotNull GCGeneration nonGC()
public int compareWith(@NotNull @NotNull GCGeneration gcGeneration)
gcGeneration
gcGeneration
- the generation this generation is compared against.gcGeneration
public int compareFullGenerationWith(@NotNull @NotNull GCGeneration gcGeneration)
gcGeneration
gcGeneration
- the generation this generation is compared against.gcGeneration
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.