public class SegmentId extends Object implements Comparable<SegmentId>
Modifier and Type | Field and Description |
---|---|
static SegmentId |
NULL
A
null segment id not representing any segment. |
Constructor and Description |
---|
SegmentId(@NotNull SegmentStore store,
long msb,
long lsb)
Create a new segment id without access tracking.
|
SegmentId(@NotNull SegmentStore store,
long msb,
long lsb,
@NotNull Runnable onAccess)
Create a new segment id with access tracking.
|
Modifier and Type | Method and Description |
---|---|
UUID |
asUUID() |
int |
compareTo(@NotNull SegmentId that) |
boolean |
equals(Object object) |
int |
estimateMemoryUsage() |
long |
getCreationTime() |
@NotNull GCGeneration |
getGcGeneration()
Get the underlying segment's gc generation.
|
long |
getLeastSignificantBits() |
long |
getMostSignificantBits() |
@NotNull Segment |
getSegment()
Get the segment identified by this instance.
|
int |
hashCode() |
boolean |
isBulkSegmentId()
Checks whether this is a bulk segment identifier.
|
boolean |
isDataSegmentId()
Checks whether this is a data segment identifier.
|
static boolean |
isDataSegmentId(long lsb)
Checks whether this is a data segment identifier.
|
void |
reclaimed(@NotNull String gcInfo)
Notify this id about the reclamation of its segment (e.g. by
the garbage collector).
|
boolean |
sameStore(@NotNull SegmentStore store)
Determine whether this instance belongs to the passed
store |
String |
toString() |
public static final SegmentId NULL
null
segment id not representing any segment.public SegmentId(@NotNull @NotNull SegmentStore store, long msb, long lsb, @NotNull @NotNull Runnable onAccess)
store
- store this is belongs tomsb
- most significant bits of this idlsb
- least significant bits of this idonAccess
- callback called whenever an underlying and locally memoised segment is accessed.public SegmentId(@NotNull @NotNull SegmentStore store, long msb, long lsb)
store
- store this is belongs tomsb
- most significant bits of this idlsb
- least significant bits of this idpublic static boolean isDataSegmentId(long lsb)
true
for a data segment, false
otherwisepublic boolean isDataSegmentId()
true
for a data segment, false
otherwisepublic boolean isBulkSegmentId()
true
for a bulk segment, false
otherwisepublic long getMostSignificantBits()
public long getLeastSignificantBits()
@NotNull public @NotNull Segment getSegment()
segment
field.loaded(Segment)
,
unloaded()
public void reclaimed(@NotNull @NotNull String gcInfo)
gcInfo
- details about the reclamation. This information
is logged along with the SegmentNotFoundException
when attempting to resolve the segment of this id.public boolean sameStore(@NotNull @NotNull SegmentStore store)
store
store
- true
iff this instance belongs to store
public long getCreationTime()
public UUID asUUID()
@NotNull public @NotNull GCGeneration getGcGeneration()
public int compareTo(@NotNull @NotNull SegmentId that)
compareTo
in interface Comparable<SegmentId>
public int estimateMemoryUsage()
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.