E
- The generic type of the objects in the relation.public class FederationChunkHandler<E> extends StandaloneChunkHandler
BOp.getEvaluationContext()
. In addition, we need to handle low
latency and high data volume queries somewhat differently. Except for
BOpEvaluationContext.ANY
, all of these cases wind up writing the
intermediate results onto a direct ByteBuffer
and notifying the
receiving service that there are intermediate results which it can pull when
it is ready to process them. This pattern allows the receiver to impose flow
control on the producer.Modifier and Type | Field and Description |
---|---|
static IChunkHandler |
INSTANCE
FIXME Debug the NIO chunk message materialization logic (it is currently
disabled by the setting of the nioThreshold parameter to the
constructor).
|
static IChunkHandler |
TEST_INSTANCE
Instance used by some test suites to avoid a dependency on the RDF data
model.
|
MANAGED_HEAP_INSTANCE, NATIVE_HEAP_INSTANCE
Constructor and Description |
---|
FederationChunkHandler(int nioThreshold,
boolean usePOJO) |
Modifier and Type | Method and Description |
---|---|
int |
handleChunk(IRunningQuery query,
int bopId,
int sinkId,
IBindingSet[] chunk)
Take an
IBindingSet [] chunk generated by some pass over an
operator and make it available to the target operator. |
protected void |
sendChunkMessage(FederatedRunningQuery q,
UUID serviceUUID,
int sinkId,
int partitionId,
DirectBufferPoolAllocator.IAllocationContext allocationContext,
IBindingSet[] source)
Create and send an
IChunkMessage from some intermediate results. |
public static final IChunkHandler INSTANCE
public static final IChunkHandler TEST_INSTANCE
LocalChunkMessage
which uses POJO
serialization.public FederationChunkHandler(int nioThreshold, boolean usePOJO)
nioThreshold
- The threshold above which the intermediate solutions are
shipped using NIO rather than RMI. This is ignored if
usePOJO:=true
.usePOJO
- When true
, the LocalChunkMessage
will be
used for all messages. This allows the test cases to avoid RDF
specific logic in the IChunkMessage
serialization.public int handleChunk(IRunningQuery query, int bopId, int sinkId, IBindingSet[] chunk)
IBindingSet
[] chunk generated by some pass over an
operator and make it available to the target operator. How this is done
depends on whether the query is running against a standalone database or
the scale-out database.
Note: The return value is used as part of the termination criteria for
the query which depends on (a) the #of running operator tasks and (b) the
#of IChunkMessage
s generated (available) and consumed. The return
value of this method increases the #of IChunkMessage
s available
to the query.
handleChunk
in interface IChunkHandler
handleChunk
in class StandaloneChunkHandler
query
- The query.bopId
- The operator which wrote on the sink.sinkId
- The identifier of the target operator.chunk
- The intermediate results to be passed to that target operator.IChunkMessage
sent. This will always be ONE (1)
for scale-up. For scale-out, there will be at least one
IChunkMessage
per index partition over which the
intermediate results were mapped.protected void sendChunkMessage(FederatedRunningQuery q, UUID serviceUUID, int sinkId, int partitionId, DirectBufferPoolAllocator.IAllocationContext allocationContext, IBindingSet[] source)
IChunkMessage
from some intermediate results.
Various optimizations are employed depending on the amount of data to be
moved and whether or not the target is this service.serviceUUID
- The UUID
of the IQueryPeer
who is the
recipient.sinkId
- The identifier of the target BOp
.allocationContext
- The allocation context within which the ByteBuffer
s
will be managed for this NIOChunkMessage
.source
- The binding sets to be formatted onto a buffer.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.