org.imemex.componentmappings.tuple
Class AbstractTupleComponentIndex

java.lang.Object
  extended by org.imemex.componentmappings.tuple.AbstractTupleComponentIndex
All Implemented Interfaces:
ComponentIndex<Tuple>, ComponentKeywordIndex<Tuple>, ComponentMapping<Tuple>, TupleComponentIndex
Direct Known Subclasses:
AbstractDBMSTupleComponentIndex, InMemoryTupleComponentIndex

public abstract class AbstractTupleComponentIndex
extends java.lang.Object
implements TupleComponentIndex

This abstract class provides common functionality for DBMS-based implementations of tuple component indexes.

This class implements the query(Predicate) method.

Author:
marcos

Constructor Summary
AbstractTupleComponentIndex()
           
 
Method Summary
 void finalize()
          On destruction, releases all resources allocated by this instance.
 boolean isEmpty()
          Returns true if this instance does not contain any entries.
 PullOperator<Mapping<Tuple>>[] query(Predicate queryPredicate)
          Central method for providing query functionality on an index.
 PullOperator<Mapping<Tuple>>[] queryByPredicate(Predicate filterCondition, java.lang.String[] returnAttributes)
          TODO: discuss returnAttributes and their relationship to ComponentReplicas.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.imemex.componentmappings.tuple.TupleComponentIndex
insert, queryByAttribute, queryByAttributeComplement, queryByAttributeEqual, queryByAttributeKeyword, queryByAttributeName, queryByAttributeRegex
 
Methods inherited from interface org.imemex.componentmappings.impl.ComponentKeywordIndex
queryByKeyword
 
Methods inherited from interface org.imemex.componentmappings.impl.ComponentIndex
queryByObject
 
Methods inherited from interface org.imemex.componentmappings.impl.ComponentMapping
clear, close, flushMapping, getBufferSize, insert, insertAll, rebuildMapping, remove, removeAll, size
 

Constructor Detail

AbstractTupleComponentIndex

public AbstractTupleComponentIndex()
Method Detail

queryByPredicate

public PullOperator<Mapping<Tuple>>[] queryByPredicate(Predicate filterCondition,
                                                       java.lang.String[] returnAttributes)
                                                throws InvalidPredicateException
Description copied from interface: TupleComponentIndex
TODO: discuss returnAttributes and their relationship to ComponentReplicas. Maybe this method should be moved to a TupleComponentReplica interface. Returns all entries of the given attribute attributeNameRegExp that qualify for the given operator.

Specified by:
queryByPredicate in interface TupleComponentIndex
returnAttributes - the attributes to return in the tuple componet of the returned RV instances.
Returns:
PullOperator of matching RV instances
Throws:
InvalidPredicateException

query

public final PullOperator<Mapping<Tuple>>[] query(Predicate queryPredicate)
                                           throws InvalidPredicateException
Description copied from interface: ComponentIndex
Central method for providing query functionality on an index. Returns an array of PullOperators that contain the result to a query specified by the query predicate. The Query Optimizer will then retrieve the exstimated costs for each PullOperator and chose one of the returned PullOperators for execution.

Specified by:
query in interface ComponentIndex<Tuple>
Parameters:
queryPredicate - the predicate specifying the query
Returns:
an array of PullOperators reporesenting different alternative query plans is returned
Throws:
InvalidPredicateException - TODO

isEmpty

public boolean isEmpty()
Description copied from interface: ComponentMapping
Returns true if this instance does not contain any entries.

Specified by:
isEmpty in interface ComponentMapping<Tuple>
Returns:

finalize

public void finalize()
On destruction, releases all resources allocated by this instance.

Overrides:
finalize in class java.lang.Object