com.bigdata.service.jini.master
Interface IAsynchronousClientTask<U,V>

Type Parameters:
U - The generic type of the Callable's aggregate result.
V - The generic type of the resources in the chunk.
All Superinterfaces:
Remote
All Known Implementing Classes:
AbstractAsynchronousClientTask, MappedRDFFileLoadTask

public interface IAsynchronousClientTask<U,V>
extends Remote

Interface for remote Callables which process chunks of resources as assigned by the MappedTaskMaster. This interface extends Remote since its methods are invoked using RMI.

Version:
$Id$, $Id$
Author:
Bryan Thompson, Bryan Thompson

Method Summary
 void accept(V[] chunk)
          Accept a chunk of resources for processing.
 void close()
          Signal that no new chunks will be tasked to client.
 Future<U> getFuture()
          Return a proxy for the future of this task (this allows us to have both the proxy for the task and the proxy for its Future).
 

Method Detail

accept

void accept(V[] chunk)
            throws RemoteException,
                   InterruptedException
Accept a chunk of resources for processing. The client may block while it is accepting the chunk, but SHOULD NOT process the resources within this method. For each resource processed, the client MUST notify the master regarding the success or error for that resource. Those notifications are processed asynchronously.

Parameters:
chunk - The chunk of resources to be processed. Each resource is normally a file path, URL, etc.
Throws:
RemoteException - if there is an RMI problem.
InterruptedException - if the client thread accepting the request is interrupted.

close

void close()
           throws RemoteException,
                  InterruptedException
Signal that no new chunks will be tasked to client. The client should flush its asynchronous index write buffers. The main thread should normally remain blocked in Callable.call() until the master interrupts the client using Future.cancel(boolean). However, if all work is complete, then the client MAY interrupt the main thread.

Throws:
RemoteException - if there is an RMI problem.
InterruptedException - if the client thread accepting the request is interrupted.

getFuture

Future<U> getFuture()
                    throws RemoteException
Return a proxy for the future of this task (this allows us to have both the proxy for the task and the proxy for its Future). The Future is required in order to interrupt the client tasks when the MappedTaskMaster terminates.

Throws:
IllegalStateException - if the future has not been set.
RemoteException


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