public class VertexJobConverter extends Object implements ScanJob
| Modifier and Type | Class and Description |
|---|---|
static class |
VertexJobConverter.GraphProvider |
| Modifier and Type | Field and Description |
|---|---|
static String |
GHOST_VERTEX_COUNT |
protected VertexJobConverter.GraphProvider |
graph |
protected VertexScanJob |
job |
static String |
TRUNCATED_ENTRY_LISTS
Number of result sets that got (possibly) truncated due to an applied query limit
|
protected StandardTitanTx |
tx |
protected static SliceQuery |
VERTEX_EXISTS_QUERY |
| Modifier | Constructor and Description |
|---|---|
protected |
VertexJobConverter(TitanGraph graph,
VertexScanJob job) |
protected |
VertexJobConverter(VertexJobConverter copy) |
| Modifier and Type | Method and Description |
|---|---|
VertexJobConverter |
clone()
Returns a clone of this ScanJob.
|
static ScanJob |
convert(TitanGraph graph,
VertexScanJob vertexJob) |
static ScanJob |
convert(VertexScanJob vertexJob) |
java.util.function.Predicate<StaticBuffer> |
getKeyFilter()
A predicate that determines whether
ScanJob.process(com.thinkaurelius.titan.diskstorage.StaticBuffer, java.util.Map, ScanMetrics)
should be invoked for the given key. |
List<SliceQuery> |
getQueries()
Returns one or more
SliceQuery instances belonging to this ScanJob. |
protected long |
getVertexId(StaticBuffer key) |
protected boolean |
isGhostVertex(long vertexId,
EntryList firstEntries) |
void |
process(StaticBuffer key,
Map<SliceQuery,EntryList> entries,
ScanMetrics metrics)
Run this
ScanJob's computation on the supplied row-key and entries. |
static StandardTitanTx |
startTransaction(StandardTitanGraph graph) |
void |
workerIterationEnd(ScanMetrics metrics)
Invoked after a block of computation (i.e.
|
void |
workerIterationStart(Configuration jobConfig,
Configuration graphConfig,
ScanMetrics metrics)
Invoked before a block of computation (i.e.
|
protected static final SliceQuery VERTEX_EXISTS_QUERY
public static final String GHOST_VERTEX_COUNT
public static final String TRUNCATED_ENTRY_LISTS
protected final VertexJobConverter.GraphProvider graph
protected final VertexScanJob job
protected StandardTitanTx tx
protected VertexJobConverter(TitanGraph graph, VertexScanJob job)
protected VertexJobConverter(VertexJobConverter copy)
public static ScanJob convert(TitanGraph graph, VertexScanJob vertexJob)
public static ScanJob convert(VertexScanJob vertexJob)
public static StandardTitanTx startTransaction(StandardTitanGraph graph)
public void workerIterationStart(Configuration jobConfig, Configuration graphConfig, ScanMetrics metrics)
ScanJobcom.tinkerpop.gremlin.process.computer.VertexProgram#workerIterationStart()
This method may not be called if there is no data to be processed. Correspondingly, the end method won't be called either.
No-op default implementation.workerIterationStart in interface ScanJobjobConfig - configuration for this particular jobgraphConfig - configuration options for the entire graph against which this job is executedmetrics - ScanMetrics for this jobpublic void workerIterationEnd(ScanMetrics metrics)
ScanJobcom.tinkerpop.gremlin.process.computer.VertexProgram#workerIterationEnd()
This method may not be called if there is no data to be processed. Correspondingly, the start method won't be called either.
No-op default implementation.workerIterationEnd in interface ScanJobmetrics - ScanMetrics for this jobpublic void process(StaticBuffer key, Map<SliceQuery,EntryList> entries, ScanMetrics metrics)
ScanJobScanJob's computation on the supplied row-key and entries.
This method will be called by a client of this interface if and only if both of the following criteria are satisfied:
ScanJob.getKeyFilter() must evaluate to true
on the key.
entries parameter must contain an entry whose key is the first
SliceQuery returned by ScanJob.getQueries() and whose value
is an EntryList with at least size one. In other words, the
initial query in this job's query list must have matched at least once.
Implementations may assume these two conditions are satisfied. Calling this method when either of these two conditions is false yields undefined behavior.
It is the caller's responsibility to construct an entries map that
maps each SliceQuery to that query's matches.
The caller is also responsible for truncating the entries values
to honor BaseQuery.getLimit() when BaseQuery.hasLimit()
is true. Passing in an entries value longer than the limit set in
its respective key yields undefined behavior.
This method may be called by concurrent threads in a single process.
protected boolean isGhostVertex(long vertexId,
EntryList firstEntries)
public List<SliceQuery> getQueries()
ScanJobSliceQuery instances belonging to this ScanJob.
Before calling
ScanJob.process(com.thinkaurelius.titan.diskstorage.StaticBuffer, java.util.Map, ScanMetrics),
users of this interface must check that the key in question contains at least one
entry matching the initial SliceQuery returned by this method. See the javadoc
for the process method for more information.
If this method returns more than one query, then the initial query's lower bound must
be all zero bits and the initial query's upper bound must be all one bits (per the
preconditions in StandardScannerExecutor, the reference ScanJob executor).
getQueries in interface ScanJobpublic java.util.function.Predicate<StaticBuffer> getKeyFilter()
ScanJobScanJob.process(com.thinkaurelius.titan.diskstorage.StaticBuffer, java.util.Map, ScanMetrics)
should be invoked for the given key. If the predicate returns true,
then users of this interface should invoke process for the key and
its associated entries. If the predicate returns false, then users of this
interface need not invoke process for the key and its associated entries.
This is essentially an optimization that lets implementations of this interface
signal to client code that a row can be safely skipped without affecting the
execution of this ScanJob.
The returned predicate may be called by concurrent threads in a single process.
getKeyFilter in interface ScanJobpublic VertexJobConverter clone()
ScanJobprotected long getVertexId(StaticBuffer key)
Copyright © 2012–2015. All rights reserved.