com.bigdata.relation.accesspath
Class AccessPathFusedView<E>

java.lang.Object
  extended by com.bigdata.relation.accesspath.AccessPathFusedView<E>
All Implemented Interfaces:
IAbstractAccessPath<E>, IAccessPath<E>

Deprecated. by BOps using the UNION of JOINs. However, also note that this is only used for TM and that the focus store is always local for TM.

public class AccessPathFusedView<E>
extends Object
implements IAccessPath<E>

A read-only fused view of two access paths obtained for the same IPredicate constraint in two different databases (this is used for truth maintenance when reading on the union of a focus store and the database). FIXME review impl and write tests. FIXME Does not support IPredicate.Annotations#ACCESS_PATH_FILTER

Version:
$Id: AccessPathFusedView.java 3672 2010-09-28 23:39:42Z thompsonbry $
Author:
Bryan Thompson

Field Summary
protected static org.apache.log4j.Logger log
          Deprecated.  
 
Constructor Summary
AccessPathFusedView(AccessPath<E> path1, AccessPath<E> path2)
          Deprecated.  
 
Method Summary
 IIndex getIndex()
          Deprecated. The index selected for the access path.
 IKeyOrder<E> getKeyOrder()
          Deprecated. The order in which the elements will be visited.
 IPredicate<E> getPredicate()
          Deprecated. The constraints on the IAccessPath.
 boolean isEmpty()
          Deprecated. True iff the access path is empty (there are no matches for the IPredicate) This is more conclusive than #rangeCount() since you MAY have a non-zero range count when the key range is in fact empty (there may be "deleted" index entries within the key range).
 IChunkedOrderedIterator<E> iterator()
          Deprecated. An iterator visiting elements using the natural order of the index selected for the IPredicate.
 IChunkedOrderedIterator<E> iterator(int limit, int capacity)
          Deprecated. An iterator visiting elements using the natural order of the index selected for the IPredicate.
 IChunkedOrderedIterator<E> iterator(long offset, long limit, int capacity)
          Deprecated. FIXME write tests for optimizations for point tests and small limits.
 long rangeCount(boolean exact)
          Deprecated. Note: You can not get an exact range count for a view.
 ITupleIterator<E> rangeIterator()
          Deprecated. The raw iterator for traversing the selected index within the key range implied by IPredicate.
 long removeAll()
          Deprecated. Remove all elements selected by the IPredicate (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Deprecated. 
Constructor Detail

AccessPathFusedView

public AccessPathFusedView(AccessPath<E> path1,
                           AccessPath<E> path2)
Deprecated. 
Method Detail

getPredicate

public IPredicate<E> getPredicate()
Deprecated. 
Description copied from interface: IAbstractAccessPath
The constraints on the IAccessPath.

Specified by:
getPredicate in interface IAbstractAccessPath<E>

isEmpty

public boolean isEmpty()
Deprecated. 
Description copied from interface: IAbstractAccessPath
True iff the access path is empty (there are no matches for the IPredicate) This is more conclusive than #rangeCount() since you MAY have a non-zero range count when the key range is in fact empty (there may be "deleted" index entries within the key range).

Specified by:
isEmpty in interface IAbstractAccessPath<E>

rangeCount

public long rangeCount(boolean exact)
Deprecated. 
Note: You can not get an exact range count for a view.

Specified by:
rangeCount in interface IAbstractAccessPath<E>
Parameters:
exact - When true, the result will be an exact count and may require a key-range scan. When false, the result will be an upper bound IFF delete markers are provisioned for the backing index (delete markers are required for transactions and for scale-out indices).
Throws:
UnsupportedOperationException - if exact == true.
See Also:
IRangeQuery
TODO:
an exact range count for a view could be written. It would have to use two iterators (like a FusedView) that progressed in sync so that duplicates could be detected. This means a full key range scan for both source access paths.

getIndex

public IIndex getIndex()
Deprecated. 
Description copied from interface: IAccessPath
The index selected for the access path.

Note: The access path may incorporate additional constraints from the specified IPredicate that are not present on the IIndex returned by this method.

Specified by:
getIndex in interface IAccessPath<E>
Throws:
UnsupportedOperationException - always.
TODO:
this could be implemented with a variant (or relaxed form) of FusedView.

rangeIterator

public ITupleIterator<E> rangeIterator()
Deprecated. 
Description copied from interface: IAccessPath
The raw iterator for traversing the selected index within the key range implied by IPredicate.

Note: The access path may incorporate additional constraints from the specified IPredicate that are not present on the raw ITupleIterator returned by this method.

Specified by:
rangeIterator in interface IAccessPath<E>

iterator

public IChunkedOrderedIterator<E> iterator()
Deprecated. 
Description copied from interface: IAccessPath
An iterator visiting elements using the natural order of the index selected for the IPredicate. This is equivalent to
 iterator(0L, 0L, 0)
 
since an offset of ZERO (0L) means no offset, a limit of ZERO (0L) means no limit and a capacity of ZERO (0) means whatever is the default capacity.

Note: Filters should be specified when the IAccessPath is constructed so that they will be evaluated on the IDataService rather than materializing the elements and then filtering then. This can be accomplished by adding the filter as an IElementFilter on the IPredicate when requesting IAccessPath.

Specified by:
iterator in interface IAccessPath<E>
Returns:
The iterator.
See Also:
IRelation.getAccessPath(IPredicate)

iterator

public IChunkedOrderedIterator<E> iterator(int limit,
                                           int capacity)
Deprecated. 
Description copied from interface: IAccessPath
An iterator visiting elements using the natural order of the index selected for the IPredicate.

Specified by:
iterator in interface IAccessPath<E>
Parameters:
limit - The maximum #of elements that will be visited -or- ZERO (0) if there is no limit.
capacity - The maximum capacity for the buffer used by the iterator. When ZERO(0), a default capacity will be used. When a limit is specified, the capacity will never exceed the limit.
Returns:
The iterator.

iterator

public IChunkedOrderedIterator<E> iterator(long offset,
                                           long limit,
                                           int capacity)
Deprecated. 
FIXME write tests for optimizations for point tests and small limits. See {@link AccessPath#iterator(long, long, int) for impl details. FIXME handle non-zero offset.

Specified by:
iterator in interface IAccessPath<E>
Parameters:
offset - The first element accepted by the iterator that it will visit (materialize for the client). The offset must be non-negative. This is ZERO (0L) to visit all accepted elements.
limit - The last element accepted by the iterator that it will visit (materialize for the client). The limit must be non-negative. This is ZERO (0L) to visit all accepted elements (the value Long.MAX_VALUE is interpreted exactly like ZERO(0L)).
capacity - The maximum capacity for the buffer used by the iterator. When ZERO(0), a default capacity will be used. When a limit is specified, the capacity will never exceed the limit.
Returns:
The iterator. FIXME The offset and limit should probably be rolled into the predicate and removed from the IAccessPath. This way they will be correctly applied when IAbstractAccessPath.isEmpty() is implemented using the IAccessPath.iterator() to determine if any elements can be visited.

removeAll

public long removeAll()
Deprecated. 
Description copied from interface: IAccessPath
Remove all elements selected by the IPredicate (optional operation).

Specified by:
removeAll in interface IAccessPath<E>
Returns:
The #of elements that were removed.

getKeyOrder

public IKeyOrder<E> getKeyOrder()
Deprecated. 
Description copied from interface: IAccessPath
The order in which the elements will be visited.

Specified by:
getKeyOrder in interface IAccessPath<E>


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.