|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.jini.start.ManageLogicalServiceTask<V>
public class ManageLogicalServiceTask<V extends ServiceConfiguration>
Task makes adjusts an imbalance between the serviceCount and the #of logical services (creating or destroying a logical service) and then exits.
ZLock must be broken so that another
service can give it a go., No mechanism is currently defined to reduce the #of logical services
and there are a variety of issues to be considered.
For example, if the target logical data service count is reduced below the actual #of logical data services then we need to identify a logical data service to shutdown (probably one that is lightly used) and shed all index partitions for that data service before it is shutdown, otherwise the data would be lost.
However, some kinds of services do not pose any such problem. For
example, it should be trivial to reduce the #of jini registrars that
are running or the #of ClassServers.
In order to destroy a logical service, first set the #of replicas to
zero so that the physical instances will be destroyed (using the
RemoteDestroyAdmin and any other APIs required to insure that
the total system state is preserved). Then delete the logical service
node.
| Field Summary | |
|---|---|
protected List<String> |
children
|
protected V |
config
|
protected String |
configZPath
|
protected static boolean |
DEBUG
|
protected JiniFederation |
fed
|
protected static boolean |
INFO
|
protected IServiceListener |
listener
|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
ManageLogicalServiceTask(JiniFederation fed,
IServiceListener listener,
String configZPath,
List<String> children,
V config)
|
|
| Method Summary | |
|---|---|
Object |
call()
Compare serviceCount to #of logical services. |
protected void |
destroyLogicalService()
Destroy a logical service (must destroy the physical services first, which is complex for data services since index partitions must be shed). |
protected void |
newLogicalService()
Create zpath for the new logical service, create its direct children (the BigdataZooDefs.PHYSICAL_SERVICES_CONTAINER and
BigdataZooDefs.MASTER_ELECTION), and create the
BigdataZooDefs.LOCKS_CREATE_PHYSICAL_SERVICE znode, whose data
contains the zpath of the new logical service. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
protected static final boolean INFO
protected static final boolean DEBUG
protected final JiniFederation fed
protected final IServiceListener listener
protected final String configZPath
protected final List<String> children
protected final V extends ServiceConfiguration config
| Constructor Detail |
|---|
public ManageLogicalServiceTask(JiniFederation fed,
IServiceListener listener,
String configZPath,
List<String> children,
V config)
fed - listener - configZPath - children - config - | Method Detail |
|---|
public Object call()
throws Exception
call in interface CallableException
protected void newLogicalService()
throws org.apache.zookeeper.KeeperException,
InterruptedException
BigdataZooDefs.PHYSICAL_SERVICES_CONTAINER and
BigdataZooDefs.MASTER_ELECTION), and create the
BigdataZooDefs.LOCKS_CREATE_PHYSICAL_SERVICE znode, whose data
contains the zpath of the new logical service.
The creation of the BigdataZooDefs.LOCKS_CREATE_PHYSICAL_SERVICE
child trigger watchers looking for to contend for the right to create a
physical service which is an instance of that logical service. All
service managers contend for that lock. If the winner can satisify the
constraints for that service type (including considering its recent
service load, RAM, disk, etc), and is able to successfully create the
service, then it destroys the lock node. Otherwise it releases the lock
and sleeps a bit. Either it or the other service managers will give it a
try. This will continue until the requirements change or the service is
successfully created somewhere.
Note that this does not find the "best" host for the new service since
there is no global consideration of host scores. However, the load
balancer will adjust the load on the IDataServices which are the
most heavily loaded part of the system.
Note: The ServicesManagerServer is responsible for watching the
BigdataZooDefs.LOCKS_CREATE_PHYSICAL_SERVICE znode. It does that
using a MonitorCreatePhysicalServiceLocksTask task.
InterruptedException
org.apache.zookeeper.KeeperExceptionprotected void destroyLogicalService()
destroyLogicalService() not implemented yet.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||