|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.relation.AbstractResource<IRelation<E>>
com.bigdata.relation.AbstractRelation<IMagicTuple>
com.bigdata.rdf.magic.MagicRelation
public class MagicRelation
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.bigdata.relation.AbstractResource |
|---|
AbstractResource.Options |
| Field Summary | |
|---|---|
protected static boolean |
INFO
|
protected static org.apache.log4j.Logger |
log
|
| Constructor Summary | |
|---|---|
MagicRelation(IIndexManager indexManager,
String namespace,
Long timestamp,
Properties properties)
|
|
| Method Summary | |
|---|---|
void |
create()
Create any logically contained resources (relations, indices). |
long |
delete(IChunkedOrderedIterator<IMagicTuple> itr)
Remove elements from the relation. |
void |
destroy()
Destroy any logically contained resources (relations, indices). |
MagicAccessPath |
getAccessPath(IKeyOrder<IMagicTuple> keyOrder)
|
MagicAccessPath |
getAccessPath(IKeyOrder<IMagicTuple> keyOrder,
IPredicate<IMagicTuple> predicate)
Core impl. |
IAccessPath<IMagicTuple> |
getAccessPath(IPredicate<IMagicTuple> predicate)
Return the best IAccessPath for a relation given a predicate with
zero or more unbound variables. |
int |
getArity()
|
AbstractTripleStore |
getContainer()
Strengthened return type. |
Class<IMagicTuple> |
getElementClass()
Return the class for the generic type of this relation. |
Set<String> |
getIndexNames()
Return the fully qualified name of each index maintained by this relation. |
MagicKeyOrder |
getKeyOrder(IPredicate<IMagicTuple> predicate)
Return the MagicKeyOrder for the given predicate. |
protected MagicKeyOrder[] |
getKeyOrders()
Really need to keep this in the global row store or something to avoid re-calculating all the time. |
protected IndexMetadata |
getMagicTupleIndexMetadata(MagicKeyOrder keyOrder)
|
MagicKeyOrder |
getPrimaryKeyOrder()
|
long |
insert(IChunkedOrderedIterator<IMagicTuple> itr)
Write elements on the relation. |
long |
insert(IMagicTuple[] tuples,
int numTuples)
|
IMagicTuple |
newElement(IPredicate<IMagicTuple> predicate,
IBindingSet bindingSet)
Create and return a new element. |
| Methods inherited from class com.bigdata.relation.AbstractRelation |
|---|
getFQN, getIndex, getIndex, newIndexMetadata |
| Methods inherited from class com.bigdata.relation.AbstractResource |
|---|
acquireExclusiveLock, getChunkCapacity, getChunkOfChunksCapacity, getChunkTimeout, getContainerNamespace, getExecutorService, getFullyBufferedReadThreshold, getIndexManager, getMaxParallelSubqueries, getNamespace, getProperties, getProperty, getProperty, getTimestamp, isForceSerialExecution, isNestedSubquery, toString, unlock |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.bigdata.relation.IRelation |
|---|
getExecutorService, getIndexManager |
| Methods inherited from interface com.bigdata.relation.locator.ILocatableResource |
|---|
getContainerNamespace, getNamespace, getTimestamp |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
protected static final boolean INFO
| Constructor Detail |
|---|
public MagicRelation(IIndexManager indexManager,
String namespace,
Long timestamp,
Properties properties)
| Method Detail |
|---|
public int getArity()
public void create()
IMutableResource
create in interface IMutableResource<IRelation<IMagicTuple>>create in class AbstractResource<IRelation<IMagicTuple>>public void destroy()
IMutableResource
destroy in interface IMutableResource<IRelation<IMagicTuple>>destroy in class AbstractResource<IRelation<IMagicTuple>>protected MagicKeyOrder[] getKeyOrders()
protected IndexMetadata getMagicTupleIndexMetadata(MagicKeyOrder keyOrder)
public long delete(IChunkedOrderedIterator<IMagicTuple> itr)
IMutableRelation
itr - An iterator visiting the elements to be removed. Existing
elements in the relation having a key equal to the key formed
from the visited elements will be removed from the relation.
public long insert(IChunkedOrderedIterator<IMagicTuple> itr)
IMutableRelation
itr - An iterator visiting the elements to be written.
public long insert(IMagicTuple[] tuples,
int numTuples)
public IAccessPath<IMagicTuple> getAccessPath(IPredicate<IMagicTuple> predicate)
IRelationIAccessPath for a relation given a predicate with
zero or more unbound variables.
If there is an IIndex that directly corresponeds 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 ITuples during the scan - this is very important when
the index is remote!
If there are any IElementFilters then the access path MUST
incorporate those constraints such that only elements that satisify 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 evalated 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.public MagicKeyOrder getPrimaryKeyOrder()
public MagicAccessPath getAccessPath(IKeyOrder<IMagicTuple> keyOrder)
public MagicKeyOrder getKeyOrder(IPredicate<IMagicTuple> predicate)
MagicKeyOrder for the given predicate.
predicate - The predicate.
MagicKeyOrder
public MagicAccessPath getAccessPath(IKeyOrder<IMagicTuple> keyOrder,
IPredicate<IMagicTuple> predicate)
Note: This method is NOT cached. See getAccessPath(IPredicate).
keyOrder - The natural order of the selected index (this identifies the
index).predicate - The predicate specifying the query constraint on the access
path.
getAccessPath(keyOrder,filter), where the
filter is optional. This method should cache by the keyOrder, which
implies that we want to either verify or layer on the filter if we will
be reusing the cached access path with different filter values.
The application SHOULD NOT specify both the predicate and the keyOrder since they are less likely to make the right choice, but it is reasonable to specify the keyOrder for bulk copy, dump, and some other modestly low level things and when only a single access path is used, then of course we need to specify that access path (several things use a temporary triple store with only the SPO access path).
public AbstractTripleStore getContainer()
getContainer in class AbstractResource<IRelation<IMagicTuple>>null if there is no container.public Set<String> getIndexNames()
IRelation
public IMagicTuple newElement(IPredicate<IMagicTuple> predicate,
IBindingSet bindingSet)
IRelationISolution for an IRule during either a query or mutation
operations. The element is NOT inserted into the relation.
predicate - The predicate that is the head of some IRule.bindingSet - A set of bindings for that IRule.
public Class<IMagicTuple> getElementClass()
IRelation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||