From: <tho...@us...> - 2010-09-23 20:20:30
|
Revision: 3618 http://bigdata.svn.sourceforge.net/bigdata/?rev=3618&view=rev Author: thompsonbry Date: 2010-09-23 20:20:24 +0000 (Thu, 23 Sep 2010) Log Message: ----------- Fixed a problem I introduced into the layering of the BOpContext. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.java branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContextBase.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.java 2010-09-23 20:10:58 UTC (rev 3617) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.java 2010-09-23 20:20:24 UTC (rev 3618) @@ -196,7 +196,7 @@ final BOpStats stats, final IAsynchronousIterator<E[]> source, final IBlockingBuffer<E[]> sink, final IBlockingBuffer<E[]> sink2) { - super(null); + super(runningQuery.getFederation(), runningQuery.getIndexManager()); this.runningQuery = runningQuery; // if (indexManager == null) Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContextBase.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContextBase.java 2010-09-23 20:10:58 UTC (rev 3617) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContextBase.java 2010-09-23 20:20:24 UTC (rev 3618) @@ -59,7 +59,10 @@ static private final transient Logger log = Logger.getLogger(BOpContextBase.class); - private final QueryEngine queryEngine; +// private final QueryEngine queryEngine; + + private final IBigdataFederation<?> fed; + private final IIndexManager indexManager; /** * The <strong>local</strong> {@link IIndexManager}. Query evaluation occurs @@ -68,17 +71,18 @@ * {@link ILocalBTreeView}. */ final public IIndexManager getIndexManager() { - return queryEngine.getIndexManager(); + return indexManager; } - + /** * The {@link IBigdataFederation} IFF the operator is being evaluated on an - * {@link IBigdataFederation}. When evaluating operations against an - * {@link IBigdataFederation}, this reference provides access to the - * scale-out view of the indices and to other bigdata services. + * {@link IBigdataFederation} and otherwise <code>null</code>. When + * evaluating operations against an {@link IBigdataFederation}, this + * reference provides access to the scale-out view of the indices and to + * other bigdata services. */ final public IBigdataFederation<?> getFederation() { - return queryEngine.getFederation(); + return fed; } /** @@ -88,23 +92,37 @@ * <em>local</em> {@link #getIndexManager() index manager}. */ public final Executor getExecutorService() { - return getIndexManager().getExecutorService(); + return indexManager.getExecutorService(); } + public BOpContextBase(final QueryEngine queryEngine) { + + this(queryEngine.getFederation(), queryEngine.getIndexManager()); + + } + /** - * + * Core constructor. + * @param fed * @param indexManager - * The <strong>local</strong> {@link IIndexManager}. Query - * evaluation occurs against the local indices. In scale-out, - * query evaluation proceeds shard wise and this - * {@link IIndexManager} MUST be able to read on the - * {@link ILocalBTreeView}. - * */ - public BOpContextBase(final QueryEngine queryEngine) { - this.queryEngine = queryEngine; + public BOpContextBase(final IBigdataFederation<?> fed, + final IIndexManager indexManager) { + + /* + * @todo null is permitted here for the unit tests, but we should really + * mock the IIndexManager and pass in a non-null object here and then + * verify that the reference is non-null. + */ +// if (indexManager == null) +// throw new IllegalArgumentException(); + + this.fed = fed; + + this.indexManager = indexManager; + } - + /** * Locate and return the view of the relation(s) identified by the * {@link IPredicate}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |