com.bigdata.service
Class ClientService

java.lang.Object
  extended by com.bigdata.service.AbstractService
      extended by com.bigdata.service.ClientService
All Implemented Interfaces:
IClientService, IRemoteExecutor, IService, ISession, Remote
Direct Known Subclasses:
ClientServer.AdministrableClientService

public abstract class ClientService
extends AbstractService
implements IClientService, ISession

A service for distributing application Callables across an IBigdataFederation.

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

Nested Class Summary
static class ClientService.ClientServiceFederationDelegate
          Extended to attach the various performance counters reported by the DistributedTransactionService.
static interface ClientService.Options
          Configuration options.
 
Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
ClientService(Properties properties)
           
 
Method Summary
 Class<? extends IClientService> getServiceIface()
          Returns either IClientService.
 Session getSession()
          A transient and dynamic property set (aka session).
 boolean isOpen()
           
 void shutdown()
           
 void shutdownNow()
           
 AbstractService start()
          Starts the AbstractService.
 Future<? extends Object> submit(Callable<? extends Object> task)
          Note: When the ClientService is accessed via RMI the Future MUST be a proxy.
 
Methods inherited from class com.bigdata.service.AbstractService
clearLoggingContext, destroy, getFederation, getHostname, getServiceName, getServiceUUID, setServiceUUID, setupLoggingContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bigdata.service.IService
destroy, getHostname, getServiceName, getServiceUUID
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Constructor Detail

ClientService

public ClientService(Properties properties)
Method Detail

getSession

public Session getSession()
Description copied from interface: ISession
A transient and dynamic property set (aka session).

Specified by:
getSession in interface ISession

shutdown

public void shutdown()
Overrides:
shutdown in class AbstractService

shutdownNow

public void shutdownNow()
Overrides:
shutdownNow in class AbstractService

isOpen

public final boolean isOpen()

start

public AbstractService start()
Description copied from class: AbstractService
Starts the AbstractService.

Note: A AbstractService.start() is required in order to give subclasses an opportunity to be fully initialized before they are required to begin operations. It is impossible to encapsulate the startup logic cleanly without this ctor() + start() pattern. Those familiar with Objective-C will recognized this.

Specified by:
start in class AbstractService
Returns:
this (the return type should be strengthened by the concrete implementation to return the actual type).

getServiceIface

public Class<? extends IClientService> getServiceIface()
Returns either IClientService.

Specified by:
getServiceIface in interface IService
Specified by:
getServiceIface in class AbstractService

submit

public Future<? extends Object> submit(Callable<? extends Object> task)
Note: When the ClientService is accessed via RMI the Future MUST be a proxy. This gets handled by the concrete server implementation.

Specified by:
submit in interface IRemoteExecutor
Returns:
The Future for that task.
See Also:
AbstractDistributedFederation.getProxy(Future)
TODO:
Map/reduce can be handled in the this manner.

Note that we have excellent locators for the best data service when the map/reduce input is the scale-out repository since the task should run on the data service that hosts the file block(s). When failover is supported, the task can run on the service instance with the least load. When the input is a networked file system, then additional network topology smarts would be required to make good choices., we should probably put the federation object in a sandbox in order to prevent various operations by tasks running in the DataService using the IDataServiceCallable interface to gain access to the DataService's federation. for example, if they use AbstractFederation.shutdownNow() then the DataService itself would be shutdown.



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