com.bigdata.service.jini
Class MetadataServer

java.lang.Object
  extended by com.bigdata.service.jini.AbstractServer
      extended by com.bigdata.service.jini.DataServer
          extended by com.bigdata.service.jini.MetadataServer
All Implemented Interfaces:
Runnable, EventListener, net.jini.lease.LeaseListener, net.jini.lookup.ServiceIDListener

public class MetadataServer
extends DataServer

A metadata server.

The metadata server is used to manage the life cycles of scale-out indices and exposes proxies for read and write operations on indices to clients. Clients use index proxies, which automatically direct reads and writes to the IDataService on which specific index partitions are located.

On startup, the metadata service discovers active data services configured in the same group. While running, it tracks when data services start and stop so that it can (re-)allocate index partitions as necessary.

Version:
$Id$
Author:
Bryan Thompson
TODO:
should destroy destroy the service instance or the persistent state as well? Locally, or as replicated?

Nested Class Summary
static class MetadataServer.AdministrableMetadataService
          Adds jini administration interfaces to the basic MetadataService.
static interface MetadataServer.Options
          Options for this server.
 
Nested classes/interfaces inherited from class com.bigdata.service.jini.DataServer
DataServer.AdministrableDataService
 
Nested classes/interfaces inherited from class com.bigdata.service.jini.AbstractServer
AbstractServer.ConfigurationOptions, AbstractServer.MasterElectionTask
 
Field Summary
 
Fields inherited from class com.bigdata.service.jini.AbstractServer
config, impl, logicalServiceZPath, physicalServiceZPath, proxy
 
Constructor Summary
MetadataServer(String[] args, com.sun.jini.start.LifeCycle lifeCycle)
           
 
Method Summary
static void main(String[] args)
          Starts a new MetadataServer.
protected  MetadataService newService(Properties properties)
          This method is responsible for creating the remote service implementation object.
 
Methods inherited from class com.bigdata.service.jini.AbstractServer
destroy, fatal, getClient, getFileFilter, getHostName, getJoinManager, getProxy, getServiceID, getServiceName, isPersistent, isShuttingDown, notify, notifyServiceUUID, readServiceId, run, runDestroy, serviceIDNotify, setSecurityManager, shutdownNow, terminate, toString, unexport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetadataServer

public MetadataServer(String[] args,
                      com.sun.jini.start.LifeCycle lifeCycle)
Parameters:
args - Either the command line arguments or the arguments from the ServiceDescriptor. Either way they identify the jini Configuration (you may specify either a file or URL) and optional overrides for that Configuration.
lifeCycle - The life cycle object. This is used if the server is started by the jini ServiceStarter. Otherwise specify a FakeLifeCycle.
Method Detail

main

public static void main(String[] args)
Starts a new MetadataServer. This can be done programmatically by executing
    new MetadataServer(args,new FakeLifeCycle()).run();
 
within a Thread.

Parameters:
args - The name of the Configuration file for the service.

newService

protected MetadataService newService(Properties properties)
Description copied from class: DataServer
This method is responsible for creating the remote service implementation object. This object MUST declare one or more interfaces that extent the Remote interface. The server will use JERI to create a proxy for the remote object and configure and manage the protocol for communications between the client (service proxy) and the remote object (the service implementation).

Note: You have to implement JoinAdmin in order to show up as an administerable service (blue folder) in the jini Service Browser.

Overridden to setup a delegate that let's us customize some of the federation behaviors on the behalf of the data service.

Overrides:
newService in class DataServer
Parameters:
properties - The contents of the Properties file whose name was given by the propertyFile value in the Configuration identified to main by its command line arguments.


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