com.bigdata.rdf.spo
Class SPOIndexWriter

java.lang.Object
  extended by com.bigdata.rdf.spo.SPOIndexWriter
All Implemented Interfaces:
Callable<Long>

public class SPOIndexWriter
extends Object
implements Callable<Long>

Helper class writes an ISPO[] on one of the statement indices.

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

Constructor Summary
SPOIndexWriter(SPORelation spoRelation, ISPO[] a, int numStmts, boolean clone, SPOKeyOrder keyOrder, IElementFilter<ISPO> filter, AtomicLong sortTime, AtomicLong insertTime, AtomicLong numWritten)
          Writes statements on a statement index (batch api).
 
Method Summary
 Long call()
          Write the statements on the appropriate statement index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPOIndexWriter

public SPOIndexWriter(SPORelation spoRelation,
                      ISPO[] a,
                      int numStmts,
                      boolean clone,
                      SPOKeyOrder keyOrder,
                      IElementFilter<ISPO> filter,
                      AtomicLong sortTime,
                      AtomicLong insertTime,
                      AtomicLong numWritten)
Writes statements on a statement index (batch api).

Parameters:
statementStore - The store on which the statements will be written.
a - The ISPO[].
numStmts - The #of elements in a to be written.
clone - When true the statements are cloned.

Note:One of the SPOIndexWriters gets to use the caller's array. The others MUST be instructed to clone the caller's array so that they can impose their distinct sort orders.

keyOrder - Identifies the statement index on which to write.
filter - An optional filter.
sortTime - Incremented as a side-effect to report the elapsed time sorting the statements.
insertTime - Incremented as a side-effect to report the elapsed time writing the statements on the statementStore.
numWritten - Incremented as a side-effect to report the #of statements actually written on the SPO index (the counter is only incremented when writing on the SPO index to avoid double counting).
Method Detail

call

public Long call()
          throws Exception
Write the statements on the appropriate statement index.

Note: This method is designed to NOT write on the index unless either the statement is new or the value associated with the statement has been changed. This helps to keep down the IO costs associated with index writes when the data are already in the index.

Specified by:
call in interface Callable<Long>
Returns:
The elapsed time for the operation.
Throws:
Exception


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