|
47 | 47 | import org.neo4j.importer.v1.targets.Targets; |
48 | 48 |
|
49 | 49 | /** |
50 | | - * {@link ImportPipeline} exposes a topologically-ordered set of {@link ImportStep}, |
| 50 | + * {@link ImportPipeline} exposes a topologically-ordered set of active {@link ImportStep}, |
51 | 51 | * based on the provided {@link ImportSpecification}, usually created with |
52 | 52 | * {@link org.neo4j.importer.v1.ImportSpecificationDeserializer#deserialize(Reader)} or its variants. |
| 53 | + * <br> |
| 54 | + * The existing types of the provided {@link ImportSpecification} are converted to their Step equivalent: {@link Source} |
| 55 | + * gets translated to {@link SourceStep}, {@link NodeTarget} to {@link NodeTargetStep} etc...<br> |
| 56 | + * Inactive {@link Target}s (see {@link Target#isActive}) are skipped and therefore not translated to their |
| 57 | + * corresponding step type. |
53 | 58 | * <br><br> |
| 59 | + * In particular, {@link RelationshipTargetStep}s directly reference their start and end {@link NodeTargetStep}, whereas |
| 60 | + * {@link RelationshipTarget}s simply reference the start and end node target name. This reduces the amount of required |
| 61 | + * lookup logic. If the corresponding start and/or end {@link org.neo4j.importer.v1.targets.NodeReference} define |
| 62 | + * key mapping overrides, the resulting {@link NodeTargetStep} get their property mappings accordingly updated. |
| 63 | + * <br><br> |
| 64 | + * Here is an example usage of {@link ImportPipeline} made possible by its {@link Iterable} implementation: |
54 | 65 | * <pre> |
55 | 66 | * var specification = org.neo4j.importer.v1.ImportSpecificationDeserializer.deserialize(aReader); |
56 | 67 | * var pipeline = @link ImportPipeline.of(specification); |
|
66 | 77 | * } |
67 | 78 | * }); |
68 | 79 | * </pre> |
69 | | - * <br><br> |
70 | | - * Since an {@link ImportStep} may have dependencies, which are either:<br><br> |
71 | | - * - implicit like a {@link TargetStep} depending on a {@link SourceStep}, |
72 | | - * a {@link RelationshipTargetStep} depending on start/end {@link NodeTargetStep}s<br> |
73 | | - * - and/or explicit (via {@link ImportStep#dependencies()}<br><br> |
74 | | - * ... the pipeline guarantees that dependencies are *always* returned after their dependents.<br> |
75 | | - * In particular, the dependencies of each {@link ActionStep} are resolved at pipeline construction, based on the |
76 | | - * provided import specification and the corresponding {@link Action}'s {@link ActionStage}. |
| 80 | + * The iteration returns every step in order. |
| 81 | + * Each step is guaranteed to be processed after all its implicit and explicit dependencies. |
| 82 | + * <br> |
| 83 | + * Implicit dependencies are:<br><br> |
| 84 | + * - {@link TargetStep} depending on a {@link SourceStep}<br> |
| 85 | + * - {@link RelationshipTargetStep} depending on start/end {@link NodeTargetStep}s<br> |
| 86 | + * - {@link RelationshipTargetStep} sharing common start/end nodes with other {@link RelationshipTargetStep}<br/> |
| 87 | + * - {@link ActionStep} must define an {@link ActionStage}, which gets translated to a set of concrete dependencies<br> |
| 88 | + * <br> |
| 89 | + * Relationships sharing common nodes must not be imported in parallel as this would likely cause |
| 90 | + * deadlock issues. Such relationships are defined with an explicit dependency between them.<br> |
| 91 | + *<br> |
| 92 | + * {@link Action}s with {@link ActionStage#POST_QUERIES} are translated to |
| 93 | + * instance of {@link ActionStep}s with dependencies on all the {@link CustomQueryTargetStep} defined in the pipeline. |
| 94 | + * {@link ActionStep}s with {@link ActionStage#PRE_NODES} result in making all the {@link NodeTargetStep} in |
| 95 | + * the pipeline to depend on these actions. |
| 96 | + * Finally, {@link ActionStep}s with {@link ActionStage#END} get the following dependencies:<br><br> |
| 97 | + * - all declared {@link SourceStep}<br> |
| 98 | + * - all declared {@link TargetStep}<br> |
| 99 | + * - all declared {@link ActionStep} with an {@link ActionStage} different from {@link ActionStage#END}<br> |
| 100 | + * <br> |
| 101 | + * Dependencies can also be explicit:<br><br> |
| 102 | + * - {@link TargetStep} can define dependencies to other {@link TargetStep}<br> |
| 103 | + * <br> |
77 | 104 | */ |
78 | 105 | public class ImportPipeline implements Iterable<ImportStep>, Serializable { |
79 | 106 |
|
|
0 commit comments