public class MemorySortOp extends SortOp
Computing the value expressions first is not only an efficiency, but is also
required in order to detect type errors. When a type error is detected for a
value expression the corresponding input solution is kept but with no new
bindings, see trac-765. Since the
computed value expressions must become bound on the solutions to be sorted,
the caller is responsible for wrapping any value expression more complex than
a variable or a constant with an
IBind onto an anonymous variable.
All such variables will be dropped when the solutions are written out. Since
this operator must be able to compare all
IVs in all
IBindingSets, it depends on the materialization of non-inline
IVs and the ability of the value comparator to handle comparisons
between materialized non-inline
IVs and inline
TODO External memory ORDER BY operator.
SPARQL ORDER BY semantics are complex and evaluating a SPARQL ORDER BY is further complicated by the schema flexibility of the value to be sorted. The simplest path to a true external memory sort operator would be to buffer and manage paging for blocks of inline IVs without materialized RDF values s and non-inline IVs with materialized RDF values.
An operator could also be written which buffers the solutions on the native heap but the as-bound values which will be used to order those solutions are either buffered on the JVM heap or materialized onto the JVM heap when the sort is executed. This could scale better than a pure JVM heap version, but only to the extent that the keys are smaller than the total solutions. The solutions would probably be written as serialized binding sets on the memory manager such that each solution has its own int32 address. That address can then be paired with the as-bound key to be sorted on the JVM heap.
|Constructor and Description|
Required shallow copy constructor.
Constructor required for
|Modifier and Type||Method and Description|
assertAtOnceJavaHeapOp, assertMaxParallelOne, getChunkCapacity, getChunkOfChunksCapacity, getChunkTimeout, getMaxMemory, getMaxParallel, isAtOnceEvaluation, isBlockedEvaluation, isLastPassRequested, isPipelinedEvaluation, isReorderSolutions, isSharedState, newStats
__replaceArg, _clearProperty, _set, _setProperty, annotations, annotationsCopy, annotationsEqual, annotationsRef, argIterator, args, argsCopy, arity, clearAnnotations, clearProperty, deepCopy, deepCopy, get, getProperty, setArg, setProperty, setUnboundProperty, toArray, toArray
annotationsEqual, annotationsToString, annotationsToString, annotationValueToString, checkArgs, clone, equals, getEvaluationContext, getId, getProperty, getRequiredProperty, hashCode, indent, isController, mutation, shortenName, toShortString, toString, toString
public MemorySortOp(MemorySortOp op)
public FutureTask<Void> eval(BOpContext<IBindingSet> context)
FutureTaskwhich computes the operator against the evaluation context. The caller is responsible for executing the
FutureTask(this gives them the ability to hook the completion of the computation).
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.