|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.mdi.PartitionLocator
public class PartitionLocator
An immutable object that may be used to locate an index partition. Instances
of this class are stored as the values in the 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.
MetadataIndex that factors
out the left separator key and which uses prefix compression to only
write the delta for the right separator key over the left separator
key? this would require de-serialization of the partition locator and
then re-serialization in a record format which does not include the
left separator key, but the aggregate space savings could be quite
large. Further space savings could be realized if we simply factored
out both keys in the index but delivered the keys to the client when a
single partition locator was requested. When a key-range of locators is
requested, the space savings again make it worth while to factor out
the left/right keys.| Constructor Summary | |
|---|---|
PartitionLocator()
De-serialization constructor. |
|
PartitionLocator(int partitionId,
UUID logicalDataServiceUUID,
byte[] leftSeparatorKey,
byte[] rightSeparatorKey)
|
|
| Method Summary | |
|---|---|
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()
Return IPartitionMetadata.getPartitionId() |
void |
readExternal(ObjectInput in)
|
String |
toString()
|
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
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).| Method Detail |
|---|
public final int getPartitionId()
IPartitionMetadata
getPartitionId in interface IPartitionMetadatapublic UUID getDataServiceUUID()
public final byte[] getLeftSeparatorKey()
ISeparatorKeysbyte[] since that is the smallest key that may be
defined.
getLeftSeparatorKey in interface ISeparatorKeyspublic final byte[] getRightSeparatorKey()
ISeparatorKeysnull iff the index partition does not have a right sibling
(a null has the semantics of having no upper bound).
getRightSeparatorKey in interface ISeparatorKeyspublic final int hashCode()
IPartitionMetadataIPartitionMetadata.getPartitionId()
hashCode in interface IPartitionMetadatahashCode in class Objectpublic boolean equals(Object o)
equals in class Objectpublic String toString()
toString in class Object
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizableIOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||