/** * Removes elements and properties from the graph. This step is not a terminating, in the sense that it does not * automatically iterate the traversal. It is therefore necessary to do some form of iteration for the removal * to actually take place. In most cases, iteration is best accomplished with {@code g.V().drop().iterate()}. * * @return the traversal with the {@link DropStep} added * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#drop-step" target="_blank">Reference Documentation - Drop Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> drop() { this.asAdmin().getBytecode().addStep(Symbols.drop); return this.asAdmin().addStep(new DropStep<>(this.asAdmin())); }
final Element toRemove = (Element) s; if (callbackRegistry != null) { final EventStrategy eventStrategy = getTraversal().getStrategies().getStrategy(EventStrategy.class).get(); final Event removeEvent; if (s instanceof Vertex) final Property toRemove = (Property) s; if (callbackRegistry != null) { final EventStrategy eventStrategy = getTraversal().getStrategies().getStrategy(EventStrategy.class).get(); final Event.ElementPropertyEvent removeEvent; if (toRemove.element() instanceof Edge)
@Override public void apply(Traversal.Admin<?, ?> traversal) { if (!(traversal.getGraph().orElseThrow(IllegalStateException::new) instanceof SqlgGraph)) { return; } if (!SqlgTraversalUtil.mayOptimize(traversal)) { return; } Optional<DropStep> dropStepOptional = TraversalHelper.getLastStepOfAssignableClass(DropStep.class, traversal); if (dropStepOptional.isPresent()) { DropStep<?> dropStep = dropStepOptional.get(); TraversalHelper.replaceStep(dropStep, new SqlgDropStepBarrier<>(traversal, dropStep.getMutatingCallbackRegistry()), traversal); } }
@Override public void apply(Traversal.Admin<?, ?> traversal) { if (!(traversal.getGraph().orElseThrow(IllegalStateException::new) instanceof SqlgGraph)) { return; } if (!SqlgTraversalUtil.mayOptimize(traversal)) { return; } Optional<DropStep> dropStepOptional = TraversalHelper.getLastStepOfAssignableClass(DropStep.class, traversal); if (dropStepOptional.isPresent()) { DropStep<?> dropStep = dropStepOptional.get(); TraversalHelper.replaceStep(dropStep, new SqlgDropStepBarrier<>(traversal, dropStep.getMutatingCallbackRegistry()), traversal); } }
/** * Removes elements and properties from the graph. This step is not a terminating, in the sense that it does not * automatically iterate the traversal. It is therefore necessary to do some form of iteration for the removal * to actually take place. In most cases, iteration is best accomplished with {@code g.V().drop().iterate()}. * * @return the traversal with the {@link DropStep} added * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#drop-step" target="_blank">Reference Documentation - Drop Step</a> * @since 3.0.0-incubating */ public default GraphTraversal<S, E> drop() { this.asAdmin().getBytecode().addStep(Symbols.drop); return this.asAdmin().addStep(new DropStep<>(this.asAdmin())); }
final Element toRemove = (Element) s; if (callbackRegistry != null) { final EventStrategy eventStrategy = getTraversal().getStrategies().getStrategy(EventStrategy.class).get(); final Event removeEvent; if (s instanceof Vertex) final Property toRemove = (Property) s; if (callbackRegistry != null) { final EventStrategy eventStrategy = getTraversal().getStrategies().getStrategy(EventStrategy.class).get(); final Event.ElementPropertyEvent removeEvent; if (toRemove.element() instanceof Edge)