public interface IRelation<E> extends ILocatableResource<IRelation<E>>
IAccessPath
that is most
efficient given an IPredicate
expressing a query against the
IRelation
.Modifier and Type | Method and Description |
---|---|
IAccessPath<E> |
getAccessPath(IIndexManager localIndexManager,
IKeyOrder<E> keyOrder,
IPredicate<E> predicate)
Return the
IAccessPath for an IRelation using the
specified IIndexManager and IKeyOrder (core impl). |
IAccessPath<E> |
getAccessPath(IKeyOrder<E> keyOrder,
IPredicate<E> predicate)
|
IAccessPath<E> |
getAccessPath(IPredicate<E> predicate)
Return the best
IAccessPath for a relation given a predicate with
zero or more unbound variables. |
Class<E> |
getElementClass()
Return the class for the generic type of this relation.
|
ExecutorService |
getExecutorService()
The service used to run asynchronous or parallel tasks for the
IRelation . |
String |
getFQN(IKeyOrder<? extends E> keyOrder)
The fully qualified name of the index.
|
IIndex |
getIndex(IKeyOrder<? extends E> keyOrder)
Return the index for associated with the specified
IKeyOrder this
view of the relation. |
IIndexManager |
getIndexManager()
The
IIndexManager for the IRelation . |
Set<String> |
getIndexNames()
Deprecated.
by
getKeyOrders() . However, note that some odd ball
cases exist such as the free text index of the
LexiconRelation and the justifications index of the
SPORelation . These are currently enumerated by
getIndexNames() but they are not enumerated by
getKeyOrders() since they are not a simple
transform of the original relation. |
IKeyOrder<E> |
getKeyOrder(IPredicate<E> predicate)
Return the
IKeyOrder for the predicate corresponding to the
perfect access path. |
Iterator<IKeyOrder<E>> |
getKeyOrders()
Return the
IKeyOrder s corresponding to the registered indices for
this relation. |
IKeyOrder<E> |
getPrimaryKeyOrder()
Return the
IKeyOrder for the primary index for the relation. |
E |
newElement(List<BOp> args,
IBindingSet bindingSet)
Create and return a new element.
|
getContainerNamespace, getNamespace, getTimestamp, init
IIndexManager getIndexManager()
IIndexManager
for the IRelation
.ExecutorService getExecutorService()
IRelation
.Class<E> getElementClass()
E newElement(List<BOp> args, IBindingSet bindingSet)
args
- An ordered list of variables and/or constants.bindingSet
- A set of bindings.IllegalArgumentException
- if any parameter is null
.IllegalArgumentException
- if any of a is neither an IVariable
nor an
IPredicate
.IllegalStateException
- if there exists a variable which is not bound given those
bindings.Set<String> getIndexNames()
getKeyOrders()
. However, note that some odd ball
cases exist such as the free text index of the
LexiconRelation
and the justifications index of the
SPORelation
. These are currently enumerated by
getIndexNames()
but they are not enumerated by
getKeyOrders()
since they are not a simple
transform of the original relation.IKeyOrder<E> getPrimaryKeyOrder()
IKeyOrder
for the primary index for the relation.Iterator<IKeyOrder<E>> getKeyOrders()
IKeyOrder
s corresponding to the registered indices for
this relation. [rather than getIndexNames?]IKeyOrder<E> getKeyOrder(IPredicate<E> predicate)
IKeyOrder
for the predicate corresponding to the
perfect access path. A perfect access path is one where the bound values
in the predicate form a prefix in the key space of the corresponding
index.p
- The predicate.IKeyOrder
for the perfect access path -or-
null
if there is no index which provides a perfect
access path for that predicate.IAccessPath<E> getAccessPath(IPredicate<E> predicate)
IAccessPath
for a relation given a predicate with
zero or more unbound variables.
If there is an IIndex
that directly corresponds to the natural
order implied by the variable pattern on the predicate then the access
path should use that index. Otherwise you should choose the best index
given the constraints and make sure that the IAccessPath
incorporates additional filters that will allow you to filter out the
irrelevant ITuple
s during the scan - this is very important when
the index is remote!
If there are any IElementFilter
s then the access path MUST
incorporate those constraints such that only elements that satisfy the
constraints may be visited.
Whether the constraints arise because of the lack of a perfect index for
the access path or because they were explicitly specified for the
IPredicate
, those constraints should be translated into
constraints imposed on the underlying ITupleIterator
and sent
with it to be evaluated local to the data.
Note: Filters should be specified when the IAccessPath
is
constructed so that they will be evaluated on the data service rather
than materializing the elements and then filtering then. This can be
accomplished by adding the filter as a constraint on the predicate when
specifying the access path.
predicate
- The constraint on the elements to be visited.IAccessPath
for that IPredicate
.getAccessPath(IKeyOrder, IPredicate)
IAccessPath<E> getAccessPath(IKeyOrder<E> keyOrder, IPredicate<E> predicate)
keyOrder
- Identifies which index to use (required).predicate
- The predicate (required).IAccessPath
.getAccessPath(IIndexManager, IKeyOrder, IPredicate)
IAccessPath<E> getAccessPath(IIndexManager localIndexManager, IKeyOrder<E> keyOrder, IPredicate<E> predicate)
IAccessPath
for an IRelation
using the
specified IIndexManager
and IKeyOrder
(core impl).
AccessPath
is responsible for
interpreting the following IPredicate
IPredicate#Annotations
:
IPredicate.Annotations#ACCESS_PATH_EXPANDER
IIndexManager
when running against a standalone
database. That IIndexManager
is available from
getIndexManager()
.
Scale-out operators
which are
BOpEvaluationContext.SHARDED
or
BOpEvaluationContext.HASHED
require access to the local index
manager on the data service and signal this using:
BOpEvaluationContext.SHARDED
or
BOpEvaluationContext.HASHED
(on a join); andIPredicate.Annotations#PARTITION_ID
(for a shard-wise
access path).
Scale-out operators
MAY use remote access paths and signal
this using:
BOpEvaluationContext.ANY
(on a join); andIPredicate.Annotations#REMOTE_ACCESS_PATH
to
true
.getIndexManager()
is used to obtain the
IBigdataFederation
from which the IRelation
definition
was materialized.localIndexManager
- The local index manager (optional).keyOrder
- Identifies which index to use (required).predicate
- The predicate (required).IAccessPath
.String getFQN(IKeyOrder<? extends E> keyOrder)
keyOrder
- The natural index order.IIndex getIndex(IKeyOrder<? extends E> keyOrder)
IKeyOrder
this
view of the relation.keyOrder
- The natural index order.null
iff the index does not exist as
of the timestamp for this view of the relation.#getIndex(String)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.