com.bigdata.btree.proc
Class BatchRemove

java.lang.Object
  extended by com.bigdata.btree.proc.AbstractIndexProcedure
      extended by com.bigdata.btree.proc.AbstractKeyArrayIndexProcedure
          extended by com.bigdata.btree.proc.BatchRemove
All Implemented Interfaces:
IIndexProcedure, IKeyArrayIndexProcedure, IParallelizableIndexProcedure, Externalizable, Serializable

public class BatchRemove
extends AbstractKeyArrayIndexProcedure
implements IParallelizableIndexProcedure

Batch removal of one or more tuples, optionally returning their existing values.

Version:
$Id: BatchRemove.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Nested Class Summary
static class BatchRemove.BatchRemoveConstructor
          Factory for BatchRemove procedures.
 
Nested classes/interfaces inherited from class com.bigdata.btree.proc.AbstractKeyArrayIndexProcedure
AbstractKeyArrayIndexProcedure.ResultBitBuffer, AbstractKeyArrayIndexProcedure.ResultBitBufferCounter, AbstractKeyArrayIndexProcedure.ResultBitBufferHandler, AbstractKeyArrayIndexProcedure.ResultBuffer, AbstractKeyArrayIndexProcedure.ResultBufferHandler
 
Field Summary
 
Fields inherited from class com.bigdata.btree.proc.AbstractKeyArrayIndexProcedure
DEBUG, log
 
Constructor Summary
  BatchRemove()
          De-serialization ctor.
protected BatchRemove(IRabaCoder keySer, IRabaCoder valSer, int fromIndex, int toIndex, byte[][] keys, boolean assertFound, boolean returnOldValues)
          Batch remove operation.
 
Method Summary
 Object apply(IIndex ndx)
          Applies the operation.
 boolean getAssertFound()
          True iff the procedure will verify that each supplied key was in fact found in the index.
 boolean getReturnOldValues()
          True iff the old values stored under the keys will be returned by apply(IIndex).
 boolean isReadOnly()
          Return true iff the procedure asserts that it will not write on the index.
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).
 
Methods inherited from class com.bigdata.btree.proc.AbstractKeyArrayIndexProcedure
getKey, getKeyCount, getKeys, getValue, getValues, readExternal, writeExternal
 
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
 

Constructor Detail

BatchRemove

public BatchRemove()
De-serialization ctor.


BatchRemove

protected BatchRemove(IRabaCoder keySer,
                      IRabaCoder valSer,
                      int fromIndex,
                      int toIndex,
                      byte[][] keys,
                      boolean assertFound,
                      boolean returnOldValues)
Batch remove operation.

Parameters:
keys - A series of keys paired to values. Each key is an variable length unsigned byte[]. The keys MUST be presented in sorted order.
returnOldValues - When true the old values for those keys will be returned by apply(IIndex).
See Also:
BatchRemove.BatchRemoveConstructor
Method Detail

getAssertFound

public boolean getAssertFound()
True iff the procedure will verify that each supplied key was in fact found in the index.


getReturnOldValues

public boolean getReturnOldValues()
True iff the old values stored under the keys will be returned by apply(IIndex).


isReadOnly

public final boolean isReadOnly()
Description copied from interface: IIndexProcedure
Return 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).

Specified by:
isReadOnly in interface IIndexProcedure

apply

public Object apply(IIndex ndx)
Applies the operation.

Specified by:
apply in interface IIndexProcedure
Parameters:
ndx -
Returns:
The old values as a ResultBuffer iff they were requested.
Throws:
AssertionError - if getAssertFound() is true and a given key was not found in the index.

readMetadata

protected void readMetadata(ObjectInput in)
                     throws IOException,
                            ClassNotFoundException
Description copied from class: AbstractKeyArrayIndexProcedure
Reads metadata written by AbstractKeyArrayIndexProcedure.writeMetadata(ObjectOutput).

Overrides:
readMetadata in class AbstractKeyArrayIndexProcedure
Throws:
IOException
ClassNotFoundException

writeMetadata

protected void writeMetadata(ObjectOutput out)
                      throws IOException
Description copied from class: AbstractKeyArrayIndexProcedure
Writes metadata (not the keys or values, but just other metadata used by the procedure).

The default implementation writes out the #getKeysCoder() and the #getValuesCoder().

Overrides:
writeMetadata in class AbstractKeyArrayIndexProcedure
Throws:
IOException


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