com.bigdata.service
Interface IMetadataService

All Superinterfaces:
IDataService, IRemoteExecutor, IService, ITxCommitProtocol, Remote
All Known Implementing Classes:
EmbeddedMetadataService, MetadataServer.AdministrableMetadataService, MetadataService

public interface IMetadataService
extends IDataService, Remote

A metadata service for a named index.

The metadata service maintains locator information for the data service instances responsible for each partition in the named index. Partitions are automatically split when they overflow (~200M) and joined when they underflow (~50M).

Note: methods on this interface MUST throw IOException in order to be compatible with RMI.

Version:
$Id: IMetadataService.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

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).
 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.
 
Methods inherited from interface com.bigdata.service.IDataService
dropIndex, forceOverflow, getAsynchronousOverflowCounter, getIndexMetadata, isOverflowActive, purgeOldResources, rangeIterator, readBlock, registerIndex, submit, 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
 

Method Detail

nextPartitionId

int nextPartitionId(String name)
                    throws IOException,
                           InterruptedException,
                           ExecutionException
Return the next unique partition identifier to be assigned to the named scale-out index.

Parameters:
name - The name of the scale-out index.
Returns:
The next partition identifier.
Throws:
ExecutionException
InterruptedException
IOException

splitIndexPartition

void splitIndexPartition(String name,
                         PartitionLocator oldLocator,
                         PartitionLocator[] newLocators)
                         throws IOException,
                                InterruptedException,
                                ExecutionException
Updates the MetadataIndex 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.

Parameters:
name - 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.
Throws:
IOException
InterruptedException
ExecutionException

joinIndexPartition

void joinIndexPartition(String name,
                        PartitionLocator[] oldLocators,
                        PartitionLocator newLocator)
                        throws IOException,
                               InterruptedException,
                               ExecutionException
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. The old index partition locators are removed from the MetadataIndex and the new index partition locator is inserted in a single atomic operation.

Parameters:
name - 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.
Throws:
IOException
InterruptedException
ExecutionException

moveIndexPartition

void moveIndexPartition(String name,
                        PartitionLocator oldLocator,
                        PartitionLocator newLocator)
                        throws IOException,
                               InterruptedException,
                               ExecutionException
Updates the MetadataIndex 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.

Parameters:
name - The name of the scale-out index.
oldLocator - The partition locator for the source index partition.
newLocator - The locator for the target index partition.
Throws:
IOException
InterruptedException
ExecutionException

registerScaleOutIndex

UUID registerScaleOutIndex(IndexMetadata metadata,
                           byte[][] separatorKeys,
                           UUID[] dataServices)
                           throws IOException,
                                  InterruptedException,
                                  ExecutionException
Register and statically partition a scale-out index.

Parameters:
metadata - 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.
dataServiceUUIDs - The array of data services onto which each partition defined by a separator key will be mapped (optional). When given, the #of entries in this array MUST agree with the #of entries in the separatorKeys array and all entries must be non-null. When not given, the index partitions will be auto-assigned to the discovered data services.
Returns:
The UUID of the scale-out index.
Throws:
IOException
InterruptedException
ExecutionException

dropScaleOutIndex

void dropScaleOutIndex(String name)
                       throws IOException,
                              InterruptedException,
                              ExecutionException
Drop the named scale-out index.

Parameters:
name - The name of the scale-out index.
Throws:
IOException
InterruptedException
ExecutionException

get

PartitionLocator get(String name,
                     long timestamp,
                     byte[] key)
                     throws InterruptedException,
                            ExecutionException,
                            IOException
The partition with that separator key or null (exact match on the separator key).

Parameters:
name - The name of the scale-out index.
timestamp -
key - The separator key (the first key that would go into that partition).
Returns:
The partition with that separator key or null.
Throws:
InterruptedException
ExecutionException
IOException

find

PartitionLocator find(String name,
                      long timestamp,
                      byte[] key)
                      throws InterruptedException,
                             ExecutionException,
                             IOException
Find and return the partition spanning the given key.

Parameters:
name - The name of the scale-out index.
timestamp -
key - A key of interest for the scale-out index.
Returns:
The partition spanning the given key or null if there are no partitions defined.
Throws:
InterruptedException
ExecutionException
IOException


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.