Search in sources :

Example 1 with EstimateCountStep

use of com.alibaba.maxgraph.tinkerpop.steps.EstimateCountStep in project GraphScope by alibaba.

the class MaxGraphTraversalSource method estimateECount.

public GraphTraversal<Edge, Element> estimateECount(final String... labels) {
    final GraphTraversalSource clone = this.clone();
    clone.getBytecode().addStep(CustomSymbols.graph_source);
    final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultMaxGraphTraversal<>(clone);
    return (DefaultMaxGraphTraversal) traversal.addStep(new EstimateCountStep<>(traversal, false, Sets.newHashSet(labels)));
}
Also used : GraphTraversalSource(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) GraphTraversal(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal) EstimateCountStep(com.alibaba.maxgraph.tinkerpop.steps.EstimateCountStep)

Example 2 with EstimateCountStep

use of com.alibaba.maxgraph.tinkerpop.steps.EstimateCountStep in project GraphScope by alibaba.

the class MaxGraphTraversalSource method estimateVCount.

public GraphTraversal<Vertex, Element> estimateVCount(final String... labels) {
    final GraphTraversalSource clone = this.clone();
    clone.getBytecode().addStep(CustomSymbols.graph_source);
    final GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultMaxGraphTraversal<>(clone);
    return (DefaultMaxGraphTraversal) traversal.addStep(new EstimateCountStep<>(traversal, true, Sets.newHashSet(labels)));
}
Also used : GraphTraversalSource(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) GraphTraversal(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal) EstimateCountStep(com.alibaba.maxgraph.tinkerpop.steps.EstimateCountStep)

Aggregations

EstimateCountStep (com.alibaba.maxgraph.tinkerpop.steps.EstimateCountStep)2 GraphTraversal (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal)2 GraphTraversalSource (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource)2 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)2