|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.mdi.LocalPartitionMetadata
public class LocalPartitionMetadata
An immutable object providing metadata about a local index partition,
including the partition identifier, the left and right separator keys
defining the half-open key range of the index partition, and optionally
defining the IResourceMetadata[] required to materialize a view of
that index partition.
| Field Summary | |
|---|---|
protected static int |
MAX_HISTORY_LENGTH
Deprecated. |
| Constructor Summary | |
|---|---|
LocalPartitionMetadata()
De-serialization constructor. |
|
LocalPartitionMetadata(int partitionId,
int sourcePartitionId,
byte[] leftSeparatorKey,
byte[] rightSeparatorKey,
IResourceMetadata[] resources,
IndexPartitionCause cause)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
IndexPartitionCause |
getIndexPartitionCause()
The reason why an index partition was created together with some metadata about when it was created. |
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. |
IResourceMetadata[] |
getResources()
Description of the resources required to materialize a view of the index partition (optional, but required for a BTree). |
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 |
getSourcePartitionId()
Deprecated. MoveTask manages without this field (it was required by the previous MOVE implementation). |
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 |
| Field Detail |
|---|
protected static final transient int MAX_HISTORY_LENGTH
Note: The history is written each time the IndexMetadata is
written and is read each time it is read so this can be the main driver
of the size of the IndexMetadata record.
| Constructor Detail |
|---|
public LocalPartitionMetadata()
public LocalPartitionMetadata(int partitionId,
int sourcePartitionId,
byte[] leftSeparatorKey,
byte[] rightSeparatorKey,
IResourceMetadata[] resources,
IndexPartitionCause cause)
partitionId - The unique partition identifier assigned by the
MetadataIndex.sourcePartitionId - -1 unless this index partition is the target
for a move, in which case this is the partition identifier of
the source index partition.leftSeparatorKey - The first key that can enter this index partition. The left
separator key for the first index partition is always
new byte[]{}. The left separator key MAY NOT
be null.rightSeparatorKey - The first key that is excluded from this index partition or
null iff there is no upper bound.resources - A description of each Journal or IndexSegment
resource(s) required to compose a view of the index partition
(optional).
The entries in the array reflect the creation time of the resources. The earliest resource is listed first. The most recently created resource is listed last.
Note: This is required if the LocalPartitionMetadata
record will be saved on the IndexMetadata of a
BTree. It is NOT recommended when it will be saved on
the IndexMetadata of an IndexSegment. When
the IndexMetadata is sent to a remote
DataService this field MUST be null and
the remote DataService will fill it in on arrival.
cause - The underlying cause for the creation of the index partition.| Method Detail |
|---|
public final int getPartitionId()
IPartitionMetadata
getPartitionId in interface IPartitionMetadatapublic final int getSourcePartitionId()
-1 unless this index partition is the target for a move,
in which case this is the partition identifier of the source index
partition and the move operation has not been completed. This property is
used to prevent the target data service from de-defining the index
partition using a split, join or move operation while the MOVE operation
is proceeding. The property is cleared to -1 (which is an
invalid index partition identifier) once the move has been completed
successfully.
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 IResourceMetadata[] getResources()
BTree).
The entries in the array reflect the creation time of the resources. The earliest resource is listed first. The most recently created resource is listed last. The order of the resources corresponds to the order in which a fused view of the index partition will be read. Reads begin with the most "recent" data for the index partition and stop as soon as there is a "hit" on one of the resources (including a hit on a deleted index entry).
When present, the #of sources in the index partition view includes: the
mutable BTree, any BTrees on historical journal(s)
still incorporated into the view, and any IndexSegments
incorporated into the view.
Note: the IResourceMetadata[] is only available when the
LocalPartitionMetadata is attached to the IndexMetadata
of a BTree and is NOT defined when the
LocalPartitionMetadata is attached to an IndexSegment.
The reason is that the index partition view is always described by the
BTree and that view evolves as journals overflow. On the other
hand, IndexSegments are used as resources in index partition
views but exist in a one to many relationship to those views.
public final IndexPartitionCause getIndexPartitionCause()
public 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 | |||||||||