public class BlobsWriteProc extends AbstractKeyArrayIndexProcedure<BlobsWriteProc.Result> implements IParallelizableIndexProcedure<BlobsWriteProc.Result>, IMutableRelationIndexWriteProcedure<BlobsWriteProc.Result>
Value
s into the
{termCode,hash(Value),counter}:Value index, assigning IV
s to
Value
s as a side-effect.
Note that it is perfectly possible that a concurrent client will overlap in
the terms being inserted. The results will always be fully consistent if the
rules of the road are observed since (a) unisolated operations are
single-threaded; and (b) IV
s are assigned in an unisolated atomic
operation by BlobsWriteProc
.
Modifier and Type | Class and Description |
---|---|
static class |
BlobsWriteProc.BlobsWriteProcConstructor |
static class |
BlobsWriteProc.Result
Object encapsulates the discovered / assigned
IV s and provides
efficient serialization for communication of those data to the client. |
AbstractKeyArrayIndexProcedure.ResultBitBuffer, AbstractKeyArrayIndexProcedure.ResultBitBufferCounter, AbstractKeyArrayIndexProcedure.ResultBitBufferHandler, AbstractKeyArrayIndexProcedure.ResultBuffer, AbstractKeyArrayIndexProcedure.ResultBufferHandler
Modifier | Constructor and Description |
---|---|
|
BlobsWriteProc()
De-serialization constructor.
|
protected |
BlobsWriteProc(IRabaCoder keySer,
IRabaCoder valSer,
int fromIndex,
int toIndex,
byte[][] keys,
byte[][] vals,
boolean readOnly,
boolean storeBlankNodes) |
Modifier and Type | Method and Description |
---|---|
BlobsWriteProc.Result |
applyOnce(IIndex ndx,
IRaba keys,
IRaba vals)
For each term whose serialized key is mapped to the current index
partition, lookup the term in the terms index.
|
boolean |
isReadOnly()
Return
true iff the procedure asserts that it will not
write on the index. |
boolean |
isToldBNodes() |
protected IResultHandler<BlobsWriteProc.Result,BlobsWriteProc.Result> |
newAggregator()
Split -wise aggregation followed by combining the results across
those splits in order to return an aggregated result whose counters[] is
1:1 with the original keys[][]. |
protected void |
readMetadata(ObjectInput in)
Reads metadata written by
AbstractKeyArrayIndexProcedure.writeMetadata(ObjectOutput) . |
protected void |
writeMetadata(ObjectOutput out)
Writes metadata (not the keys or values, but just other metadata used by
the procedure).
|
apply, getKeys, getKeysCoder, getValues, getValuesCoder, readExternal, writeExternal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply
public BlobsWriteProc()
protected BlobsWriteProc(IRabaCoder keySer, IRabaCoder valSer, int fromIndex, int toIndex, byte[][] keys, byte[][] vals, boolean readOnly, boolean storeBlankNodes)
public final boolean isReadOnly()
IReadOnly
true
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 IReadOnly
public final boolean isToldBNodes()
public BlobsWriteProc.Result applyOnce(IIndex ndx, IRaba keys, IRaba vals)
IV
. Otherwise, note the of terms in the
collision bucket, and insert {hash(term),counter},term} entry into the
terms index.applyOnce
in class AbstractKeyArrayIndexProcedure<BlobsWriteProc.Result>
ndx
- The terms index.BlobsWriteProc.Result
, which contains the discovered / assigned term
identifiers.
TODO There is no point sending bnodes when readOnly and NOT in
told bnodes mode because the caller is unable to unify a blank
node with an entry in the index.protected void readMetadata(ObjectInput in) throws IOException, ClassNotFoundException
AbstractKeyArrayIndexProcedure
AbstractKeyArrayIndexProcedure.writeMetadata(ObjectOutput)
.readMetadata
in class AbstractKeyArrayIndexProcedure<BlobsWriteProc.Result>
IOException
ClassNotFoundException
protected void writeMetadata(ObjectOutput out) throws IOException
The default implementation writes toIndex - fromIndex
,
which is the #of keys.
writeMetadata
in class AbstractKeyArrayIndexProcedure<BlobsWriteProc.Result>
out
- IOException
protected IResultHandler<BlobsWriteProc.Result,BlobsWriteProc.Result> newAggregator()
Split
-wise aggregation followed by combining the results across
those splits in order to return an aggregated result whose counters[] is
1:1 with the original keys[][].newAggregator
in class AbstractKeyArrayIndexProcedure<BlobsWriteProc.Result>
IResultHandler
-or- null
NopAggregator
,
IParallelizableIndexProcedure
,
(Schedule more IOs when loading data)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.