|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.proc.AbstractIndexProcedure
com.bigdata.btree.proc.AbstractKeyArrayIndexProcedure
com.bigdata.rdf.spo.SPOIndexWriteProc
public class SPOIndexWriteProc
Procedure for batch index on a single statement index (or index partition).
The key for each statement encodes the {s:p:o} of the statement in the order that is appropriate for the index (SPO, POS, OSP, etc). The key is written unchanged on the index.
The value for each statement is a byte that encodes the StatementEnum
and also encodes whether or not the "override" flag is set using - see
StatementEnum.MASK_OVERRIDE - followed by 8 bytes representing the
statement identifier IFF statement identifiers are enabled AND the
StatementEnum is StatementEnum.Explicit. The value requires
interpretation to determine the byte[] that will be written as the value on
the index - see the code for more details.
Note: This needs to be a custom batch operation using a conditional insert so that we do not write on the index when the data would not be changed and to handle the overflow flag and the optional statement identifier correctly.
| Nested Class Summary | |
|---|---|
static class |
SPOIndexWriteProc.IndexWriteProcConstructor
|
| Nested classes/interfaces inherited from class com.bigdata.btree.proc.AbstractKeyArrayIndexProcedure |
|---|
AbstractKeyArrayIndexProcedure.ResultBitBuffer, AbstractKeyArrayIndexProcedure.ResultBitBufferCounter, AbstractKeyArrayIndexProcedure.ResultBitBufferHandler, AbstractKeyArrayIndexProcedure.ResultBuffer, AbstractKeyArrayIndexProcedure.ResultBufferHandler |
| Field Summary | |
|---|---|
protected boolean |
DEBUG
|
protected boolean |
INFO
|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
|
SPOIndexWriteProc()
De-serialization constructor. |
protected |
SPOIndexWriteProc(IRabaCoder keySer,
IRabaCoder valSer,
int fromIndex,
int toIndex,
byte[][] keys,
byte[][] vals)
|
| Method Summary | |
|---|---|
Object |
apply(IIndex ndx)
Run the procedure. |
protected long |
decodeStatementIdentifier(StatementEnum type,
byte[] val)
Decodes and validate the statement identifier from the value. |
boolean |
isReadOnly()
Return true iff the procedure asserts that it will not
write on the index. |
| Methods inherited from class com.bigdata.btree.proc.AbstractKeyArrayIndexProcedure |
|---|
getKey, getKeyCount, getKeys, getValue, getValues, readExternal, readMetadata, writeExternal, writeMetadata |
| Methods inherited from class com.bigdata.btree.proc.AbstractIndexProcedure |
|---|
getKeyBuilder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final transient org.apache.log4j.Logger log
protected final transient boolean INFO
protected final transient boolean DEBUG
| Constructor Detail |
|---|
public SPOIndexWriteProc()
protected SPOIndexWriteProc(IRabaCoder keySer,
IRabaCoder valSer,
int fromIndex,
int toIndex,
byte[][] keys,
byte[][] vals)
fromIndex - toIndex - keys - vals - | Method Detail |
|---|
public final boolean isReadOnly()
IIndexProceduretrue iff the procedure asserts that it will not
write on the index. When true, the procedure may be run
against a view of the index that is read-only or which allows concurrent
processes to read on the same index object. When false the
procedure will be run against a mutable view of the index (assuming that
the procedure is executed in a context that has access to a mutable index
view).
isReadOnly in interface IIndexProcedurepublic Object apply(IIndex ndx)
IIndexProcedureNote: Unisolated procedures have "auto-commit" ACID properties for a local index only. In order for a distributed procedure to be ACID, the procedure MUST be executed within a fully isolated transaction.
apply in interface IIndexProcedurendx - The index.
Long.
protected long decodeStatementIdentifier(StatementEnum type,
byte[] val)
type - The statement type.val - The value.
StatementEnum.Explicit and statement identifiers are
enabled and otherwise IRawTripleStore.NULL.
RuntimeException - if validation fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||