public class MutableRabaCoder extends Object implements IRabaCoder
MutableValueBufferdepending on whether it represents B+Tree keys or values. This class is used by some unit tests as a convenience for establishing a baseline for the performance of
ICodedRabas against the core mutable
IRabaimplementations actually used by
|Constructor and Description|
|Modifier and Type||Method and Description|
Encode the data.
Encode the data, returning an
Return true iff this
public ICodedRaba decode(AbstractFixedByteArrayBuffer data)
IRabawhich can access the coded data. In general, implementations SHOULD NOT materialize a backing byte. Instead, the implementation should access the data in place within the caller's buffer. Frequently used fields MAY be cached, but the whole point of the
IRabaCoderis to minimize the in-memory footprint for the B+Tree by using a coded (aka compressed) representation of the keys and values whenever possible.
public AbstractFixedByteArrayBuffer encode(IRaba raba, DataOutputBuffer buf)
Note: Implementations of this method are typically heavy. While it is
always valid to
IRabaCoder.encode(IRaba, DataOutputBuffer) an
, DO NOT invoke this arbitrarily on data which may already be
ICodedRaba interface will always be implemented for
raba- The data.
buf- A buffer on which the coded data will be written.
public ICodedRaba encodeLive(IRaba raba, DataOutputBuffer buf)
ICodedRaba. Implementations of this method should be optimized for the very common use case where the caller requires immediate access to the coded data record. In that case, many of the
IRabaCoderimplementations can be optimized by passing the underlying decoding object directly into an alternative constructor for the
ICodedRaba. The byte slice for the coded data record is available from
This method covers the vast major of the use cases for coding data, which
is to code B+Tree keys or values for a node or leaf that has been evicted
AbstractBTree's write retention queue. The common use
case is to wrap a coded record that was read from an
IndexSegmentBuilder is a special case, since the coded record
will not be used other than to write it on the disk.
public final boolean isValueCoder()
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.