|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.jini.start.MonitorCreatePhysicalServiceLocksTask.CreatePhysicalServiceTask
public class MonitorCreatePhysicalServiceLocksTask.CreatePhysicalServiceTask
Task contends for the ZLock. If the lock is obtained, the
ServiceConfiguration is fetched using the zpath written into the
data of the lock node and the service constraints are checked. If the
constraints are satisified by this host, then the task attempts to start
the service. If the service can be started successfully, then the lock
node is destroyed and the task exits. Otherwise the task releases the
lock and sleeps a bit. Either it or another task running on another
ServicesManagerServer will gain the lock and try again. (If the
lock node is invalidated or destroyed, then the task will quit.)
| Field Summary | |
|---|---|
protected String |
lockNodeZPath
The zpath of the lock node. |
| Constructor Summary | |
|---|---|
MonitorCreatePhysicalServiceLocksTask.CreatePhysicalServiceTask(String lockNodeZPath)
|
|
| Method Summary | |
|---|---|
Boolean |
call()
Contends for the ZLock and then invokes
runWithZLock(), which will verify the constraints and
attempt to start the service. |
protected void |
startService(ManagedServiceConfiguration config,
String logicalServiceZPath)
Start the service. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final String lockNodeZPath
| Constructor Detail |
|---|
public MonitorCreatePhysicalServiceLocksTask.CreatePhysicalServiceTask(String lockNodeZPath)
lockNodeZPath - The path to the lock node.lockNodeZPath - | Method Detail |
|---|
public Boolean call()
throws Exception
ZLock and then invokes
runWithZLock(), which will verify the constraints and
attempt to start the service.
Note: If we are unable to create the service while we are holding the lock then we wait a little bit and try again. This covers the case where there are preconditions for the service start which have not been met but which might become satisified at any time.
Note: If the lock node is deleted, then we will exit and return
false.
call in interface Callable<Boolean>true if we started the service.
Exception - if we could not start the service.
protected void startService(ManagedServiceConfiguration config,
String logicalServiceZPath)
throws Exception
config - The service configuration.logicalServiceZPath - The zpath of the logical service.
TimeoutException - if the service did not start within the configured
timeout.
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||