Package com.tinkerpop.gremlin.process.graph.step.sideEffect

Examples of com.tinkerpop.gremlin.process.graph.step.sideEffect.GroupByStep


    public default GraphTraversal<S, E> aggregate(final String sideEffectKey) {
        return this.aggregate(sideEffectKey, null);
    }

    public default GraphTraversal<S, E> groupBy(final String sideEffectKey, final Function<Traverser<E>, ?> keyFunction, final Function<Traverser<E>, ?> valueFunction, final Function<Collection, ?> reduceFunction) {
        return this.addStep(new GroupByStep(this, sideEffectKey, keyFunction, valueFunction, reduceFunction));
    }
View Full Code Here


    @Override
    public void loadState(final Configuration configuration) {
        this.sideEffectKey = configuration.getString(GROUP_BY_STEP_SIDE_EFFECT_KEY);
        this.groupByStepKey = configuration.getString(GROUP_BY_STEP_STEP_LABEL);
        final Traversal<?, ?> traversal = TraversalVertexProgram.getTraversalSupplier(configuration).get();
        final GroupByStep groupByStep = (GroupByStep) traversal.getSteps().stream()
                .filter(step -> step.getLabel().equals(this.groupByStepKey))
                .findAny().get();
        this.reduceFunction = groupByStep.getReduceFunction();
        this.mapSupplier = traversal.sideEffects().<Map>getRegisteredSupplier(this.sideEffectKey).orElse(HashMap::new);
    }
View Full Code Here

TOP

Related Classes of com.tinkerpop.gremlin.process.graph.step.sideEffect.GroupByStep

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.