|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.rdf.internal.encoder.IVBindingSetEncoder
public class IVBindingSetEncoder
A utility class for generating and processing compact representations of
IBindingSets whose IConstants are bound to IVs.
Individual IVs may be associated with a cached RDF Value.
Note: This implementation does NOT maintain the IVCache associations.
| Field Summary | |
|---|---|
protected boolean |
filter
true iff this is in support of a DISTINCT filter. |
protected LinkedHashSet<IVariable<?>> |
ivCacheSchema
The set of variables for which materialized IVs have been
observed. |
| Constructor Summary | |
|---|---|
IVBindingSetEncoder(boolean filter)
|
|
| Method Summary | |
|---|---|
IBindingSet |
decodeSolution(byte[] val,
int off,
int len,
boolean resolveCachedValues)
Decode an IBindingSet. |
byte[] |
encodeSolution(IBindingSet bset)
Encode the solution as an IV[], collecting updates for the
internal IV to BigdataValue cache. |
byte[] |
encodeSolution(IBindingSet bset,
boolean updateCache)
Encode the solution as an IV[]. |
void |
flush()
Flush any updates. |
boolean |
isValueCache()
Return true iff the IVCache associations are
preserved by the encoder. |
void |
release()
Release the state associated with the IVBindingSetEncoder. |
void |
resolveCachedValues(IBindingSet bset)
Resolve any IVs in the solution for which there are cached
BigdataValues to those values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final boolean filter
true iff this is in support of a DISTINCT filter.
Note: we do not maintain the ivCacheSchema for a DISTINCT filter
since the original solutions flow through the filter.
protected final LinkedHashSet<IVariable<?>> ivCacheSchema
IVs have been
observed.
| Constructor Detail |
|---|
public IVBindingSetEncoder(boolean filter)
filter - true iff this is in support of a DISTINCT filter.
Note: we do not maintain the ivCacheSchema for a
DISTINCT filter since the original solutions flow through the
filter.
| Method Detail |
|---|
public boolean isValueCache()
true iff the IVCache associations are
preserved by the encoder.
This implementation does not maintain the IVCache associations.
isValueCache in interface IBindingSetDecoderisValueCache in interface IBindingSetEncoderpublic byte[] encodeSolution(IBindingSet bset)
IBindingSetEncoderIV[], collecting updates for the
internal IV to BigdataValue cache.
encodeSolution in interface IBindingSetEncoderbset - The solution to be encoded.
public byte[] encodeSolution(IBindingSet bset,
boolean updateCache)
IBindingSetEncoderIV[].
Note: The IVCache associations may be buffered by this method.
Use IBindingSetEncoder.flush() to vector any buffered associations.
encodeSolution in interface IBindingSetEncoderbset - The solution to be encoded.updateCache - When true, updates are accumulated for the
IV to BigdataValue cache. You must still use
IBindingSetEncoder.flush() to vector the accumulated updates.
If you are only generating the encoding in order to resolve a
key in a hash index, then you would use false
since you do not need to maintain the IVCache
association for the given IBindingSet.
public void flush()
IBindingSetEncoderIVCache associations.
flush in interface IBindingSetEncoder
public IBindingSet decodeSolution(byte[] val,
int off,
int len,
boolean resolveCachedValues)
IBindingSetDecoderIBindingSet.
The resolution step can be deferred when the decoded IBindingSet
does not require the resolved IVCache associations. For example,
we do not need the IVCache association in order to decide if two
IBindingSets can join. However, once we have a solution from a
join, we may need to resolve the IVCache metadata for the joined
solution.
decodeSolution in interface IBindingSetDecoderval - The encoded IV[].off - The starting offset.len - The #of bytes of data to be decoded.resolveCachedValues - When true, any decoded IVs will have
their IVCache association resolved before the
IBindingSet is returned to the caller. When
false, the resolution step is not performed.
IBindingSet.IBindingSetDecoder.resolveCachedValues(IBindingSet)public void resolveCachedValues(IBindingSet bset)
IVs in the solution for which there are cached
BigdataValues to those values. This method may be used to resolve
IVCache associations for IBindingSets NOT produced by
IBindingSetDecoder.decodeSolution(byte[], int, int, boolean). For example, when
joining a decoded solution with another solution, the resolution step may
be deferred until we know whether or not the join was successful.
Note: This implementation is a NOP as the IVCache association
is NOT maintained by this class.
resolveCachedValues in interface IBindingSetDecoderbset - A solution having IVs which need to be reunited with
their cached BigdataValues.public void release()
IBindingSetEncoderIVBindingSetEncoder.
release in interface IBindingSetDecoderrelease in interface IBindingSetEncoder
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||