public class ParallelGraphAssembler extends DefaultAssembler implements LangStoreGraphAssembler
While the result graph may be of any arbitrary size or depth, because the traversal is breadth-first, many tasks are typically spawned at the "base" of the graph, exhausting the available pool threads. Each subgraph task can spawn further sub tasks based on thread availability, but typically this means each task will traverse and process a healthy segment of the total graph. Since the actual size or depth of the result graph is not known until discovered on traversal, a fixed number of parallel tasks cannot be initially created, but must be dynamically spawned during graph discovery.
The assembly is triggered by calling the GraphAssembler#assemble(List method which initializes
the graph root and begins a breadth first traversal of the selection graph as
represented in the underlying data store.
Various metrics for the assembly are collected using
GraphMetricVisitor and are available as SDO instance properties.
Selection,
ParallelSubgraphTask,
GraphMetricVisitordataObjectMap, EMPTY_DATA_OBJECT_LIST, EMPTY_PROPERTY_SET, nameComparator, root, rootType, snapshotDatecollector, statementExecutor, statementFactory| Constructor and Description |
|---|
ParallelGraphAssembler(org.plasma.sdo.PlasmaType rootType,
org.plasma.query.collector.SelectionCollector collector,
Timestamp snapshotDate,
ConfigProps config,
Connection con)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assemble(List<org.plasma.sdo.access.provider.common.PropertyPair> results)
Recursively re-constitutes a data graph distributed across multiple tables
and/or rows, starting with the given result row.
|
protected void |
assemble(org.plasma.sdo.PlasmaType targetType,
org.plasma.sdo.PlasmaDataObject source,
org.plasma.sdo.PlasmaProperty sourceProperty,
List<org.plasma.sdo.access.provider.common.PropertyPair> childKeyPairs,
int level) |
protected org.plasma.sdo.PlasmaDataObject |
createDataObject(List<org.plasma.sdo.access.provider.common.PropertyPair> row,
org.plasma.sdo.PlasmaDataObject source,
org.plasma.sdo.PlasmaProperty sourceProperty) |
ConfigProps |
getConfig() |
ThreadPoolExecutor |
getExecutorService() |
protected void |
link(org.plasma.sdo.PlasmaDataObject target,
org.plasma.sdo.PlasmaDataObject source,
org.plasma.sdo.PlasmaProperty sourceProperty) |
void |
logPoolStatistics() |
int |
numThreadsAvailable() |
boolean |
threadsAvailable() |
clear, collectResults, createHashKey, findDataObject, getDataGraph, initRootfindNextKeyValue, getChildKeyPairs, getChildKeyPairs, getChildKeyProps, getNextKeyPairs, getPredicateResult, getStatementExecutor, getStatementFactory, throwPriKeyErrorpublic ParallelGraphAssembler(org.plasma.sdo.PlasmaType rootType,
org.plasma.query.collector.SelectionCollector collector,
Timestamp snapshotDate,
ConfigProps config,
Connection con)
rootType - the SDO root type for the result data graphcollector - selected SDO properties. Properties are mapped by selected types
required in the result graph.snapshotDate - the query snapshot date which is populated into every data object
in the result data graph.minPoolSize - the minimum or core size of the underlying thread pool used for
all tasks executed under this assemblermaxPoolSize - the maximum size of the underlying thread pool used for all tasks
executed under this assemblercon - public ThreadPoolExecutor getExecutorService()
public ConfigProps getConfig()
protected void link(org.plasma.sdo.PlasmaDataObject target,
org.plasma.sdo.PlasmaDataObject source,
org.plasma.sdo.PlasmaProperty sourceProperty)
link in class DefaultAssemblerprotected org.plasma.sdo.PlasmaDataObject createDataObject(List<org.plasma.sdo.access.provider.common.PropertyPair> row, org.plasma.sdo.PlasmaDataObject source, org.plasma.sdo.PlasmaProperty sourceProperty)
createDataObject in class DefaultAssemblerpublic void assemble(List<org.plasma.sdo.access.provider.common.PropertyPair> results)
To retrieve the graph use DefaultAssembler.getDataGraph().
assemble in interface LangStoreGraphAssemblerassemble in class DefaultAssemblerresults - the result row.protected void assemble(org.plasma.sdo.PlasmaType targetType,
org.plasma.sdo.PlasmaDataObject source,
org.plasma.sdo.PlasmaProperty sourceProperty,
List<org.plasma.sdo.access.provider.common.PropertyPair> childKeyPairs,
int level)
assemble in class DefaultAssemblerpublic void logPoolStatistics()
public boolean threadsAvailable()
public int numThreadsAvailable()
Copyright © 2021. All Rights Reserved.