com.bigdata.service
Class AbstractFederation.StartDeferredTasksTask

java.lang.Object
  extended by com.bigdata.service.AbstractFederation.StartDeferredTasksTask
All Implemented Interfaces:
Runnable
Enclosing class:
AbstractFederation<T>

protected class AbstractFederation.StartDeferredTasksTask
extends Object
implements Runnable

This task runs periodically. Once AbstractFederation.getServiceUUID() reports a non-null value, it will start an (optional) AbstractStatisticsCollector, an (optional) httpd service, and the (required) AbstractFederation.ReportTask.

Note: The AbstractFederation.ReportTask will relay any collected performance counters to the ILoadBalancerService, but it also lets the ILoadBalancerService know which services exist, which is important for some of its functions.

Once these task(s) have been started, this task will throw an exception in order to prevent it from being re-executed. FIXME This should explicitly await jini registrar discovery, zookeeper client connected, and whatever other preconditions must be statisified before the service can be started.

Version:
$Id: AbstractFederation.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
protected  org.apache.log4j.Logger log
          Note: The logger is named for this class, but since it is an inner class the name uses a "$" delimiter (vs a ".") between the outer and the inner class names.
 
Constructor Summary
AbstractFederation.StartDeferredTasksTask()
           
 
Method Summary
 void run()
           
protected  boolean startDeferredTasks()
          Starts performance counter collection once the service UUID is known.
protected  void startHttpdService()
          Start the local httpd service (if enabled).
protected  void startPerformanceCounterCollection()
          Start collecting performance counters from the OS (if enabled).
protected  void startQueueStatisticsCollection()
          Setup sampling on the client's thread pool.
protected  void startReportTask()
          Start task to report service and counters to the load balancer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.log4j.Logger log
Note: The logger is named for this class, but since it is an inner class the name uses a "$" delimiter (vs a ".") between the outer and the inner class names.

Constructor Detail

AbstractFederation.StartDeferredTasksTask

public AbstractFederation.StartDeferredTasksTask()
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Throws:
RuntimeException - once the deferred task(s) are running to prevent re-execution of this startup task.

startDeferredTasks

protected boolean startDeferredTasks()
                              throws IOException
Starts performance counter collection once the service UUID is known.

Returns:
true iff performance counter collection was started.
Throws:
IOException - if IService.getServiceUUID() throws this exception (it never should since it is a local method call).

startQueueStatisticsCollection

protected void startQueueStatisticsCollection()
Setup sampling on the client's thread pool. This collects interesting statistics about the thread pool for reporting to the load balancer service.


startPerformanceCounterCollection

protected void startPerformanceCounterCollection()
Start collecting performance counters from the OS (if enabled).


startReportTask

protected void startReportTask()
Start task to report service and counters to the load balancer.


startHttpdService

protected void startHttpdService()
                          throws UnsupportedEncodingException
Start the local httpd service (if enabled). The service is started on the IBigdataClient.getHttpdPort(), on a randomly assigned port if the port is 0, or NOT started if the port is -1. If the service is started, then the URL for the service is reported to the load balancer and also written into the file system. When started, the httpd service will be shutdown with the federation.

Throws:
UnsupportedEncodingException


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