From: <mrp...@us...> - 2013-09-20 17:02:45
|
Revision: 7415 http://bigdata.svn.sourceforge.net/bigdata/?rev=7415&view=rev Author: mrpersonick Date: 2013-09-20 17:02:38 +0000 (Fri, 20 Sep 2013) Log Message: ----------- fixed the slice service factory to correctly build the toKey in the presence of RangeBOp Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java 2013-09-17 14:16:25 UTC (rev 7414) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java 2013-09-20 17:02:38 UTC (rev 7415) @@ -416,6 +416,10 @@ // Handle a range. final RangeBOp rangeBOp = sp.getRange() != null ? sp.getRange().getRangeBOp() : null; + if (log.isTraceEnabled()) { + log.trace("range: " + rangeBOp); + } + // Create the predicate. @SuppressWarnings("unchecked") final IPredicate<ISPO> pred = (IPredicate<ISPO>) @@ -461,7 +465,7 @@ startIndex = indexOf(ndx, startKey); - final byte[] endKey = SuccessorUtil.successor(startKey.clone()); + final byte[] endKey = keyOrder.getToKey(KeyBuilder.newInstance(), pred); //SuccessorUtil.successor(startKey.clone()); endIndex = indexOf(ndx, endKey); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2013-10-23 13:40:33
|
Revision: 7469 http://bigdata.svn.sourceforge.net/bigdata/?rev=7469&view=rev Author: mrpersonick Date: 2013-10-23 13:40:25 +0000 (Wed, 23 Oct 2013) Log Message: ----------- fixed the IndexOutOfBounds problem and a problem with the term advancer Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java 2013-10-22 16:42:21 UTC (rev 7468) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java 2013-10-23 13:40:25 UTC (rev 7469) @@ -68,6 +68,7 @@ import com.bigdata.rdf.sparql.ast.service.ServiceFactory; import com.bigdata.rdf.sparql.ast.service.ServiceNode; import com.bigdata.rdf.spo.DistinctMultiTermAdvancer; +import com.bigdata.rdf.spo.DistinctTermAdvancer; import com.bigdata.rdf.spo.ISPO; import com.bigdata.rdf.spo.SPO; import com.bigdata.rdf.spo.SPOKeyOrder; @@ -483,7 +484,7 @@ } - final long range = endIndex - startIndex + 1; + final long range = endIndex - startIndex; if (log.isTraceEnabled()) { log.trace("range: " + range); @@ -538,7 +539,7 @@ * Reading to the offset plus the limit (minus 1), or the end * index, whichever is smaller. */ - final long toIndex = Math.min(startIndex + offset + limit - 1, + final long toIndex = Math.min(startIndex + offset + limit, endIndex); if (fromIndex > toIndex) { @@ -549,7 +550,7 @@ final byte[] fromKey = ndx.keyAt(fromIndex); - final byte[] toKey = SuccessorUtil.successor(ndx.keyAt(toIndex)); + final byte[] toKey = ndx.keyAt(toIndex);//SuccessorUtil.successor(ndx.keyAt(toIndex)); final int arity = pred.arity(); @@ -567,13 +568,17 @@ /* * Use a multi-term advancer to skip the bound entries and just - * get to the variables. + * get to the variables. + * + * Not a good idea. Needs to visit each tuple individually. */ - final DistinctMultiTermAdvancer advancer = //null; - new DistinctMultiTermAdvancer( - arity, //arity - 3 or 4 - numBoundEntries // #boundEntries - anything not a var and not bound by incoming bindings - ); + final DistinctMultiTermAdvancer advancer = null; +// new DistinctMultiTermAdvancer( +// arity, //arity - 3 or 4 +// numBoundEntries // #boundEntries - anything not a var and not bound by incoming bindings +// ); +// final DistinctTermAdvancer advancer2 = +// new DistinctTermAdvancer(arity); final ITupleIterator it = ndx.rangeIterator(fromKey, toKey, 0/* capacity */, IRangeQuery.KEYS | IRangeQuery.CURSOR, advancer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2013-10-23 14:09:05
|
Revision: 7470 http://bigdata.svn.sourceforge.net/bigdata/?rev=7470&view=rev Author: mrpersonick Date: 2013-10-23 14:08:59 +0000 (Wed, 23 Oct 2013) Log Message: ----------- fixed the IndexOutOfBounds problem and a problem with the term advancer Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java 2013-10-23 13:40:25 UTC (rev 7469) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java 2013-10-23 14:08:59 UTC (rev 7470) @@ -468,7 +468,7 @@ final byte[] endKey = keyOrder.getToKey(KeyBuilder.newInstance(), pred); //SuccessorUtil.successor(startKey.clone()); - endIndex = indexOf(ndx, endKey); + endIndex = indexOf(ndx, endKey) - 1; cache.put(pred, new CacheHit(startIndex, endIndex)); @@ -484,7 +484,7 @@ } - final long range = endIndex - startIndex; + final long range = endIndex - startIndex + 1; if (log.isTraceEnabled()) { log.trace("range: " + range); @@ -539,7 +539,7 @@ * Reading to the offset plus the limit (minus 1), or the end * index, whichever is smaller. */ - final long toIndex = Math.min(startIndex + offset + limit, + final long toIndex = Math.min(startIndex + offset + limit - 1, endIndex); if (fromIndex > toIndex) { @@ -550,7 +550,7 @@ final byte[] fromKey = ndx.keyAt(fromIndex); - final byte[] toKey = ndx.keyAt(toIndex);//SuccessorUtil.successor(ndx.keyAt(toIndex)); + final byte[] toKey = SuccessorUtil.successor(ndx.keyAt(toIndex)); final int arity = pred.arity(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |