|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.service.AbstractService
com.bigdata.service.DataService
com.bigdata.service.MetadataService
public abstract class MetadataService
Implementation of a metadata service for a named scale-out index.
| Nested Class Summary | |
|---|---|
static class |
MetadataService.DropScaleOutIndexTask
Drops a scale-out index. |
protected static class |
MetadataService.JoinIndexPartitionTask
Updates the MetadataIndex to reflect the join of 2 or more index
partitions. |
protected static class |
MetadataService.MoveIndexPartitionTask
Updates the MetadataIndex to reflect the move of an index
partition. |
protected static class |
MetadataService.NextPartitionIdTask
Task assigns the next partition identifier for a registered scale-out index in a restart-safe manner. |
static interface |
MetadataService.Options
Options for the MetadataService. |
protected static class |
MetadataService.RegisterScaleOutIndexTask
Registers a metadata index for a named scale-out index and statically partition the index using the given separator keys and data services. |
protected static class |
MetadataService.SplitIndexPartitionTask
Atomic operation removes the pre-existing entry for specified index partition and replaces it with N new entries giving the locators for the N new index partitions created when that index partition was split. |
| Nested classes/interfaces inherited from class com.bigdata.service.DataService |
|---|
DataService.DataServiceFederationDelegate, DataService.DataServiceTransactionManager, DataService.GetIndexMetadataTask, DataService.IDataServiceCounters, DataService.RangeIteratorTask, DataService.ReadBlockCounters |
| Field Summary | |
|---|---|
protected static String |
ERR_DELETE_MARKERS
Error message when a request is made to register a scale-out index but delete markers are not enabled for that index. |
static String |
METADATA_INDEX_NAMESPACE
The namespace for the metadata indices. |
| Fields inherited from class com.bigdata.service.DataService |
|---|
log |
| Constructor Summary | |
|---|---|
protected |
MetadataService(Properties properties)
|
| Method Summary | |
|---|---|
void |
dropScaleOutIndex(String name)
Drop the named scale-out index. |
PartitionLocator |
find(String name,
long timestamp,
byte[] key)
Find and return the partition spanning the given key. |
PartitionLocator |
get(String name,
long timestamp,
byte[] key)
The partition with that separator key or null (exact match
on the separator key). |
static String |
getMetadataIndexName(String name)
Return the name of the metadata index. |
void |
joinIndexPartition(String name,
PartitionLocator[] oldLocators,
PartitionLocator newLocator)
Updates the MetadataIndex for the named scale-out index to
reflect the join of N index partitions (which must be siblings) into a
single index partition. |
void |
moveIndexPartition(String name,
PartitionLocator oldLocator,
PartitionLocator newLocator)
Updates the MetadataIndex for the named scale-out index to
reflect the move of an index partition from one data service to another. |
int |
nextPartitionId(String name)
Return the next unique partition identifier to be assigned to the named scale-out index. |
UUID |
registerScaleOutIndex(IndexMetadata metadata,
byte[][] separatorKeys,
UUID[] dataServices)
Register and statically partition a scale-out index. |
void |
splitIndexPartition(String name,
PartitionLocator oldLocator,
PartitionLocator[] newLocators)
Updates the MetadataIndex for the named scale-out index to
reflect the split of an index partition into N new index partitions. |
MetadataService |
start()
Starts the DataService. |
Future<? extends Object> |
submit(Callable<? extends Object> task)
Note: You SHOULD NOT be running arbitrary tasks on a MetadataService. |
| Methods inherited from class com.bigdata.service.DataService |
|---|
abort, destroy, dropIndex, forceOverflow, getAsynchronousOverflowCounter, getConcurrencyManager, getHTTPDURLFile, getIndexMetadata, getIndexPartitionName, getLocalTransactionManager, getProperties, getResourceManager, getServiceIface, getSession, isOpen, isOverflowActive, newResourceManager, prepare, purgeOldResources, rangeIterator, readBlock, registerIndex, setReleaseTime, shutdown, shutdownNow, singlePhaseCommit, submit, wrapFuture |
| Methods inherited from class com.bigdata.service.AbstractService |
|---|
clearLoggingContext, getFederation, getHostname, getServiceName, getServiceUUID, setServiceUUID, setupLoggingContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.bigdata.service.IDataService |
|---|
dropIndex, forceOverflow, getAsynchronousOverflowCounter, getIndexMetadata, isOverflowActive, purgeOldResources, rangeIterator, readBlock, registerIndex, submit |
| Methods inherited from interface com.bigdata.service.ITxCommitProtocol |
|---|
abort, prepare, setReleaseTime, singlePhaseCommit |
| Methods inherited from interface com.bigdata.service.IService |
|---|
destroy, getHostname, getServiceIface, getServiceName, getServiceUUID |
| Field Detail |
|---|
protected static final String ERR_DELETE_MARKERS
public static final String METADATA_INDEX_NAMESPACE
| Constructor Detail |
|---|
protected MetadataService(Properties properties)
properties - | Method Detail |
|---|
public static String getMetadataIndexName(String name)
name - The name of the scale-out index.
MetadataIndex that is used
to manage the partitions in the named scale-out index.DataService.getIndexPartitionName(String, int)public MetadataService start()
DataServiceDataService.
start in class DataServicepublic Future<? extends Object> submit(Callable<? extends Object> task)
MetadataService. They are specialized for the index partition
locator information and SHOULD NOT be overloaded for other purposes.
submit in interface IDataServicesubmit in interface IRemoteExecutorsubmit in class DataServiceFuture for that task.
ExecutionException
InterruptedExceptionAbstractDistributedFederation.getProxy(Future)
public int nextPartitionId(String name)
throws IOException,
InterruptedException,
ExecutionException
IMetadataService
nextPartitionId in interface IMetadataServicename - The name of the scale-out index.
InterruptedException
ExecutionException
IOException
public PartitionLocator get(String name,
long timestamp,
byte[] key)
throws InterruptedException,
ExecutionException,
IOException
IMetadataServicenull (exact match
on the separator key).
get in interface IMetadataServicename - The name of the scale-out index.key - The separator key (the first key that would go into that
partition).
null.
InterruptedException
ExecutionException
IOException
public PartitionLocator find(String name,
long timestamp,
byte[] key)
throws InterruptedException,
ExecutionException,
IOException
IMetadataService
find in interface IMetadataServicename - The name of the scale-out index.key - A key of interest for the scale-out index.
null if
there are no partitions defined.
InterruptedException
ExecutionException
IOException
public void splitIndexPartition(String name,
PartitionLocator oldLocator,
PartitionLocator[] newLocators)
throws IOException,
InterruptedException,
ExecutionException
IMetadataServiceMetadataIndex for the named scale-out index to
reflect the split of an index partition into N new index partitions. The
old index partition locator is removed from the MetadataIndex and
the new index partition locators are inserted in a single atomic
operation.
splitIndexPartition in interface IMetadataServicename - The name of the scale-out index.oldLocator - The partition locator that is being split.newLocators - The locator information for the new index partitions that were
created by the split of the old index partition.
IOException
InterruptedException
ExecutionException
public void joinIndexPartition(String name,
PartitionLocator[] oldLocators,
PartitionLocator newLocator)
throws IOException,
InterruptedException,
ExecutionException
IMetadataServiceMetadataIndex for the named scale-out index to
reflect the join of N index partitions (which must be siblings) into a
single index partition. The old index partition locators are removed from
the MetadataIndex and the new index partition locator is inserted
in a single atomic operation.
joinIndexPartition in interface IMetadataServicename - The name of the scale-out index.oldLocators - The partition locators for the index partitions that were
joined.newLocator - The locator for the new index partition created by that join.
IOException
InterruptedException
ExecutionException
public void moveIndexPartition(String name,
PartitionLocator oldLocator,
PartitionLocator newLocator)
throws IOException,
InterruptedException,
ExecutionException
IMetadataServiceMetadataIndex for the named scale-out index to
reflect the move of an index partition from one data service to another.
The old index partition locator is removed from the MetadataIndex
and the new index partition locator is inserted in a single atomic
operation.
moveIndexPartition in interface IMetadataServicename - The name of the scale-out index.oldLocator - The partition locator for the source index partition.newLocator - The locator for the target index partition.
IOException
InterruptedException
ExecutionException
public UUID registerScaleOutIndex(IndexMetadata metadata,
byte[][] separatorKeys,
UUID[] dataServices)
throws IOException,
InterruptedException,
ExecutionException
IMetadataService
registerScaleOutIndex in interface IMetadataServicemetadata - The metadata template describing the scale-out index,
including the name to be assigned to that index.separatorKeys - The array of separator keys. Each separator key is interpreted
as an unsigned byte[]. The first entry MUST be an
empty byte[]. The entries MUST be in sorted order.
IOException
InterruptedException
ExecutionException
public void dropScaleOutIndex(String name)
throws IOException,
InterruptedException,
ExecutionException
IMetadataService
dropScaleOutIndex in interface IMetadataServicename - The name of the scale-out index.
IOException
InterruptedException
ExecutionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||