com.bigdata.rdf.rio
Class AbstractStatementBuffer.StatementBuffer2<F extends Statement,G extends BigdataStatement>

java.lang.Object
  extended by com.bigdata.rdf.rio.AbstractStatementBuffer<F,G>
      extended by com.bigdata.rdf.rio.AbstractStatementBuffer.StatementBuffer2<F,G>
Type Parameters:
F - The generic type of the source Statement added to the buffer by the callers.
G - The generic type of the BigdataStatements stored in the buffer.
All Implemented Interfaces:
IStatementBuffer<F>, IBuffer<F>
Enclosing class:
AbstractStatementBuffer<F extends Statement,G extends BigdataStatement>

public static class AbstractStatementBuffer.StatementBuffer2<F extends Statement,G extends BigdataStatement>
extends AbstractStatementBuffer<F,G>

Loads Statements into an RDF database.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class com.bigdata.rdf.rio.AbstractStatementBuffer
AbstractStatementBuffer.StatementBuffer2<F extends Statement,G extends BigdataStatement>
 
Field Summary
 
Fields inherited from class com.bigdata.rdf.rio.AbstractStatementBuffer
DEBUG, INFO, log, readOnly, statementBuffer
 
Constructor Summary
AbstractStatementBuffer.StatementBuffer2(AbstractTripleStore lexiconStore, AbstractTripleStore statementStore, boolean readOnly, int capacity)
           
AbstractStatementBuffer.StatementBuffer2(AbstractTripleStore lexiconStore, boolean readOnly, int capacity)
           
 
Method Summary
 long flush()
          Converts any buffered statements and any deferred statements and then invokes AbstractStatementBuffer.overflow() to flush anything remaining in the buffer.
 AbstractTripleStore getStatementStore()
          From the ctor.
protected  int handleProcessedStatements(G[] a)
          Writes the Statements onto the getStatementStore().
 
Methods inherited from class com.bigdata.rdf.rio.AbstractStatementBuffer
add, add, add, add, clear, convertValue, getDatabase, getValueFactory, isEmpty, overflow, processBufferedValues, processDeferredStatements, reset, setBNodeMap, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStatementBuffer.StatementBuffer2

public AbstractStatementBuffer.StatementBuffer2(AbstractTripleStore lexiconStore,
                                                boolean readOnly,
                                                int capacity)
Parameters:
lexiconStore - The database against which the Values will be resolved (or added). If this database supports statement identifiers, then statement identifiers for the converted statements will be resolved (or added) to the lexicon.
readOnly - When true, Values (and statement identifiers iff enabled) will be resolved against the LexiconRelation, but entries WILL NOT be inserted into the LexiconRelation for unknown Values (or for statement identifiers for unknown Statements when statement identifiers are enabled).
capacity - The capacity of the backing buffer.

AbstractStatementBuffer.StatementBuffer2

public AbstractStatementBuffer.StatementBuffer2(AbstractTripleStore lexiconStore,
                                                AbstractTripleStore statementStore,
                                                boolean readOnly,
                                                int capacity)
Parameters:
lexiconStore - The database against which the Values will be resolved (or added). If this database supports statement identifiers, then statement identifiers for the converted statements will be resolved (or added) to the lexicon.
statementStore - The database against which the Statements will be resolved (or added).
readOnly - When true, Values (and statement identifiers iff enabled) will be resolved against the LexiconRelation, but entries WILL NOT be inserted into the LexiconRelation for unknown Values (or for statement identifiers for unknown Statements when statement identifiers are enabled). Likewise, when true, Statements will not be written onto the SPORelation.
capacity - The capacity of the backing buffer.
Method Detail

getStatementStore

public AbstractTripleStore getStatementStore()
From the ctor.

Specified by:
getStatementStore in interface IStatementBuffer<F extends Statement>
Overrides:
getStatementStore in class AbstractStatementBuffer<F extends Statement,G extends BigdataStatement>

handleProcessedStatements

protected int handleProcessedStatements(G[] a)
Writes the Statements onto the getStatementStore().

Specified by:
handleProcessedStatements in class AbstractStatementBuffer<F extends Statement,G extends BigdataStatement>
Parameters:
a - An array of processed BigdataStatements.
Returns:
The #of statements actually written on the statement indices.

flush

public long flush()
Description copied from class: AbstractStatementBuffer
Converts any buffered statements and any deferred statements and then invokes AbstractStatementBuffer.overflow() to flush anything remaining in the buffer.

Specified by:
flush in interface IBuffer<F extends Statement>
Overrides:
flush in class AbstractStatementBuffer<F extends Statement,G extends BigdataStatement>
Returns:
The total #of statements written on the getStatementStore(). This will be ZERO (0L) if readOnly == true.


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