public class InMemoryGraph extends GraphBaseWithSearchIndex
| Modifier and Type | Field and Description |
|---|---|
protected static InMemoryGraphConfiguration |
DEFAULT_CONFIGURATION |
METADATA_ID_GENERATOR_CLASSNAMEflushStackTraceTracker, flushTimer, METADATA_DEFINE_PROPERTY_PREFIX, QUERY_LOGGER| Modifier | Constructor and Description |
|---|---|
protected |
InMemoryGraph(InMemoryGraphConfiguration configuration) |
protected |
InMemoryGraph(InMemoryGraphConfiguration configuration,
IdGenerator idGenerator,
SearchIndex searchIndex) |
protected |
InMemoryGraph(InMemoryGraphConfiguration configuration,
IdGenerator idGenerator,
SearchIndex searchIndex,
InMemoryVertexTable verticesTable,
InMemoryEdgeTable edgesTable,
InMemoryExtendedDataTable extendedDataTable) |
protected |
InMemoryGraph(InMemoryGraphConfiguration configuration,
InMemoryVertexTable verticesTable,
InMemoryEdgeTable edgesTable,
InMemoryExtendedDataTable extendedDataTable) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyValue(InMemoryElement element,
InMemoryTableElement inMemoryTableElement,
String key,
String name,
Value value,
Metadata metadata,
Visibility visibility,
Long timestamp,
Authorizations authorizations) |
protected void |
alterConceptType(InMemoryTableVertex inMemoryTableVertex,
long timestamp,
String newConceptType) |
protected void |
alterEdgeLabel(InMemoryTableEdge inMemoryTableEdge,
long timestamp,
String newEdgeLabel) |
protected void |
alterElementPropertyMetadata(InMemoryTableElement inMemoryTableElement,
List<SetPropertyMetadata> setPropertyMetadatas,
Authorizations authorizations) |
protected void |
alterElementPropertyVisibilities(InMemoryTableElement inMemoryTableElement,
List<AlterPropertyVisibility> alterPropertyVisibilities,
Authorizations authorizations) |
protected void |
alterElementVisibility(InMemoryTableElement inMemoryTableElement,
Visibility newEdgeVisibility) |
static InMemoryGraph |
create() |
static InMemoryGraph |
create(InMemoryGraphConfiguration config) |
static InMemoryGraph |
create(InMemoryGraphConfiguration config,
IdGenerator idGenerator,
SearchIndex searchIndex) |
static InMemoryGraph |
create(Map<String,Object> config) |
Authorizations |
createAuthorizations(String... auths)
Creates an authorizations object.
|
void |
deleteEdge(Edge edge,
Authorizations authorizations)
Permanently deletes an edge from the graph.
|
void |
deleteExtendedData(InMemoryElement element,
String tableName,
String row,
String columnName,
String key,
Visibility visibility,
Authorizations authorizations) |
void |
deleteExtendedDataRow(ExtendedDataRowId id,
Authorizations authorizations)
Deletes an extended data row
|
protected void |
deleteProperty(InMemoryElement element,
InMemoryTableElement inMemoryTableElement,
String key,
String name,
Visibility visibility,
Authorizations authorizations) |
void |
deleteVertex(Vertex vertex,
Authorizations authorizations)
Permanently deletes a vertex from the graph.
|
void |
drop()
Drops all tables.
|
void |
extendedData(Element element,
ExtendedDataRowId rowId,
ExtendedDataMutation extendedData,
Authorizations authorizations) |
protected void |
findPathsRecursive(FindPathOptions options,
List<Path> foundPaths,
String sourceVertexId,
String destVertexId,
int hops,
Set<String> seenVertices,
Path currentPath,
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) |
void |
flushGraph()
This method will only flush the primary graph and not the search index
|
Edge |
getEdge(String edgeId,
FetchHints fetchHints,
Long endTime,
Authorizations authorizations)
Get an edge from the graph.
|
Iterable<Edge> |
getEdges(FetchHints fetchHints,
Long endTime,
Authorizations authorizations)
Gets all edges on the graph.
|
protected Iterable<Edge> |
getEdgesFromVertex(String vertexId,
FetchHints fetchHints,
Long endTime,
Authorizations authorizations) |
Iterable<? extends ExtendedDataRow> |
getExtendedDataTable(ElementType elementType,
String elementId,
String tableName,
FetchHints fetchHints,
Authorizations authorizations) |
com.google.common.collect.ImmutableSet<String> |
getExtendedDataTableNames(ElementType elementType,
String elementId,
FetchHints fetchHints,
Authorizations authorizations) |
protected GraphMetadataStore |
getGraphMetadataStore() |
Vertex |
getVertex(String vertexId,
FetchHints fetchHints,
Long endTime,
Authorizations authorizations)
Get a vertex from the graph.
|
Iterable<String> |
getVertexIds(Authorizations authorizations) |
Iterable<Vertex> |
getVertices(FetchHints fetchHints,
Long endTime,
Authorizations authorizations)
Gets all vertices on the graph.
|
protected boolean |
isIncluded(InMemoryTableElement element,
FetchHints fetchHints,
Authorizations authorizations) |
protected boolean |
isIncludedInTimeSpan(InMemoryTableElement element,
FetchHints fetchHints,
Long endTime,
Authorizations authorizations) |
boolean |
isVisibilityValid(Visibility visibility,
Authorizations authorizations)
Given an authorization is the visibility object valid.
|
void |
markEdgeHidden(Edge edge,
Visibility visibility,
Authorizations authorizations)
Marks an edge as hidden for a given visibility.
|
void |
markEdgeVisible(Edge edge,
Visibility visibility,
Authorizations authorizations)
Marks an edge as visible for a given visibility, effectively undoing markEdgeHidden.
|
void |
markPropertyHidden(InMemoryElement element,
InMemoryTableElement inMemoryTableElement,
Property property,
Long timestamp,
Visibility visibility,
Authorizations authorizations) |
void |
markPropertyVisible(InMemoryElement element,
InMemoryTableElement inMemoryTableElement,
String key,
String name,
Visibility propertyVisibility,
Long timestamp,
Visibility visibility,
Authorizations authorizations) |
void |
markVertexHidden(Vertex vertex,
Visibility visibility,
Authorizations authorizations)
Marks a vertex as hidden for a given visibility.
|
void |
markVertexVisible(Vertex vertex,
Visibility visibility,
Authorizations authorizations)
Marks a vertex as visible for a given visibility, effectively undoing markVertexHidden.
|
protected GraphMetadataStore |
newGraphMetadataStore(GraphConfiguration configuration) |
EdgeBuilderByVertexId |
prepareEdge(String edgeId,
String outVertexId,
String inVertexId,
String label,
Long timestamp,
Visibility visibility)
Prepare an edge to be added to the graph.
|
EdgeBuilder |
prepareEdge(String edgeId,
Vertex outVertex,
Vertex inVertex,
String label,
Long timestamp,
Visibility visibility)
Prepare an edge to be added to the graph.
|
VertexBuilder |
prepareVertex(String vertexId,
Long timestamp,
Visibility visibility,
String conceptType)
Prepare a vertex to be added to the graph.
|
protected StreamingPropertyValueRef |
saveStreamingPropertyValue(String elementId,
String key,
String name,
Visibility visibility,
long timestamp,
StreamingPropertyValue value) |
void |
softDeleteEdge(Edge edge,
Long timestamp,
Authorizations authorizations)
Soft deletes an edge from the graph.
|
protected void |
softDeleteProperty(InMemoryTableElement inMemoryTableElement,
Property property,
Long timestamp,
IndexHint indexHint,
Authorizations authorizations) |
void |
softDeleteVertex(Vertex vertex,
Long timestamp,
Authorizations authorizations)
Soft deletes a vertex from the graph.
|
void |
truncate()
Clears all data from the graph.
|
protected void |
validateAuthorizations(Authorizations authorizations) |
flush, getBackupDir, getBackupTool, getConfiguration, getDefaultFetchHints, getIdGenerator, getRestoreTool, getSearchIndex, getSearchIndexSecurityGranularity, getVertexPropertyCountByValue, isFieldBoostSupported, isQuerySimilarToTextSupported, prepareVertex, query, query, query, query, querySimilarTo, reindex, reindexVertices, saveElementMutations, setup, setupGraphMetadata, setupGraphMetadata, shutdownaddGraphEventListener, addToPropertyDefinitionCache, clearPropertyDefinitionCache, createAuthorizations, deleteAllExtendedDataForElement, dumpGraph, ensurePropertyDefined, filterEdgeIdsByAuthorization, filterVertexIdsByAuthorization, findPaths, findPathsSetIntersection, fireGraphEvent, getAllExtendedData, getExtendedData, getExtendedDataForElements, getExtendedDataInRange, getMetadata, getMetadata, getMetadataWithPrefix, getMetricsRegistry, getPropertyDefinition, getPropertyDefinitions, getValueType, hasEventListeners, invalidatePropertyDefinition, isPropertyDefined, orderMutations, reloadMetadata, removeGraphEventListener, removeMetadata, removePropertyDefinition, savePropertyDefinition, setMetadataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEdge, addEdge, addEdge, addEdge, addGraphEventListener, addVertex, addVertex, addVertices, createAuthorizations, createAuthorizations, createAuthorizations, defineProperty, deleteEdge, deleteElement, deleteElements, deleteVertex, doEdgesExist, doEdgesExist, doesEdgeExist, doesVertexExist, doVerticesExist, dumpGraph, ensurePropertyDefined, filterEdgeIdsByAuthorization, filterVertexIdsByAuthorization, findPaths, findPaths, findPaths, findPaths, findPaths, findRelatedEdgeIds, findRelatedEdgeIds, findRelatedEdgeIdsForVertices, findRelatedEdges, findRelatedEdges, findRelatedEdgeSummary, findRelatedEdgeSummary, findRelatedEdgeSummaryForVertices, getEdge, getEdge, getEdgeCount, getEdges, getEdges, getEdges, getEdges, getEdges, getEdgesInRange, getEdgesInRange, getEdgesInRange, getElement, getElement, getExtendedData, getExtendedData, getExtendedData, getExtendedData, getExtendedData, getExtendedData, getExtendedData, getExtendedDataForElements, getExtendedDataForElements, getExtendedDataForElements, getExtendedDataForElements, getExtendedDataInRange, getMetadata, getMetadata, getMetadataWithPrefix, getMetricsRegistry, getNameSubstitutionStrategy, getPropertyDefinition, getPropertyDefinitions, getStreamingPropertyValueInputStreams, getVertex, getVertex, getVertexCount, getVertices, getVertices, getVertices, getVertices, getVertices, getVerticesInOrder, getVerticesInOrder, getVerticesInRange, getVerticesInRange, getVerticesInRange, getVerticesWithPrefix, getVerticesWithPrefix, getVerticesWithPrefix, isPropertyDefined, prepareEdge, prepareEdge, prepareEdge, prepareEdge, prepareVertex, prepareVertex, reloadMetadata, removeGraphEventListener, removeMetadata, removePropertyDefinition, savePropertyDefinition, setMetadata, softDeleteEdge, softDeleteEdge, softDeleteEdge, softDeleteVertex, softDeleteVertex, softDeleteVertex, visit, visitEdges, visitElements, visitVerticesprotected static final InMemoryGraphConfiguration DEFAULT_CONFIGURATION
protected InMemoryGraph(InMemoryGraphConfiguration configuration)
protected InMemoryGraph(InMemoryGraphConfiguration configuration, IdGenerator idGenerator, SearchIndex searchIndex)
protected InMemoryGraph(InMemoryGraphConfiguration configuration, InMemoryVertexTable verticesTable, InMemoryEdgeTable edgesTable, InMemoryExtendedDataTable extendedDataTable)
protected InMemoryGraph(InMemoryGraphConfiguration configuration, IdGenerator idGenerator, SearchIndex searchIndex, InMemoryVertexTable verticesTable, InMemoryEdgeTable edgesTable, InMemoryExtendedDataTable extendedDataTable)
protected GraphMetadataStore newGraphMetadataStore(GraphConfiguration configuration)
public static InMemoryGraph create()
public static InMemoryGraph create(InMemoryGraphConfiguration config)
public static InMemoryGraph create(Map<String,Object> config)
public static InMemoryGraph create(InMemoryGraphConfiguration config, IdGenerator idGenerator, SearchIndex searchIndex)
public VertexBuilder prepareVertex(String vertexId, Long timestamp, Visibility visibility, String conceptType)
GraphprepareVertex in interface GraphprepareVertex in class GraphBaseWithSearchIndexvertexId - The id to assign the new vertex.timestamp - The timestamp of the vertex.visibility - The visibility to assign to the new vertex.conceptType - The concept to assign the new vertex.public Iterable<Vertex> getVertices(FetchHints fetchHints, Long endTime, Authorizations authorizations) throws GeException
GraphgetVertices in interface GraphgetVertices in class GraphBaseWithSearchIndexfetchHints - Hint at what parts of the vertex to fetch.endTime - Include all changes made up until the point in time.authorizations - The authorizations required to load the vertex.GeExceptionpublic Iterable<String> getVertexIds(Authorizations authorizations)
protected void validateAuthorizations(Authorizations authorizations)
public void deleteVertex(Vertex vertex, Authorizations authorizations)
GraphdeleteVertex in interface GraphdeleteVertex in class GraphBaseWithSearchIndexvertex - The vertex to delete.authorizations - The authorizations required to delete the vertex.public void softDeleteVertex(Vertex vertex, Long timestamp, Authorizations authorizations)
GraphsoftDeleteVertex in interface GraphsoftDeleteVertex in class GraphBaseWithSearchIndexvertex - The vertex to soft delete.authorizations - The authorizations required to soft delete the vertex.public void markVertexHidden(Vertex vertex, Visibility visibility, Authorizations authorizations)
GraphmarkVertexHidden in interface GraphmarkVertexHidden in class GraphBaseWithSearchIndexvertex - The vertex to mark hidden.visibility - The visibility string under which this vertex is hidden.
This visibility can be a superset of the vertex visibility to mark
it as hidden for only a subset of authorizations.authorizations - The authorizations used.public void markVertexVisible(Vertex vertex, Visibility visibility, Authorizations authorizations)
GraphmarkVertexVisible in interface GraphmarkVertexVisible in class GraphBaseWithSearchIndexvertex - The vertex to mark visible.visibility - The visibility string under which this vertex is now visible.authorizations - The authorizations used.public void markPropertyHidden(InMemoryElement element, InMemoryTableElement inMemoryTableElement, Property property, Long timestamp, Visibility visibility, Authorizations authorizations)
public void markPropertyVisible(InMemoryElement element, InMemoryTableElement inMemoryTableElement, String key, String name, Visibility propertyVisibility, Long timestamp, Visibility visibility, Authorizations authorizations)
public EdgeBuilderByVertexId prepareEdge(String edgeId, String outVertexId, String inVertexId, String label, Long timestamp, Visibility visibility)
GraphprepareEdge in interface GraphprepareEdge in class GraphBaseWithSearchIndexedgeId - The id to assign the new edge.outVertexId - The source vertex id. The "out" side of the edge.inVertexId - The destination vertex id. The "in" side of the edge.label - The label to assign to the edge. eg knows, works at, etc.timestamp - The timestamp of the edge.visibility - The visibility to assign to the new edge.public EdgeBuilder prepareEdge(String edgeId, Vertex outVertex, Vertex inVertex, String label, Long timestamp, Visibility visibility)
GraphprepareEdge in interface GraphprepareEdge in class GraphBaseWithSearchIndexedgeId - The id to assign the new edge.outVertex - The source vertex. The "out" side of the edge.inVertex - The destination vertex. The "in" side of the edge.label - The label to assign to the edge. eg knows, works at, etc.timestamp - The timestamp of the edge.visibility - The visibility to assign to the new edge.public Iterable<Edge> getEdges(FetchHints fetchHints, Long endTime, Authorizations authorizations)
GraphgetEdges in interface GraphgetEdges in class GraphBaseWithSearchIndexfetchHints - Hint at what parts of the edge to fetch.endTime - Include all changes made up until the point in time.authorizations - The authorizations required to load the edge.protected GraphMetadataStore getGraphMetadataStore()
getGraphMetadataStore in class GraphBaseWithSearchIndexpublic void deleteEdge(Edge edge, Authorizations authorizations)
GraphdeleteEdge in interface GraphdeleteEdge in class GraphBaseWithSearchIndexedge - The edge to delete from the graph.authorizations - The authorizations required to delete the edge.public void softDeleteEdge(Edge edge, Long timestamp, Authorizations authorizations)
GraphsoftDeleteEdge in interface GraphsoftDeleteEdge in class GraphBaseWithSearchIndexedge - The edge to soft delete from the graph.authorizations - The authorizations required to delete the edge.public void markEdgeHidden(Edge edge, Visibility visibility, Authorizations authorizations)
GraphmarkEdgeHidden in interface GraphmarkEdgeHidden in class GraphBaseWithSearchIndexedge - The edge to mark hidden.visibility - The visibility string under which this edge is hidden.
This visibility can be a superset of the edge visibility to mark
it as hidden for only a subset of authorizations.authorizations - The authorizations used.public void markEdgeVisible(Edge edge, Visibility visibility, Authorizations authorizations)
GraphmarkEdgeVisible in interface GraphmarkEdgeVisible in class GraphBaseWithSearchIndexedge - The edge to mark visible.visibility - The visibility string under which this edge is now visible.authorizations - The authorizations used.public Authorizations createAuthorizations(String... auths)
GraphcreateAuthorizations in interface GraphcreateAuthorizations in class GraphBaseWithSearchIndexauths - The authorizations granted.protected void findPathsRecursive(FindPathOptions options, List<Path> foundPaths, Vertex sourceVertex, Vertex destVertex, int hops, Set<String> seenVertices, Path currentPath, ProgressCallback progressCallback, Authorizations authorizations)
findPathsRecursive in class GraphBaseprotected void findPathsRecursive(FindPathOptions options, List<Path> foundPaths, String sourceVertexId, String destVertexId, int hops, Set<String> seenVertices, Path currentPath, ProgressCallback progressCallback, Authorizations authorizations)
protected Iterable<Edge> getEdgesFromVertex(String vertexId, FetchHints fetchHints, Long endTime, Authorizations authorizations)
protected boolean isIncluded(InMemoryTableElement element, FetchHints fetchHints, Authorizations authorizations)
protected boolean isIncludedInTimeSpan(InMemoryTableElement element, FetchHints fetchHints, Long endTime, Authorizations authorizations)
protected void softDeleteProperty(InMemoryTableElement inMemoryTableElement, Property property, Long timestamp, IndexHint indexHint, Authorizations authorizations)
public void addPropertyValue(InMemoryElement element, InMemoryTableElement inMemoryTableElement, String key, String name, Value value, Metadata metadata, Visibility visibility, Long timestamp, Authorizations authorizations)
protected void alterElementVisibility(InMemoryTableElement inMemoryTableElement, Visibility newEdgeVisibility)
protected void alterElementPropertyVisibilities(InMemoryTableElement inMemoryTableElement, List<AlterPropertyVisibility> alterPropertyVisibilities, Authorizations authorizations)
protected void alterElementPropertyMetadata(InMemoryTableElement inMemoryTableElement, List<SetPropertyMetadata> setPropertyMetadatas, Authorizations authorizations)
protected StreamingPropertyValueRef saveStreamingPropertyValue(String elementId, String key, String name, Visibility visibility, long timestamp, StreamingPropertyValue value)
public boolean isVisibilityValid(Visibility visibility, Authorizations authorizations)
GraphisVisibilityValid in interface GraphisVisibilityValid in class GraphBaseWithSearchIndexvisibility - The visibility you want to check.authorizations - The given authorizations.public void truncate()
Graphtruncate in interface Graphtruncate in class GraphBaseWithSearchIndexpublic void drop()
Graphdrop in interface Graphdrop in class GraphBaseWithSearchIndexprotected void alterEdgeLabel(InMemoryTableEdge inMemoryTableEdge, long timestamp, String newEdgeLabel)
protected void alterConceptType(InMemoryTableVertex inMemoryTableVertex, long timestamp, String newConceptType)
protected void deleteProperty(InMemoryElement element, InMemoryTableElement inMemoryTableElement, String key, String name, Visibility visibility, Authorizations authorizations)
public com.google.common.collect.ImmutableSet<String> getExtendedDataTableNames(ElementType elementType, String elementId, FetchHints fetchHints, Authorizations authorizations)
public Iterable<? extends ExtendedDataRow> getExtendedDataTable(ElementType elementType, String elementId, String tableName, FetchHints fetchHints, Authorizations authorizations)
public void extendedData(Element element, ExtendedDataRowId rowId, ExtendedDataMutation extendedData, Authorizations authorizations)
public void deleteExtendedDataRow(ExtendedDataRowId id, Authorizations authorizations)
Graphpublic void deleteExtendedData(InMemoryElement element, String tableName, String row, String columnName, String key, Visibility visibility, Authorizations authorizations)
public void flushGraph()
GraphWithSearchIndexpublic Vertex getVertex(String vertexId, FetchHints fetchHints, Long endTime, Authorizations authorizations)
GraphvertexId - The vertex id to retrieve from the graph.fetchHints - Hint at what parts of the vertex to fetch.endTime - Include all changes made up until the point in time.authorizations - The authorizations required to load the vertex.public Edge getEdge(String edgeId, FetchHints fetchHints, Long endTime, Authorizations authorizations)
GraphedgeId - The edge id to retrieve from the graph.fetchHints - Hint at what parts of the edge to fetch.endTime - Include all changes made up until the point in time.authorizations - The authorizations required to load the edge.Copyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.