public final class GraphFilter extends Object implements Cloneable, Serializable
GraphComputer
implementations to prune the source graph data being loaded into the OLAP system.
There are two types of filters: a Vertex
filter and an Edge
filter.
The vertex filter is a Traversal
that can only check the id, label, and properties of the vertex.
The edge filter is a Traversal
that starts at the vertex are emits all legal incident edges.
If no vertex filter is provided, then no vertices are filtered. If no edge filter is provided, then no edges are filtered.
The use of a GraphFilter can greatly reduce the amount of data processed by the GraphComputer
.
For instance, for g.V().count()
, there is no reason to load edges, and thus, the edge filter can be bothE().limit(0)
.Modifier and Type | Class and Description |
---|---|
static class |
GraphFilter.Legal |
Constructor and Description |
---|
GraphFilter() |
Modifier and Type | Method and Description |
---|---|
GraphFilter.Legal |
checkEdgeLegality(Direction direction) |
GraphFilter.Legal |
checkEdgeLegality(Direction direction,
String label) |
GraphFilter |
clone() |
boolean |
equals(Object object) |
Traversal.Admin<Vertex,Edge> |
getEdgeFilter() |
Traversal.Admin<Vertex,Vertex> |
getVertexFilter() |
boolean |
hasEdgeFilter() |
boolean |
hasFilter() |
int |
hashCode() |
boolean |
hasVertexFilter() |
Iterator<Edge> |
legalEdges(Vertex vertex) |
boolean |
legalVertex(Vertex vertex) |
void |
setEdgeFilter(Traversal<Vertex,Edge> edgeFilter) |
void |
setVertexFilter(Traversal<Vertex,Vertex> vertexFilter) |
String |
toString() |
public boolean legalVertex(Vertex vertex)
public final Traversal.Admin<Vertex,Vertex> getVertexFilter()
public final Traversal.Admin<Vertex,Edge> getEdgeFilter()
public boolean hasFilter()
public boolean hasEdgeFilter()
public boolean hasVertexFilter()
public GraphFilter.Legal checkEdgeLegality(Direction direction, String label)
public GraphFilter.Legal checkEdgeLegality(Direction direction)
public GraphFilter clone()
Copyright © 2013–2016 Apache Software Foundation. All rights reserved.