com.bigdata.rdf.load
Class MappedRDFFileLoadTask<S extends MappedRDFDataLoadMaster.JobState,V extends Serializable,L extends ClientLocator>

java.lang.Object
  extended by com.bigdata.service.FederationCallable<U>
      extended by com.bigdata.service.jini.master.AbstractAsynchronousClientTask<Void,V,L>
          extended by com.bigdata.rdf.load.MappedRDFFileLoadTask<S,V,L>
Type Parameters:
S - The generic for the MappedRDFDataLoadMaster.JobState.
V - The generic type of the client state (stored in zookeeper).
All Implemented Interfaces:
IFederationCallable, IAsynchronousClientTask<Void,V>, Serializable, Remote, Callable<Void>

public class MappedRDFFileLoadTask<S extends MappedRDFDataLoadMaster.JobState,V extends Serializable,L extends ClientLocator>
extends AbstractAsynchronousClientTask<Void,V,L>
implements Serializable

Task reads files from the file system, loads them into an ITripleStore, and optionally deletes the source files once they are restart safe on the database. This is a non-transactional bulk load using unisolated writes. This task may be used in conjunction with any process that writes files into a known directory on the hosts of a cluster.

Note: Counters reporting the progress of this task will be attached to the service within which this task is executing.

Note: When loading files from a local file system, this task can not handle the death of the service on which it is running.

Version:
$Id: MappedRDFFileLoadTask.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Field Summary
protected  S jobState
           
protected  L locator
           
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
MappedRDFFileLoadTask(S jobState, INotifyOutcome<V,L> notifyProxy, L locator)
           
 
Method Summary
 void accept(V[] chunk)
          Accept a chunk of resources for processing.
protected  void awaitReady()
          Block until call() has fully initialized the instance of this class running on the IRemoteExecutor.
 Void call()
           
 void close()
          Signal that no new chunks will be tasked to client.
 JiniFederation<?> getFederation()
          The federation object used by the IRemoteExecutor on which this task is executing.
protected  void setUp()
           
 String toString()
           
 
Methods inherited from class com.bigdata.service.jini.master.AbstractAsynchronousClientTask
getFuture, getNotifyProxy, setFuture
 
Methods inherited from class com.bigdata.service.FederationCallable
setFederation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final transient org.apache.log4j.Logger log

jobState

protected final S extends MappedRDFDataLoadMaster.JobState jobState

locator

protected final L extends ClientLocator locator
Constructor Detail

MappedRDFFileLoadTask

public MappedRDFFileLoadTask(S jobState,
                             INotifyOutcome<V,L> notifyProxy,
                             L locator)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getFederation

public JiniFederation<?> getFederation()
The federation object used by the IRemoteExecutor on which this task is executing.

Specified by:
getFederation in interface IFederationCallable
Overrides:
getFederation in class FederationCallable<Void>
Returns:
The federation and never null.

setUp

protected void setUp()
              throws InterruptedException
Throws:
InterruptedException

call

public Void call()
          throws Exception
Specified by:
call in interface Callable<Void>
Throws:
Exception

awaitReady

protected void awaitReady()
                   throws InterruptedException
Block until call() has fully initialized the instance of this class running on the IRemoteExecutor. This method should be used to guard methods on this or derived classes which can be invoked by RMI and which depend on setUp().

Throws:
InterruptedException

accept

public void accept(V[] chunk)
            throws RemoteException,
                   InterruptedException
Description copied from interface: IAsynchronousClientTask
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.

Specified by:
accept in interface IAsynchronousClientTask<Void,V extends Serializable>
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

public void close()
           throws RemoteException,
                  InterruptedException
Description copied from interface: IAsynchronousClientTask
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.

Specified by:
close in interface IAsynchronousClientTask<Void,V extends Serializable>
Throws:
RemoteException - if there is an RMI problem.
InterruptedException - if the client thread accepting the request is interrupted.


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