From: <tho...@us...> - 2010-09-22 20:21:25
|
Revision: 3611 http://bigdata.svn.sourceforge.net/bigdata/?rev=3611&view=rev Author: thompsonbry Date: 2010-09-22 20:21:19 +0000 (Wed, 22 Sep 2010) Log Message: ----------- Changes to BOpContext. I am committing these so MikeP can pull out a base class with getRelation(), getAccessPath(), getIndexManager(), and getExecutorService(). Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.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-22 18:51:04 UTC (rev 3610) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.java 2010-09-22 20:21:19 UTC (rev 3611) @@ -27,14 +27,15 @@ */ package com.bigdata.bop; +import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; + import org.apache.log4j.Logger; import com.bigdata.bop.engine.BOpStats; import com.bigdata.bop.engine.IChunkMessage; import com.bigdata.bop.engine.IRunningQuery; -import com.bigdata.bop.engine.QueryEngine; import com.bigdata.bop.engine.RunningQuery; -import com.bigdata.bop.solutions.SliceOp; import com.bigdata.btree.IIndex; import com.bigdata.btree.ILocalBTreeView; import com.bigdata.btree.IRangeQuery; @@ -115,6 +116,16 @@ return runningQuery.getIndexManager(); } + /** + * Return the {@link Executor} on to which the operator may submit tasks. + * <p> + * Note: The is the {@link ExecutorService} associated with the + * <em>local</em> {@link #getIndexManager() index manager}. + */ + public final Executor getExecutorService() { + return runningQuery.getIndexManager().getExecutorService(); + } + // /** // * The timestamp or transaction identifier against which the query is // * reading. @@ -386,7 +397,7 @@ if (predicate == null) throw new IllegalArgumentException(); - + // FIXME This should be as assigned by the query planner so the query is fully declarative. final IKeyOrder keyOrder = relation.getKeyOrder((IPredicate) predicate); if (keyOrder == null) @@ -617,7 +628,7 @@ * * @return <code>true</code> iff the constraints are satisfied. */ - private boolean isConsistent(final IConstraint[] constraints, + public boolean isConsistent(final IConstraint[] constraints, final IBindingSet bindingSet) { for (int i = 0; i < constraints.length; i++) { @@ -652,25 +663,27 @@ } - /** - * Cancel the running query (normal termination). - * <p> - * Note: This method provides a means for an operator to indicate that the - * query should halt immediately. It used used by {@link SliceOp}, which - * needs to terminate the entire query once the slice has been satisfied. - * (If {@link SliceOp} just jumped out of its own evaluation loop then the - * query would not produce more results, but it would continue to run and - * the over produced results would just be thrown away.) - * <p> - * Note: When an individual {@link BOp} evaluation throws an exception, the - * {@link QueryEngine} will catch that exception and halt query evaluation - * with that thrown cause. - */ - public void halt() { - - runningQuery.halt(); - - } +// /** +// * Cancel the running query (normal termination). +// * <p> +// * Note: This method provides a means for an operator to indicate that the +// * query should halt immediately. It used used by {@link SliceOp}, which +// * needs to terminate the entire query once the slice has been satisfied. +// * (If {@link SliceOp} just jumped out of its own evaluation loop then the +// * query would not produce more results, but it would continue to run and +// * the over produced results would just be thrown away.) +// * <p> +// * Note: When an individual {@link BOp} evaluation throws an exception, the +// * {@link QueryEngine} will catch that exception and halt query evaluation +// * with that thrown cause. +// * +// * @see IRunningQuery#halt() +// */ +// public void halt() { +// +// runningQuery.halt(); +// +// } /* * I've replaced this with AbstractSplitter for the moment. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-09-29 19:54:33
|
Revision: 3684 http://bigdata.svn.sourceforge.net/bigdata/?rev=3684&view=rev Author: thompsonbry Date: 2010-09-29 19:54:27 +0000 (Wed, 29 Sep 2010) Log Message: ----------- Fixed another bunch of exceptions from copyValues() when the variable was not bound yet. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.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-29 19:14:33 UTC (rev 3683) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.java 2010-09-29 19:54:27 UTC (rev 3684) @@ -298,10 +298,14 @@ final IVariable<?> var = (IVariable<?>) t; - final Constant<?> newval = new Constant(e.get(i)); + final Object val = e.get(i); + + if (val != null) { - bindingSet.set(var, newval); + bindingSet.set(var, new Constant(val)); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-10-18 19:14:40
|
Revision: 3813 http://bigdata.svn.sourceforge.net/bigdata/?rev=3813&view=rev Author: thompsonbry Date: 2010-10-18 19:14:34 +0000 (Mon, 18 Oct 2010) Log Message: ----------- removed unused method. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.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-10-18 17:09:14 UTC (rev 3812) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/BOpContext.java 2010-10-18 19:14:34 UTC (rev 3813) @@ -385,40 +385,40 @@ // // } - /** - * Copy data from the source to the sink. The sink will be flushed and - * closed. The source will be closed. - */ - public void copySourceToSink() { +// /** +// * Copy data from the source to the sink. The sink will be flushed and +// * closed. The source will be closed. +// */ +// public void copySourceToSink() { +// +// // source. +// final IAsynchronousIterator<IBindingSet[]> source = (IAsynchronousIterator) getSource(); +// +// // default sink +// final IBlockingBuffer<IBindingSet[]> sink = (IBlockingBuffer) getSink(); +// +// final BOpStats stats = getStats(); +// +// try { +// +// // copy binding sets from the source. +// BOpUtility.copy(source, sink, null/* sink2 */, +// null/* constraints */, stats); +// +// // flush the sink. +// sink.flush(); +// +// } finally { +// +// sink.close(); +// +// if (sink2 != null) +// sink2.close(); +// +// source.close(); +// +// } +// +// } - // source. - final IAsynchronousIterator<IBindingSet[]> source = (IAsynchronousIterator) getSource(); - - // default sink - final IBlockingBuffer<IBindingSet[]> sink = (IBlockingBuffer) getSink(); - - final BOpStats stats = getStats(); - - try { - - // copy binding sets from the source. - BOpUtility.copy(source, sink, null/* sink2 */, - null/* constraints */, stats); - - // flush the sink. - sink.flush(); - - } finally { - - sink.close(); - - if (sink2 != null) - sink2.close(); - - source.close(); - - } - - } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |