@Override public int hashCode() { return getId().hashCode(); }
@Override public int hashCode() { return getId().hashCode(); }
@Override public boolean equals(Object obj) { if (obj instanceof Element) { Element objElem = (Element) obj; return getId().equals(objElem.getId()); } return super.equals(obj); }
@Override public boolean equals(Object obj) { if (obj instanceof Element) { Element objElem = (Element) obj; return getId().equals(objElem.getId()); } return super.equals(obj); }
@Override public QueryableIterable<ExtendedDataRow> getExtendedData(String tableName) { return new ExtendedDataQueryableIterable( getGraph(), this, tableName, getGraph().getExtendedData(ElementType.getTypeFromElement(this), getId(), tableName, getAuthorizations()) ); }
@Override public QueryableIterable<ExtendedDataRow> getExtendedData(String tableName) { return new ExtendedDataQueryableIterable( getGraph(), this, tableName, getGraph().getExtendedData(ElementType.getTypeFromElement(this), getId(), tableName, getAuthorizations()) ); }
@SuppressWarnings("unused") public void markPropertyVisible(AccumuloElement element, Property property, Long timestamp, Visibility visibility, Authorizations authorizations) { checkNotNull(element); Span trace = Trace.start("markPropertyVisible"); trace.data("elementId", element.getId()); trace.data("propertyName", property.getName()); trace.data("propertyKey", property.getKey()); try { if (timestamp == null) { timestamp = IncreasingTime.currentTimeMillis(); } ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(visibility); if (element instanceof Vertex) { addMutations(VertexiumObjectType.VERTEX, getMarkVisiblePropertyMutation(element.getId(), property, timestamp, columnVisibility)); } else if (element instanceof Edge) { addMutations(VertexiumObjectType.EDGE, getMarkVisiblePropertyMutation(element.getId(), property, timestamp, columnVisibility)); } getSearchIndex().markPropertyVisible(this, element, property, visibility, authorizations); if (hasEventListeners()) { fireGraphEvent(new MarkVisiblePropertyEvent(this, element, property, visibility)); } } finally { trace.stop(); } }
@SuppressWarnings("unused") public void markPropertyVisible(AccumuloElement element, Property property, Long timestamp, Visibility visibility, Authorizations authorizations) { checkNotNull(element); Span trace = Trace.start("markPropertyVisible"); trace.data("elementId", element.getId()); trace.data("propertyName", property.getName()); trace.data("propertyKey", property.getKey()); try { if (timestamp == null) { timestamp = IncreasingTime.currentTimeMillis(); } ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(visibility); if (element instanceof Vertex) { addMutations(VertexiumObjectType.VERTEX, getMarkVisiblePropertyMutation(element.getId(), property, timestamp, columnVisibility)); } else if (element instanceof Edge) { addMutations(VertexiumObjectType.EDGE, getMarkVisiblePropertyMutation(element.getId(), property, timestamp, columnVisibility)); } getSearchIndex().markPropertyVisible(this, element, property, visibility, authorizations); if (hasEventListeners()) { fireGraphEvent(new MarkVisiblePropertyEvent(this, element, property, visibility)); } } finally { trace.stop(); } }
void softDeleteProperty(AccumuloElement element, Property property, Authorizations authorizations) { Mutation m = new Mutation(element.getId()); elementMutationBuilder.addPropertySoftDeleteToMutation(m, property); addMutations(element, m); getSearchIndex().deleteProperty( this, element, PropertyDescriptor.fromProperty(property), authorizations ); if (hasEventListeners()) { queueEvent(new SoftDeletePropertyEvent(this, element, property)); } }
public void markPropertyHidden( AccumuloElement element, Property property, Long timestamp, Visibility visibility, @SuppressWarnings("UnusedParameters") Authorizations authorizations ) { checkNotNull(element); Span trace = Trace.start("markPropertyHidden"); trace.data("elementId", element.getId()); trace.data("propertyName", property.getName()); trace.data("propertyKey", property.getKey()); try { if (timestamp == null) { timestamp = IncreasingTime.currentTimeMillis(); } ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(visibility); if (element instanceof Vertex) { addMutations(VertexiumObjectType.VERTEX, getMarkHiddenPropertyMutation(element.getId(), property, timestamp, columnVisibility)); } else if (element instanceof Edge) { addMutations(VertexiumObjectType.EDGE, getMarkHiddenPropertyMutation(element.getId(), property, timestamp, columnVisibility)); } getSearchIndex().markPropertyHidden(this, element, property, visibility, authorizations); if (hasEventListeners()) { fireGraphEvent(new MarkHiddenPropertyEvent(this, element, property, visibility)); } } finally { trace.stop(); } }
public void markPropertyHidden( AccumuloElement element, Property property, Long timestamp, Visibility visibility, @SuppressWarnings("UnusedParameters") Authorizations authorizations ) { checkNotNull(element); Span trace = Trace.start("markPropertyHidden"); trace.data("elementId", element.getId()); trace.data("propertyName", property.getName()); trace.data("propertyKey", property.getKey()); try { if (timestamp == null) { timestamp = IncreasingTime.currentTimeMillis(); } ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(visibility); if (element instanceof Vertex) { addMutations(VertexiumObjectType.VERTEX, getMarkHiddenPropertyMutation(element.getId(), property, timestamp, columnVisibility)); } else if (element instanceof Edge) { addMutations(VertexiumObjectType.EDGE, getMarkHiddenPropertyMutation(element.getId(), property, timestamp, columnVisibility)); } getSearchIndex().markPropertyHidden(this, element, property, visibility, authorizations); if (hasEventListeners()) { fireGraphEvent(new MarkHiddenPropertyEvent(this, element, property, visibility)); } } finally { trace.stop(); } }
void softDeleteProperty(AccumuloElement element, Property property, Authorizations authorizations) { Mutation m = new Mutation(element.getId()); elementMutationBuilder.addPropertySoftDeleteToMutation(m, property); addMutations(element, m); getSearchIndex().deleteProperty( this, element, PropertyDescriptor.fromProperty(property), authorizations ); if (hasEventListeners()) { queueEvent(new SoftDeletePropertyEvent(this, element, property)); } }
void alterPropertyMetadatas(AccumuloElement element, List<SetPropertyMetadata> setPropertyMetadatas) { if (setPropertyMetadatas.size() == 0) { return; } String elementRowKey = element.getId(); Mutation m = new Mutation(elementRowKey); for (SetPropertyMetadata apm : setPropertyMetadatas) { Property property = element.getProperty(apm.getPropertyKey(), apm.getPropertyName(), apm.getPropertyVisibility()); if (property == null) { throw new VertexiumException(String.format("Could not find property %s:%s(%s)", apm.getPropertyKey(), apm.getPropertyName(), apm.getPropertyVisibility())); } if (property.getFetchHints().isIncludePropertyAndMetadata(property.getName())) { property.getMetadata().add(apm.getMetadataName(), apm.getNewValue(), apm.getMetadataVisibility()); } elementMutationBuilder.addPropertyMetadataItemToMutation( m, property, apm.getMetadataName(), apm.getNewValue(), apm.getMetadataVisibility() ); } addMutations(element, m); }
void alterPropertyMetadatas(AccumuloElement element, List<SetPropertyMetadata> setPropertyMetadatas) { if (setPropertyMetadatas.size() == 0) { return; } String elementRowKey = element.getId(); Mutation m = new Mutation(elementRowKey); for (SetPropertyMetadata apm : setPropertyMetadatas) { Property property = element.getProperty(apm.getPropertyKey(), apm.getPropertyName(), apm.getPropertyVisibility()); if (property == null) { throw new VertexiumException(String.format("Could not find property %s:%s(%s)", apm.getPropertyKey(), apm.getPropertyName(), apm.getPropertyVisibility())); } if (property.getFetchHints().isIncludePropertyAndMetadata(property.getName())) { property.getMetadata().add(apm.getMetadataName(), apm.getNewValue(), apm.getMetadataVisibility()); } elementMutationBuilder.addPropertyMetadataItemToMutation( m, property, apm.getMetadataName(), apm.getNewValue(), apm.getMetadataVisibility() ); } addMutations(element, m); }
void deleteProperty(AccumuloElement element, Property property, Authorizations authorizations) { if (!element.getFetchHints().isIncludePropertyAndMetadata(property.getName())) { throw new VertexiumMissingFetchHintException(element.getFetchHints(), "Property " + property.getName() + " needs to be included with metadata"); } Mutation m = new Mutation(element.getId()); elementMutationBuilder.addPropertyDeleteToMutation(m, property); addMutations(element, m); getSearchIndex().deleteProperty( this, element, PropertyDescriptor.fromProperty(property), authorizations ); if (hasEventListeners()) { queueEvent(new DeletePropertyEvent(this, element, property)); } }
void deleteProperty(AccumuloElement element, Property property, Authorizations authorizations) { if (!element.getFetchHints().isIncludePropertyAndMetadata(property.getName())) { throw new VertexiumMissingFetchHintException(element.getFetchHints(), "Property " + property.getName() + " needs to be included with metadata"); } Mutation m = new Mutation(element.getId()); elementMutationBuilder.addPropertyDeleteToMutation(m, property); addMutations(element, m); getSearchIndex().deleteProperty( this, element, PropertyDescriptor.fromProperty(property), authorizations ); if (hasEventListeners()) { queueEvent(new DeletePropertyEvent(this, element, property)); } }
void alterElementVisibility(AccumuloElement element, Visibility newVisibility) { String elementRowKey = element.getId(); Span trace = Trace.start("alterElementVisibility"); trace.data("elementRowKey", elementRowKey); try { if (element instanceof Edge) { Edge edge = (Edge) element; String vertexOutRowKey = edge.getVertexId(Direction.OUT); Mutation vertexOutMutation = new Mutation(vertexOutRowKey); if (elementMutationBuilder.alterEdgeVertexOutVertex(vertexOutMutation, edge, newVisibility)) { addMutations(VertexiumObjectType.VERTEX, vertexOutMutation); } String vertexInRowKey = edge.getVertexId(Direction.IN); Mutation vertexInMutation = new Mutation(vertexInRowKey); if (elementMutationBuilder.alterEdgeVertexInVertex(vertexInMutation, edge, newVisibility)) { addMutations(VertexiumObjectType.VERTEX, vertexInMutation); } } Mutation m = new Mutation(elementRowKey); if (elementMutationBuilder.alterElementVisibility(m, element, newVisibility)) { addMutations(element, m); } element.setVisibility(newVisibility); } finally { trace.stop(); } }
void alterElementVisibility(AccumuloElement element, Visibility newVisibility) { String elementRowKey = element.getId(); Span trace = Trace.start("alterElementVisibility"); trace.data("elementRowKey", elementRowKey); try { if (element instanceof Edge) { Edge edge = (Edge) element; String vertexOutRowKey = edge.getVertexId(Direction.OUT); Mutation vertexOutMutation = new Mutation(vertexOutRowKey); if (elementMutationBuilder.alterEdgeVertexOutVertex(vertexOutMutation, edge, newVisibility)) { addMutations(VertexiumObjectType.VERTEX, vertexOutMutation); } String vertexInRowKey = edge.getVertexId(Direction.IN); Mutation vertexInMutation = new Mutation(vertexInRowKey); if (elementMutationBuilder.alterEdgeVertexInVertex(vertexInMutation, edge, newVisibility)) { addMutations(VertexiumObjectType.VERTEX, vertexInMutation); } } Mutation m = new Mutation(elementRowKey); if (elementMutationBuilder.alterElementVisibility(m, element, newVisibility)) { addMutations(element, m); } element.setVisibility(newVisibility); } finally { trace.stop(); } }