public abstract class GraphBase extends Object implements Graph
| Modifier and Type | Field and Description |
|---|---|
protected StackTraceTracker |
flushStackTraceTracker |
protected Timer |
flushTimer |
static String |
METADATA_DEFINE_PROPERTY_PREFIX |
protected static GeLogger |
QUERY_LOGGER |
| Modifier | Constructor and Description |
|---|---|
protected |
GraphBase(boolean strictTyping,
GeMetricRegistry metricRegistry) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGraphEventListener(GraphEventListener graphEventListener)
Adds a graph event listener that will be called when graph events occur.
|
protected void |
addToPropertyDefinitionCache(PropertyDefinition propertyDefinition) |
void |
clearPropertyDefinitionCache() |
Authorizations |
createAuthorizations(Authorizations auths,
String... additionalAuthorizations)
Creates an authorizations object combining auths and additionalAuthorizations.
|
protected void |
deleteAllExtendedDataForElement(Element element,
Authorizations authorizations) |
abstract void |
drop()
Drops all tables.
|
void |
dumpGraph() |
void |
ensurePropertyDefined(String name,
Value value) |
Iterable<String> |
filterEdgeIdsByAuthorization(Iterable<String> edgeIds,
String authorizationToMatch,
EnumSet<ElementFilter> filters,
Authorizations authorizations)
Filters a collection of edge ids by the authorizations of that edge, properties, etc.
|
Iterable<String> |
filterVertexIdsByAuthorization(Iterable<String> vertexIds,
String authorizationToMatch,
EnumSet<ElementFilter> filters,
Authorizations authorizations)
Filters a collection of vertex ids by the authorizations of that vertex, properties, etc.
|
Iterable<Path> |
findPaths(FindPathOptions options,
Authorizations authorizations)
Finds all paths between two vertices.
|
protected void |
findPathsRecursive(FindPathOptions options,
List<Path> foundPaths,
Vertex sourceVertex,
Vertex destVertex,
int hops,
Set<String> seenVertices,
Path currentPath,
ProgressCallback progressCallback,
Authorizations authorizations) |
protected void |
findPathsSetIntersection(FindPathOptions options,
List<Path> foundPaths,
Vertex sourceVertex,
Vertex destVertex,
ProgressCallback progressCallback,
Authorizations authorizations) |
protected void |
fireGraphEvent(GraphEvent graphEvent) |
abstract void |
flush()
Flushes any pending mutations to the graph.
|
protected Iterable<ExtendedDataRow> |
getAllExtendedData(FetchHints fetchHints,
Authorizations authorizations) |
Iterable<ExtendedDataRow> |
getExtendedData(Iterable<ExtendedDataRowId> idsIterable,
FetchHints fetchHints,
Authorizations authorizations)
Gets the specified extended data rows.
|
Iterable<ExtendedDataRow> |
getExtendedDataForElements(Iterable<? extends ElementId> elementIdsArg,
String tableName,
FetchHints fetchHints,
Authorizations authorizations)
Gets the specified extended data rows.
|
Iterable<ExtendedDataRow> |
getExtendedDataInRange(ElementType elementType,
IdRange elementIdRange,
Authorizations authorizations)
Gets extended data rows from the graph in the given range.
|
protected abstract GraphMetadataStore |
getGraphMetadataStore() |
Iterable<GraphMetadataEntry> |
getMetadata()
Gets all metadata.
|
Object |
getMetadata(String key)
Gets metadata from the graph.
|
Iterable<GraphMetadataEntry> |
getMetadataWithPrefix(String prefix)
Gets all metadata with the given prefix.
|
GeMetricRegistry |
getMetricsRegistry()
Gets the metrics registry to record internal GraphEngine metrics
|
PropertyDefinition |
getPropertyDefinition(String propertyName)
Gets the property definition for the given name.
|
Collection<PropertyDefinition> |
getPropertyDefinitions()
Gets all property definitions.
|
abstract SearchIndexSecurityGranularity |
getSearchIndexSecurityGranularity()
Gets the granularity of the search index
SearchIndexSecurityGranularity |
protected Class<? extends Value> |
getValueType(Value value) |
protected boolean |
hasEventListeners() |
void |
invalidatePropertyDefinition(String propertyName) |
abstract boolean |
isFieldBoostSupported()
Determine if field boost is support.
|
boolean |
isPropertyDefined(String propertyName)
Determine if a property is already defined
|
boolean |
isQuerySimilarToTextSupported()
Returns true if this graph supports similar to text queries.
|
protected Iterable<ElementMutation> |
orderMutations(Iterable<ElementMutation<? extends Element>> mutations) |
abstract GraphQuery |
query(Authorizations authorizations)
Creates a query builder object used to query the graph.
|
abstract GraphQuery |
query(String queryString,
Authorizations authorizations)
Creates a query builder object used to query the graph.
|
SimilarToGraphQuery |
querySimilarTo(String[] fields,
String text,
Authorizations authorizations)
Creates a query builder object that finds all vertices similar to the given text for the specified fields.
|
abstract void |
reindex(Authorizations authorizations)
Reindex all vertices and edges.
|
void |
reloadMetadata()
Force a reload of graph metadata.
|
void |
removeGraphEventListener(GraphEventListener graphEventListener)
Removes a graph event listener
|
void |
removeMetadata(String key)
Removes metadata from graph
|
void |
removePropertyDefinition(String propertyName)
Removes the property with the given name
|
Iterable<Element> |
saveElementMutations(Iterable<ElementMutation<? extends Element>> mutations,
Authorizations authorizations)
Saves multiple mutations with a single call.
|
void |
savePropertyDefinition(PropertyDefinition propertyDefinition)
Save a pre-made property definition.
|
void |
setMetadata(String key,
Object value)
Sets metadata on the graph.
|
abstract void |
shutdown()
Cleans up or disconnects from the underlying storage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEdge, addEdge, addEdge, addEdge, addVertex, addVertex, addVertices, createAuthorizations, createAuthorizations, createAuthorizations, defineProperty, deleteEdge, deleteEdge, deleteElement, deleteElements, deleteExtendedDataRow, deleteVertex, deleteVertex, doEdgesExist, doEdgesExist, doesEdgeExist, doesVertexExist, doVerticesExist, findPaths, findPaths, findPaths, findPaths, findRelatedEdgeIds, findRelatedEdgeIds, findRelatedEdgeIdsForVertices, findRelatedEdges, findRelatedEdges, findRelatedEdgeSummary, findRelatedEdgeSummary, findRelatedEdgeSummaryForVertices, getDefaultFetchHints, getEdge, getEdge, getEdge, getEdgeCount, getEdges, getEdges, getEdges, getEdges, getEdges, getEdges, getEdgesInRange, getEdgesInRange, getEdgesInRange, getElement, getElement, getExtendedData, getExtendedData, getExtendedData, getExtendedData, getExtendedData, getExtendedData, getExtendedDataForElements, getExtendedDataForElements, getExtendedDataForElements, getIdGenerator, getNameSubstitutionStrategy, getStreamingPropertyValueInputStreams, getVertex, getVertex, getVertex, getVertexCount, getVertexIds, getVertexPropertyCountByValue, getVertices, getVertices, getVertices, getVertices, getVertices, getVertices, getVerticesInOrder, getVerticesInOrder, getVerticesInRange, getVerticesInRange, getVerticesInRange, getVerticesWithPrefix, getVerticesWithPrefix, getVerticesWithPrefix, isVisibilityValid, markEdgeHidden, markEdgeVisible, markVertexHidden, markVertexVisible, prepareEdge, prepareEdge, prepareEdge, prepareEdge, prepareEdge, prepareEdge, prepareVertex, prepareVertex, prepareVertex, prepareVertex, query, query, softDeleteEdge, softDeleteEdge, softDeleteEdge, softDeleteEdge, softDeleteVertex, softDeleteVertex, softDeleteVertex, softDeleteVertex, truncate, visit, visitEdges, visitElements, visitVerticesprotected static final GeLogger QUERY_LOGGER
public static final String METADATA_DEFINE_PROPERTY_PREFIX
protected final Timer flushTimer
protected final StackTraceTracker flushStackTraceTracker
protected GraphBase(boolean strictTyping,
GeMetricRegistry metricRegistry)
public Iterable<String> filterEdgeIdsByAuthorization(Iterable<String> edgeIds, String authorizationToMatch, EnumSet<ElementFilter> filters, Authorizations authorizations)
GraphfilterEdgeIdsByAuthorization in interface GraphedgeIds - The edge ids to filter on.authorizationToMatch - The authorization to look forfilters - The parts of the edge to filter onauthorizations - The authorization to find the edges withpublic Iterable<String> filterVertexIdsByAuthorization(Iterable<String> vertexIds, String authorizationToMatch, EnumSet<ElementFilter> filters, Authorizations authorizations)
GraphfilterVertexIdsByAuthorization in interface GraphvertexIds - The vertex ids to filter on.authorizationToMatch - The authorization to look forfilters - The parts of the edge to filter onauthorizations - The authorization to find the edges withpublic Iterable<Path> findPaths(FindPathOptions options, Authorizations authorizations)
Graphprotected void findPathsSetIntersection(FindPathOptions options, List<Path> foundPaths, Vertex sourceVertex, Vertex destVertex, ProgressCallback progressCallback, Authorizations authorizations)
protected void findPathsRecursive(FindPathOptions options, List<Path> foundPaths, Vertex sourceVertex, Vertex destVertex, int hops, Set<String> seenVertices, Path currentPath, ProgressCallback progressCallback, Authorizations authorizations)
protected abstract GraphMetadataStore getGraphMetadataStore()
public Iterable<GraphMetadataEntry> getMetadata()
GraphgetMetadata in interface Graphpublic void setMetadata(String key, Object value)
GraphsetMetadata in interface Graphkey - The key to the metadata.value - The value to set.public void removeMetadata(String key)
GraphremoveMetadata in interface Graphpublic Object getMetadata(String key)
GraphgetMetadata in interface Graphkey - The key to the metadata.public void reloadMetadata()
GraphreloadMetadata in interface Graphpublic Iterable<GraphMetadataEntry> getMetadataWithPrefix(String prefix)
GraphgetMetadataWithPrefix in interface Graphpublic abstract GraphQuery query(Authorizations authorizations)
Graphpublic abstract GraphQuery query(String queryString, Authorizations authorizations)
Graphpublic abstract void reindex(Authorizations authorizations)
Graphpublic abstract void flush()
Graphpublic abstract void shutdown()
Graphpublic abstract void drop()
Graphpublic abstract boolean isFieldBoostSupported()
GraphisFieldBoostSupported in interface Graphpublic abstract SearchIndexSecurityGranularity getSearchIndexSecurityGranularity()
GraphSearchIndexSecurityGranularitygetSearchIndexSecurityGranularity in interface Graphpublic void addGraphEventListener(GraphEventListener graphEventListener)
GraphaddGraphEventListener in interface Graphpublic void removeGraphEventListener(GraphEventListener graphEventListener)
GraphremoveGraphEventListener in interface GraphgraphEventListener - The listener to removeprotected boolean hasEventListeners()
protected void fireGraphEvent(GraphEvent graphEvent)
public boolean isQuerySimilarToTextSupported()
GraphisQuerySimilarToTextSupported in interface Graphpublic SimilarToGraphQuery querySimilarTo(String[] fields, String text, Authorizations authorizations)
GraphquerySimilarTo in interface Graphfields - The fields to match against.text - The text to find similar to.authorizations - The authorizations required to load the elements.public Authorizations createAuthorizations(Authorizations auths, String... additionalAuthorizations)
GraphcreateAuthorizations in interface Graphauths - The authorizations granted.additionalAuthorizations - additional authorizationsprotected void addToPropertyDefinitionCache(PropertyDefinition propertyDefinition)
public void clearPropertyDefinitionCache()
public void invalidatePropertyDefinition(String propertyName)
public void savePropertyDefinition(PropertyDefinition propertyDefinition)
GraphsavePropertyDefinition in interface GraphpropertyDefinition - the property definition to save.public PropertyDefinition getPropertyDefinition(String propertyName)
GraphgetPropertyDefinition in interface GraphpropertyName - name of the propertypublic void removePropertyDefinition(String propertyName)
GraphremovePropertyDefinition in interface Graphpublic Collection<PropertyDefinition> getPropertyDefinitions()
GraphgetPropertyDefinitions in interface Graphpublic boolean isPropertyDefined(String propertyName)
GraphisPropertyDefined in interface Graphpublic void ensurePropertyDefined(String name, Value value)
ensurePropertyDefined in interface Graphpublic Iterable<Element> saveElementMutations(Iterable<ElementMutation<? extends Element>> mutations, Authorizations authorizations)
GraphsaveElementMutations in interface Graphmutations - the mutations to saveauthorizations - the authorizations used during saveprotected Iterable<ElementMutation> orderMutations(Iterable<ElementMutation<? extends Element>> mutations)
public Iterable<ExtendedDataRow> getExtendedData(Iterable<ExtendedDataRowId> idsIterable, FetchHints fetchHints, Authorizations authorizations)
GraphgetExtendedData in interface GraphidsIterable - The ids of the rows to get.authorizations - The authorizations used to get the rowspublic Iterable<ExtendedDataRow> getExtendedDataForElements(Iterable<? extends ElementId> elementIdsArg, String tableName, FetchHints fetchHints, Authorizations authorizations)
GraphgetExtendedDataForElements in interface GraphelementIdsArg - The element ids of the elements to get the rows fromtableName - The name of the table within the element to get the rows fromfetchHints - Fetch hints to filter extended dataauthorizations - The authorizations used to get the rowspublic Iterable<ExtendedDataRow> getExtendedDataInRange(ElementType elementType, IdRange elementIdRange, Authorizations authorizations)
GraphgetExtendedDataInRange in interface GraphelementType - The type of element to get the rows fromelementIdRange - The range of element ids to get extended data rows for.authorizations - The authorizations required to load the vertex.protected Iterable<ExtendedDataRow> getAllExtendedData(FetchHints fetchHints, Authorizations authorizations)
protected void deleteAllExtendedDataForElement(Element element, Authorizations authorizations)
public GeMetricRegistry getMetricsRegistry()
GraphgetMetricsRegistry in interface GraphCopyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.