com.bigdata.rdf.load
Class AbstractRDFTaskFactory<S extends Statement,T extends Runnable>

java.lang.Object
  extended by com.bigdata.rdf.load.AbstractRDFTaskFactory<S,T>
All Implemented Interfaces:
ITaskFactory<T>
Direct Known Subclasses:
RDFLoadTaskFactory, RDFVerifyTaskFactory

public class AbstractRDFTaskFactory<S extends Statement,T extends Runnable>
extends Object
implements ITaskFactory<T>

Factory for tasks for loading RDF resources into a database or validating RDF resources against a database.

Version:
$Id: AbstractRDFTaskFactory.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
TODO:
report the #of resources processed in each case.

Field Summary
protected  AbstractTripleStore db
          The database on which the data will be written.
 boolean deleteAfter
          Delete files after successful processing when true.
 RDFFormat fallback
          An attempt will be made to determine the interchange syntax using RDFFormat.
protected static org.apache.log4j.Logger log
           
 boolean verifyData
          Validation of RDF by the RIO parser is disabled unless this is true.
 
Constructor Summary
protected AbstractRDFTaskFactory(AbstractTripleStore db, boolean verifyData, boolean deleteAfter, RDFFormat fallback, IStatementBufferFactory bufferFactory)
           
 
Method Summary
 long elapsed()
          The elapsed time, counting only the time between notifyStart() and notifyEnd().
 IStatementBufferFactory<S> getBufferFactory()
           
 RDFFormat getRDFFormat(String filename)
          Guess at the RDFFormat.
 T newTask(String resource)
           
 void notifyEnd()
          Notify that the factory is done running tasks (for now).
 void notifyStart()
          Notify that the factory will begin running tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log

db

protected final AbstractTripleStore db
The database on which the data will be written.


fallback

public final RDFFormat fallback
An attempt will be made to determine the interchange syntax using RDFFormat. If no determination can be made then the loader will presume that the files are in the format specified by this parameter (if any). Files whose format can not be determined will be logged as errors.


verifyData

public final boolean verifyData
Validation of RDF by the RIO parser is disabled unless this is true.


deleteAfter

public final boolean deleteAfter
Delete files after successful processing when true.

Constructor Detail

AbstractRDFTaskFactory

protected AbstractRDFTaskFactory(AbstractTripleStore db,
                                 boolean verifyData,
                                 boolean deleteAfter,
                                 RDFFormat fallback,
                                 IStatementBufferFactory bufferFactory)
Method Detail

notifyStart

public void notifyStart()
Notify that the factory will begin running tasks. This sets the beginTime used by elapsed() to report the run time of the tasks.


notifyEnd

public void notifyEnd()
Notify that the factory is done running tasks (for now). This places a cap on the time reported by elapsed().

TODO:
Once we are done loading data the client should be told to flush its counters to the load balancer so that we have the final state snapshot once it is ready.

elapsed

public long elapsed()
The elapsed time, counting only the time between notifyStart() and notifyEnd().


getBufferFactory

public IStatementBufferFactory<S> getBufferFactory()

getRDFFormat

public RDFFormat getRDFFormat(String filename)
Guess at the RDFFormat.

Parameters:
filename - Some filename.
Returns:
The RDFFormat -or- null iff fallback is null and the no format was recognized for the filename

newTask

public T newTask(String resource)
                           throws Exception
Specified by:
newTask in interface ITaskFactory<T extends Runnable>
Throws:
Exception


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