public TElement get(InMemoryGraph graph, String id, FetchHints fetchHints, Authorizations authorizations) { InMemoryTableElement<TElement> inMemoryTableElement = getTableElement(id); if (inMemoryTableElement == null) { return null; } return inMemoryTableElement.createElement(graph, fetchHints, authorizations); }
protected InMemoryGraph(InMemoryGraphConfiguration configuration, IdGenerator idGenerator, SearchIndex searchIndex) { this( configuration, idGenerator, searchIndex, new InMemoryVertexTable(), new InMemoryEdgeTable(), new MapInMemoryExtendedDataTable() ); }
@Override public Authorizations createAuthorizations(String... auths) { addValidAuthorizations(auths); return new InMemoryAuthorizations(auths); }
@SuppressWarnings("unused") public static InMemoryGraph create(Map<String, Object> config) { return create(new InMemoryGraphConfiguration(config)); }
@Override public StreamingPropertyValue toStreamingPropertyValue(InMemoryGraph graph, long timestamp) { return new InMemoryStreamingPropertyValue( valueData, getValueType()).searchIndex(isSearchIndex()); } }
protected void softDeleteProperty(String key, String name, Long timestamp, Visibility visibility, IndexHint indexHint, Authorizations authorizations) { Property property = getProperty(key, name, visibility); if (property != null) { getGraph().softDeleteProperty(inMemoryTableElement, property, timestamp, indexHint, authorizations); } }
public void addData( ExtendedDataRowId rowId, String column, String key, Object value, long timestamp, Visibility visibility ) { InMemoryExtendedDataRow row = findOrAddRow(rowId); row.addColumn(column, key, value, timestamp, visibility); }
@Override public Iterable<Vertex> getVertices(final Direction direction, final String[] labels, final FetchHints fetchHints, final Authorizations authorizations) { Iterable<String> vertexIds = getVertexIds(direction, labels, authorizations); return getGraph().getVertices(vertexIds, fetchHints, authorizations); }
@Override public Iterable<Vertex> getVertices(Direction direction, String label, Authorizations authorizations) { return getVertices(direction, label, getGraph().getDefaultFetchHints(), authorizations); }
@Override public InMemoryEdge createElementInternal(InMemoryGraph graph, FetchHints fetchHints, Long endTime, Authorizations authorizations) { return new InMemoryEdge(graph, getId(), this, fetchHints, endTime, authorizations); } }
@Override public InMemoryVertex createElementInternal(InMemoryGraph graph, FetchHints fetchHints, Long endTime, Authorizations authorizations) { return new InMemoryVertex(graph, getId(), this, fetchHints, endTime, authorizations); } }
@Override public Iterable<Edge> getEdges(Vertex otherVertex, Direction direction, String[] labels, Authorizations authorizations) { return getEdges(otherVertex, direction, labels, getGraph().getDefaultFetchHints(), authorizations); }
@Override public Vertex getVertex(Direction direction, Authorizations authorizations) { return getVertex(direction, getGraph().getDefaultFetchHints(), authorizations); }
@Override public Vertex getOtherVertex(String myVertexId, FetchHints fetchHints, Authorizations authorizations) { return getGraph().getVertex(getOtherVertexId(myVertexId), fetchHints, authorizations); }
@Override public EdgeVertices getVertices(Authorizations authorizations) { return getVertices(getGraph().getDefaultFetchHints(), authorizations); }
public void removeColumn(ExtendedDataRowId rowId, String columnName, String key, Visibility visibility) { InMemoryExtendedDataRow row = findRow(rowId); if (row == null) { return; } row.removeColumn(columnName, key, visibility); } }
@Override public void markPropertyHidden(Property property, Long timestamp, Visibility visibility, Authorizations authorizations) { getGraph().markPropertyHidden( this, inMemoryTableElement, property, null, visibility, authorizations ); }
@Override public Iterable<Vertex> getVertices(FetchHints fetchHints, final Long endTime, final Authorizations authorizations) throws VertexiumException { validateAuthorizations(authorizations); return new ConvertingIterable<InMemoryVertex, Vertex>(this.vertices.getAll(InMemoryGraph.this, fetchHints, endTime, authorizations)) { @Override protected Vertex convert(InMemoryVertex o) { return o; } }; }
@Override public void deleteProperty(String key, String name, Visibility visibility, Authorizations authorizations) { getGraph().deleteProperty(this, inMemoryTableElement, key, name, visibility, authorizations); }
protected InMemoryGraph(InMemoryGraphConfiguration configuration) { this( configuration, new InMemoryVertexTable(), new InMemoryEdgeTable(), new MapInMemoryExtendedDataTable() ); }