public enum IndexSegmentRegion extends Enum<IndexSegmentRegion>
IndexSegmentStore
.IndexSegmentBuilder
,
IndexSegmentStore
,
IndexSegmentCheckpoint
Enum Constant and Description |
---|
BASE
Offset is relative to the start of the backing file.
|
BLOB
Offset is relative to the start of the blob region.
|
NODE
Offset is relative to the start of the node region.
|
Modifier and Type | Field and Description |
---|---|
protected static long |
NBITS
The #of bits that are used to indicate the
IndexSegmentRegion on an
encoded address. |
Modifier and Type | Method and Description |
---|---|
int |
code() |
static long |
decodeOffset(long encodedOffset)
Return the decoded offset (right-shifts by
NBITS in
order to strip off the bits used to encode the region). |
static IndexSegmentRegion |
decodeRegion(long encodedOffset)
Return the decoded region from an encoded offset.
|
long |
encodeOffset(long offset)
Encode an offset within a region.
|
static IndexSegmentRegion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IndexSegmentRegion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IndexSegmentRegion BASE
Note: The BASE
region runs from the start of the file until the
end of the file and thus overlaps both the NODE
and
BLOB
regions. Any address may be expressed within the
BASE
region.
Note: The leaves are not really their own region, but rather are found
within the BASE
region starting at [leavesOffset] and running
for [leavesExtent] bytes.
public static final IndexSegmentRegion NODE
public static final IndexSegmentRegion BLOB
protected static final long NBITS
IndexSegmentRegion
on an
encoded address. Since the address is encoded in a 64-bit long, the
#of bits available to encode the offset and byteCount of the address
is reduced by this many bits.public static IndexSegmentRegion[] values()
for (IndexSegmentRegion c : IndexSegmentRegion.values()) System.out.println(c);
public static IndexSegmentRegion valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int code()
public long encodeOffset(long offset)
NBITS
and the low bits are set to indicate the region that
identifies the base for the offset.
Note: This effectively reduces the maximum usable offset for the
IndexSegmentStore
by NBITS
offset
- The offset of the allocation.public static IndexSegmentRegion decodeRegion(long encodedOffset)
encodedOffset
- The encoded offset.public static long decodeOffset(long encodedOffset)
NBITS
in
order to strip off the bits used to encode the region). The
returned offset is relative to the encoded region. The caller
MUST adjust the offset appropriately in order to de-reference
the record in the store.encodedOffset
- The encoded offset.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.