@Override public void addAll(Mutation... newMutations) { super.addAll(newMutations); store(); }
@Override public void appendAddPropertyMetadataMutation(String key, String name, Metadata metadata, Visibility visibility, Long timestamp) { super.appendAddPropertyMetadataMutation(key, name, metadata, visibility, timestamp); store(); }
@Override public void appendAddPropertyValueMutation(String key, String name, Object value, Metadata metadata, Visibility visibility, Long timestamp) { super.appendAddPropertyValueMutation(key, name, value, metadata, visibility, timestamp); store(); }
) { for (AlterPropertyVisibility apv : alterPropertyVisibilities) { Property property = inMemoryTableElement.getProperty( apv.getKey(), apv.getName(), Metadata metadata = property.getMetadata(); inMemoryTableElement.appendSoftDeletePropertyMutation( apv.getKey(), apv.getName(), if (value instanceof StreamingPropertyValue) { value = saveStreamingPropertyValue( inMemoryTableElement.getId(), apv.getKey(), apv.getName(), ); inMemoryTableElement.appendAddPropertyValueMutation( apv.getKey(), apv.getName(),
protected void softDeleteProperty(InMemoryTableElement inMemoryTableElement, Property property, Long timestamp, IndexHint indexHint, Authorizations authorizations) { Element element; if (inMemoryTableElement instanceof InMemoryTableVertex) { inMemoryTableElement.appendSoftDeletePropertyMutation(property.getKey(), property.getName(), property.getVisibility(), timestamp); element = getVertex(inMemoryTableElement.getId(), FetchHints.ALL_INCLUDING_HIDDEN, authorizations); } else if (inMemoryTableElement instanceof InMemoryTableEdge) { inMemoryTableElement.appendSoftDeletePropertyMutation(property.getKey(), property.getName(), property.getVisibility(), timestamp); element = getEdge(inMemoryTableElement.getId(), FetchHints.ALL_INCLUDING_HIDDEN, authorizations); } else { throw new IllegalArgumentException("Unexpected element type: " + inMemoryTableElement.getClass().getName()); } if (indexHint != IndexHint.DO_NOT_INDEX) { getSearchIndex().deleteProperty(this, element, PropertyDescriptor.fromProperty(property), authorizations); } if (hasEventListeners()) { fireGraphEvent(new SoftDeletePropertyEvent(this, element, property)); } }
@Override public void appendSoftDeleteMutation(Long timestamp) { super.appendSoftDeleteMutation(timestamp); store(); }
@Override public void appendMarkHiddenMutation(Visibility visibility) { super.appendMarkHiddenMutation(visibility); store(); }
@Override public void appendMarkVisibleMutation(Visibility visibility) { super.appendMarkVisibleMutation(visibility); store(); }
); inMemoryTableElement.appendAddPropertyValueMutation(key, name, value, metadata, visibility, timestamp); Property property = inMemoryTableElement.getProperty(key, name, visibility, FetchHints.ALL_INCLUDING_HIDDEN, authorizations);
protected void alterElementPropertyMetadata( InMemoryTableElement inMemoryTableElement, List<SetPropertyMetadata> setPropertyMetadatas, Authorizations authorizations ) { for (SetPropertyMetadata spm : setPropertyMetadatas) { Property property = inMemoryTableElement.getProperty( spm.getPropertyKey(), spm.getPropertyName(), spm.getPropertyVisibility(), FetchHints.ALL_INCLUDING_HIDDEN, authorizations ); if (property == null) { throw new VertexiumException("Could not find property " + spm.getPropertyKey() + ":" + spm.getPropertyName()); } Metadata metadata = Metadata.create(property.getMetadata()); metadata.add(spm.getMetadataName(), spm.getNewValue(), spm.getMetadataVisibility()); long newTimestamp = IncreasingTime.currentTimeMillis(); inMemoryTableElement.appendAddPropertyMetadataMutation( property.getKey(), property.getName(), metadata, property.getVisibility(), newTimestamp); } }
protected void alterElementVisibility(InMemoryTableElement inMemoryTableElement, Visibility newEdgeVisibility) { inMemoryTableElement.appendAlterVisibilityMutation(newEdgeVisibility); }
@Override public Property appendMarkPropertyVisibleMutation(String key, String name, Visibility propertyVisibility, Long timestamp, Visibility visibility, Authorizations authorizations) { Property prop = super.appendMarkPropertyVisibleMutation(key, name, propertyVisibility, timestamp, visibility, authorizations); store(); return prop; }
@Override public Property appendMarkPropertyHiddenMutation(String key, String name, Visibility propertyVisibility, Long timestamp, Visibility visibility, Authorizations authorizations) { Property prop = super.appendMarkPropertyHiddenMutation(key, name, propertyVisibility, timestamp, visibility, authorizations); store(); return prop; }
@Override public void appendSoftDeletePropertyMutation(String key, String name, Visibility propertyVisibility, Long timestamp) { super.appendSoftDeletePropertyMutation(key, name, propertyVisibility, timestamp); store(); }
@Override public void softDeleteEdge(Edge edge, Long timestamp, Authorizations authorizations) { checkNotNull(edge, "Edge cannot be null"); if (!((InMemoryEdge) edge).canRead(authorizations)) { return; } if (timestamp == null) { timestamp = IncreasingTime.currentTimeMillis(); } this.edges.getTableElement(edge.getId()).appendSoftDeleteMutation(timestamp); getSearchIndex().deleteElement(this, edge, authorizations); if (hasEventListeners()) { fireGraphEvent(new SoftDeleteEdgeEvent(this, edge)); } }
@Override public void markVertexHidden(Vertex vertex, Visibility visibility, Authorizations authorizations) { if (!((InMemoryVertex) vertex).canRead(authorizations)) { return; } List<Edge> edgesToMarkHidden = IterableUtils.toList(vertex.getEdges(Direction.BOTH, authorizations)); for (Edge edgeToMarkHidden : edgesToMarkHidden) { markEdgeHidden(edgeToMarkHidden, visibility, authorizations); } this.vertices.getTableElement(vertex.getId()).appendMarkHiddenMutation(visibility); refreshVertexInMemoryTableElement(vertex); getSearchIndex().markElementHidden(this, vertex, visibility, authorizations); if (hasEventListeners()) { fireGraphEvent(new MarkHiddenVertexEvent(this, vertex)); } }
@Override public void markVertexVisible(Vertex vertex, Visibility visibility, Authorizations authorizations) { if (!((InMemoryVertex) vertex).canRead(authorizations)) { return; } List<Edge> edgesToMarkVisible = IterableUtils.toList(vertex.getEdges(Direction.BOTH, FetchHints.ALL_INCLUDING_HIDDEN, authorizations)); for (Edge edgeToMarkVisible : edgesToMarkVisible) { markEdgeVisible(edgeToMarkVisible, visibility, authorizations); } this.vertices.getTableElement(vertex.getId()).appendMarkVisibleMutation(visibility); refreshVertexInMemoryTableElement(vertex); getSearchIndex().markElementVisible(this, vertex, visibility, authorizations); if (hasEventListeners()) { fireGraphEvent(new MarkVisibleVertexEvent(this, vertex)); } }
@Override public void appendAlterVisibilityMutation(Visibility newVisibility) { super.appendAlterVisibilityMutation(newVisibility); store(); }
public void markPropertyVisible(InMemoryElement element, InMemoryTableElement inMemoryTableElement, String key, String name, Visibility propertyVisibility, Long timestamp, Visibility visibility, Authorizations authorizations) { if (!element.canRead(authorizations)) { return; } Property property = inMemoryTableElement.appendMarkPropertyVisibleMutation(key, name, propertyVisibility, timestamp, visibility, authorizations); getSearchIndex().markPropertyVisible(this, element, property, visibility, authorizations); if (property != null && hasEventListeners()) { fireGraphEvent(new MarkVisiblePropertyEvent(this, element, property, visibility)); } }
public void markPropertyHidden( InMemoryElement element, InMemoryTableElement inMemoryTableElement, Property property, Long timestamp, Visibility visibility, Authorizations authorizations ) { if (!element.canRead(authorizations)) { return; } Property hiddenProperty = inMemoryTableElement.appendMarkPropertyHiddenMutation( property.getKey(), property.getName(), property.getVisibility(), timestamp, visibility, authorizations ); getSearchIndex().markPropertyHidden(this, element, property, visibility, authorizations); if (hiddenProperty != null && hasEventListeners()) { fireGraphEvent(new MarkHiddenPropertyEvent(this, element, hiddenProperty, visibility)); } }