com.bigdata.rdf.rio
Interface IAsynchronousWriteStatementBufferFactory<S extends Statement>

All Superinterfaces:
IStatementBufferFactory<S>
All Known Implementing Classes:
AsynchronousStatementBufferFactory

public interface IAsynchronousWriteStatementBufferFactory<S extends Statement>
extends IStatementBufferFactory<S>

Factory interface for asynchronous writers on an ITripleStore.


Method Summary
 void awaitAll()
          Close buffers and then await their Futures.
 void cancelAll(boolean mayInterruptIfRunning)
          Cancel all Futures.
 void close()
          Close the buffers.
 CounterSet getCounters()
          Return performance counters defined by this factory.
 boolean isAnyDone()
          Return true if the Future for any of the asynchronous write buffers is done.
 IStatementBuffer<S> newStatementBuffer()
          Return a new IStatementBuffer which may be used to bulk load RDF data.
 

Method Detail

newStatementBuffer

IStatementBuffer<S> newStatementBuffer()
Return a new IStatementBuffer which may be used to bulk load RDF data. The writes will proceed asynchronously using buffers shared by all IStatementBuffers returned by this factory for a given instance of this class. Each IStatementBuffer MAY be recycled using IBuffer.reset() or simply discarded after its use.

Specified by:
newStatementBuffer in interface IStatementBufferFactory<S extends Statement>

isAnyDone

boolean isAnyDone()
Return true if the Future for any of the asynchronous write buffers is done.

Note: This method should be invoked periodically to verify that no errors have been encountered by the asynchronous write buffers. If this method returns true, invoke awaitAll(), which will detect any error(s), cancel the other Futures, and throw an error back to you.


close

void close()
Close the buffers. Once closed, the buffers will not accept further input and the consumers will eventually drain the buffers and report that they are exhausted.


cancelAll

void cancelAll(boolean mayInterruptIfRunning)
Cancel all Futures. The buffers will be automatically closed when their Futures are canceled.

Parameters:
mayInterruptIfRunning -

awaitAll

void awaitAll()
              throws InterruptedException,
                     ExecutionException
Close buffers and then await their Futures. Once closed, the buffers will not accept further input and the consumers will eventually drain the buffers and report that they are exhausted. The Futures will become available once the iterators are exhausted.

Throws:
ExecutionException - if any Future fails.
InterruptedException - if interrupted while awaiting any of the Futures.

getCounters

CounterSet getCounters()
Return performance counters defined by this factory.



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