|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.clusterconfig.simple.SimpleClusterConfigService
public class SimpleClusterConfigService
Simple Cluster Configuration Service implementation.
ClusterConfigService| Field Summary | |
|---|---|
static java.lang.String |
BUNDLE_ID
bundle id. |
static long |
DEFAULT_FAILSAFETY_LEVEL
default number of nodes that may fail until zookeeper stops to work. |
static long |
DEFAULT_MAX_SCALE_UP
default max scale up is -1 which means: unlimited. |
static long |
DEFAULT_ZK_GC_INTERVAL
default zookeeper garbage collection interval. |
| Constructor Summary | |
|---|---|
SimpleClusterConfigService()
Default Constructor for OSGi DS. |
|
| Method Summary | |
|---|---|
protected void |
activate(ComponentContext context)
OSGi Declarative Services service activation method. |
protected void |
deactivate(ComponentContext context)
OSGi Declarative Services service deactivation method. |
java.util.List<java.lang.String> |
getClusterNodes()
|
long |
getFailSafetyLevel()
|
int |
getHttpPort(java.lang.String serviceName)
Returns a configured http port for a specified service. |
java.lang.String |
getLocalHost()
|
protected long |
getLongPropertyOrSetDefault(AnyMap properties,
java.lang.String key,
long defaultValueToSet)
Looks up the long value with the given key in the givent properties map, if this value is not set, the given defaultvalue will be set. |
protected long |
getLongPropertyOrSetDefault(java.lang.String key,
long defaultValueToSet)
Looks up the long value with the given key, if this value is not set, the given defaultvalue will be set. |
long |
getMaxScaleUp()
|
long |
getWorkerScaleUp(java.lang.String worker)
|
java.util.Collection<java.lang.String> |
getWorkersWithScaleUp()
|
long |
getZkGcInterval()
|
boolean |
isConfigured()
|
protected void |
readConfiguration()
Read the configuration from the configuration file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String BUNDLE_ID
public static final long DEFAULT_ZK_GC_INTERVAL
public static final long DEFAULT_FAILSAFETY_LEVEL
public static final long DEFAULT_MAX_SCALE_UP
| Constructor Detail |
|---|
public SimpleClusterConfigService()
| Method Detail |
|---|
protected void activate(ComponentContext context)
context - OSGi service component context.protected void deactivate(ComponentContext context)
context - OSGi service component context.public java.util.List<java.lang.String> getClusterNodes()
If no cluster nodes are specified, the returned cluster consists of the local host only (as returned by
getLocalHost().
getClusterNodes in interface ClusterConfigServicepublic java.lang.String getLocalHost()
If no name is specified in the configuration, the host name determined by the local InetAddress is
returned.
getLocalHost in interface ClusterConfigServicepublic long getZkGcInterval()
If no value is specified, the default value of 60 is returned.
getZkGcInterval in interface ClusterConfigServicepublic long getFailSafetyLevel()
getFailSafetyLevel in interface ClusterConfigServicepublic boolean isConfigured()
isConfigured in interface ClusterConfigServicepublic long getMaxScaleUp()
If no limit is configured, -1 is returned.
getMaxScaleUp in interface ClusterConfigServicepublic long getWorkerScaleUp(java.lang.String worker)
getWorkerScaleUp in interface ClusterConfigServicepublic java.util.Collection<java.lang.String> getWorkersWithScaleUp()
getWorkersWithScaleUp in interface ClusterConfigServicepublic int getHttpPort(java.lang.String serviceName)
getHttpPort in interface ClusterConfigService
protected long getLongPropertyOrSetDefault(java.lang.String key,
long defaultValueToSet)
key - the key of the propertydefaultValueToSet - the default value
protected long getLongPropertyOrSetDefault(AnyMap properties,
java.lang.String key,
long defaultValueToSet)
key - the key of the propertydefaultValueToSet - the default value
protected void readConfiguration()
throws java.io.IOException
java.io.IOException - error during loading of configuration file.
|
SMILA (incubation) API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||