public class BatchPutIfAbsent extends AbstractKeyArrayIndexProcedure<AbstractKeyArrayIndexProcedure.ResultBuffer> implements IParallelizableIndexProcedure<AbstractKeyArrayIndexProcedure.ResultBuffer>
(putIfAbsent)
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
BatchPutIfAbsent.BatchPutIfAbsentConstructor
Factory for
BatchPutIfAbsent procedures. |
AbstractKeyArrayIndexProcedure.ResultBitBuffer, AbstractKeyArrayIndexProcedure.ResultBitBufferCounter, AbstractKeyArrayIndexProcedure.ResultBitBufferHandler, AbstractKeyArrayIndexProcedure.ResultBuffer, AbstractKeyArrayIndexProcedure.ResultBufferHandler
Modifier | Constructor and Description |
---|---|
|
BatchPutIfAbsent()
De-serialization ctor.
|
protected |
BatchPutIfAbsent(IRabaCoder keysCoder,
IRabaCoder valsCoder,
int fromIndex,
int toIndex,
byte[][] keys,
byte[][] vals,
boolean returnOldValues)
Create a batch insert operation.
|
Modifier and Type | Method and Description |
---|---|
AbstractKeyArrayIndexProcedure.ResultBuffer |
applyOnce(IIndex ndx,
IRaba keys,
IRaba vals)
Applies the operator using
ISimpleBTree.putIfAbsent(byte[], byte[]) |
boolean |
getReturnOldValues()
True iff the old values stored under the keys will be returned by
AbstractKeyArrayIndexProcedure.apply(IIndex) . |
boolean |
isReadOnly()
Return
true iff the procedure asserts that it will not
write on the index. |
protected IResultHandler<AbstractKeyArrayIndexProcedure.ResultBuffer,AbstractKeyArrayIndexProcedure.ResultBuffer> |
newAggregator()
Return an
IResultHandler that will be used to combine the results
if the index procedure is parallelized against a local index (including a
scale-out shard). |
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 BatchPutIfAbsent()
protected BatchPutIfAbsent(IRabaCoder keysCoder, IRabaCoder valsCoder, int fromIndex, int toIndex, byte[][] keys, byte[][] vals, boolean returnOldValues)
Batch insert operation of N tuples presented in sorted order. This operation can be very efficient if the tuples are presented sorted by key order.
keys
- A series of keys paired to values. Each key is an variable
length unsigned byte[]. The keys MUST be presented in sorted
order.vals
- An array of values corresponding to those keys. Null elements
are allowed.returnOldValues
- When true
the old values for those keys will be
returned by AbstractKeyArrayIndexProcedure.apply(IIndex)
.BatchInsert.BatchInsertConstructor
public boolean getReturnOldValues()
AbstractKeyArrayIndexProcedure.apply(IIndex)
.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 AbstractKeyArrayIndexProcedure.ResultBuffer applyOnce(IIndex ndx, IRaba keys, IRaba vals)
ISimpleBTree.putIfAbsent(byte[], byte[])
applyOnce
in class AbstractKeyArrayIndexProcedure<AbstractKeyArrayIndexProcedure.ResultBuffer>
ndx
- null
if the old values were not requested
or a AbstractKeyArrayIndexProcedure.ResultBuffer
containing the old values.protected void readMetadata(ObjectInput in) throws IOException, ClassNotFoundException
AbstractKeyArrayIndexProcedure
AbstractKeyArrayIndexProcedure.writeMetadata(ObjectOutput)
.readMetadata
in class AbstractKeyArrayIndexProcedure<AbstractKeyArrayIndexProcedure.ResultBuffer>
IOException
ClassNotFoundException
protected void writeMetadata(ObjectOutput out) throws IOException
AbstractKeyArrayIndexProcedure
The default implementation writes out the AbstractKeyArrayIndexProcedure.getKeysCoder()
and the
AbstractKeyArrayIndexProcedure.getValuesCoder()
.
writeMetadata
in class AbstractKeyArrayIndexProcedure<AbstractKeyArrayIndexProcedure.ResultBuffer>
IOException
protected IResultHandler<AbstractKeyArrayIndexProcedure.ResultBuffer,AbstractKeyArrayIndexProcedure.ResultBuffer> newAggregator()
AbstractKeyArrayIndexProcedure
IResultHandler
that will be used to combine the results
if the index procedure is parallelized against a local index (including a
scale-out shard). If a null
is returned, then the index
procedure WILL NOT be parallelized against the local index. To
parallelize index procedures that do not return anything against a local
index, just use NopAggregator
. A non-null
value will
permit both index local parallelization of the index procedure and (in
scale-out) parallelization of the index procedure across the shards as
well. In order to be parallelized, the index procedure must also be
marked as IParallelizableIndexProcedure
.newAggregator
in class AbstractKeyArrayIndexProcedure<AbstractKeyArrayIndexProcedure.ResultBuffer>
IResultHandler
-or- null
NopAggregator
,
IParallelizableIndexProcedure
,
(Schedule more IOs when loading data)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.