public class PartitionLocator extends Object implements IPartitionMetadata, Externalizable
MetadataIndex
.
Note: The ISeparatorKeys.getLeftSeparatorKey()
is always equal to the
key under which the PartitionLocator
is stored in the metadata index.
Likewise, the ISeparatorKeys.getRightSeparatorKey()
is always equal
to the key under which the successor of the index entry is stored (or
null
iff there is no successor). However, the left and right
separator keys are stored explicitly in the values of the metadata index
because it greatly simplifies client operations. While the left
separator key is directly obtainable from the key under which the locator was
stored, the right separator key is much more difficult to obtain in the
various contexts within which the ClientIndexView
requires that
information.
Constructor and Description |
---|
PartitionLocator()
De-serialization constructor.
|
PartitionLocator(int partitionId,
UUID logicalDataServiceUUID,
byte[] leftSeparatorKey,
byte[] rightSeparatorKey) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
UUID |
getDataServiceUUID()
The UUID of the (logical) data service on which the index partition
resides.
|
byte[] |
getLeftSeparatorKey()
The separator key that defines the left edge of that index partition
(always defined) - this is the first key that can enter the index
partition.
|
int |
getPartitionId()
The unique partition identifier.
|
byte[] |
getRightSeparatorKey()
The separator key that defines the right edge of that index partition or
null iff the index partition does not have a right sibling
(a null has the semantics of having no upper bound). |
int |
hashCode()
|
void |
readExternal(ObjectInput in) |
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public PartitionLocator()
public PartitionLocator(int partitionId, UUID logicalDataServiceUUID, byte[] leftSeparatorKey, byte[] rightSeparatorKey)
partitionId
- The unique partition identifier assigned by the
MetadataIndex
.logicalDataServiceUUID
- The ordered array of data service identifiers on which data
for this partition will be written and from which data for
this partition may be read.leftSeparatorKey
- The separator key that defines the left edge of that index
partition (always defined) - this is the first key that can
enter the index partition. The left-most separator key for a
scale-out index is always an empty byte[]
since
that is the smallest key that may be defined.rightSeparatorKey
- The separator key that defines the right edge of that index
partition or null
iff the index partition does
not have a right sibling (a null
has the
semantics of having no upper bound).public final int getPartitionId()
IPartitionMetadata
getPartitionId
in interface IPartitionMetadata
public UUID getDataServiceUUID()
public final byte[] getLeftSeparatorKey()
ISeparatorKeys
byte[]
since that is the smallest key that may be
defined.getLeftSeparatorKey
in interface ISeparatorKeys
public final byte[] getRightSeparatorKey()
ISeparatorKeys
null
iff the index partition does not have a right sibling
(a null
has the semantics of having no upper bound).getRightSeparatorKey
in interface ISeparatorKeys
public final int hashCode()
IPartitionMetadata
hashCode
in interface IPartitionMetadata
hashCode
in class Object
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.