public interface IVCache<V extends BigdataValue,T>
BigdataValuecached on an
This interface is designed to support the query plan generator. The
BigdataValue is cached when a query plan decides that the
materialized value is required for a downstream operator.
BigdataValue can cache one another. The pattern
for caching is that you always cache the
IV on the
BigdataValue.setIV(IV). However, the
BigdataValue is normally NOT cached on the
IV. The exception
is when the
BigdataValue has been materialized from the
joining against the lexicon.
|Modifier and Type||Method and Description|
If the value is not already cached, then inflate an inline RDF value to a
Return a copy of this
Cache the materialized
V asValue(LexiconRelation lex) throws java.lang.UnsupportedOperationException
BigdataValueand cache it on a private field.
Note: Query plans are responsible for ensuring that
IVs have been
materialized before operators are evaluated which invoke this method.
This pattern ensures that efficient batch operators are used to
Values, and thereby avoids heavy RMI overhead in
scale-out, and provides operators which use
getValue() with a
simple method signature which does not require access to the lexicon.
Query plans are also responsible for dropping variables once they are no
longer needed or, in the case of large values and BLOBs, dropping the
BigdataValue when possible in order to avoid excess
network and heap overhead.
lex- The lexicon relation (this is required in order to access the
BigdataValueFactoryfor the namespace associated with lexicon when we materialize an inline
java.lang.UnsupportedOperationException- if the
IVdoes not represent something which can be materialized. For example, a dummy value or a "null".
V getValue() throws NotMaterializedException
BigdataValuewhich has been cached on this
IVby a previous invocation of
Note: This method exists to defeat the hard reference from the
to the cached
BigdataValue in order to avoid a memory leak when
IV is used as the key in a weak value cache whose value is
BigdataValue. Therefore, certain
MAY return this when they are used for limited collections. The
vocabulary IVs are the primary example. For the same reason, we do not
need to recursively break the link from the
IV to the
IVs which embed other
truethe cached reference (if any) will NOT be set on the copy.
(Thread-local cache combined with unbounded thread pools causes effective memory leak)
Copyright © 2006-2014 SYSTAP, LLC. All Rights Reserved.