com.bigdata.jini.start.config
Class MaxServicesPerHostConstraint

java.lang.Object
  extended by com.bigdata.jini.start.config.MaxServicesPerHostConstraint
All Implemented Interfaces:
IServiceConstraint, Serializable
Direct Known Subclasses:
MaxClientServicesPerHostConstraint, MaxDataServicesPerHostConstraint

public abstract class MaxServicesPerHostConstraint
extends Object
implements IServiceConstraint

Places a limit on the #of instances of a service which can be created on the same host. Jini is used to discover the instances of the specified class of service. The constraint is satisified iff the #of discovered instances is less than the maximum.

Note: Since jini does not directly report the hostname of a service, this relies on the Hostname attribute which is placed onto the bigdata service instances.

Note: Since a MetadataService is a DataService, you want to use MetadataServer.AdministrableMetadataService and DataServer.AdministrableDataService to specify the constraints for those services. If you use only IDataService or DataService the constraint will be applied to both and instances of both will be counted against the maximum.

Version:
$Id$
Author:
Bryan Thompson
See Also:
MonitorCreatePhysicalServiceLocksTask, Serialized Form
TODO:
Other kinds of constraints could limit the mixture of services that may run on a host. For example, do not run any other service on a host running zookeeper (or listed as a zookeeper server) or on a host running the MetadataService.

Field Summary
protected static org.apache.log4j.Logger log
           
protected  int maxServices
           
 
Constructor Summary
MaxServicesPerHostConstraint(int maxServices)
           
 
Method Summary
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bigdata.jini.start.config.IServiceConstraint
allow
 

Field Detail

log

protected static final org.apache.log4j.Logger log

maxServices

protected final int maxServices
Constructor Detail

MaxServicesPerHostConstraint

public MaxServicesPerHostConstraint(int maxServices)
Parameters:
maxServices - The maximum #of services which are instances of that class or interface which may run on any given host.
Method Detail

toString

public String toString()
Overrides:
toString in class Object


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