@Override public void addElement(SearchIndex searchIndex, Graph graph, Element element, Authorizations authorizations) { if (!getConfig().isUpdateEdgeBoost()) { return; } if (!(element instanceof Edge)) { return; } Element vOut = ((Edge) element).getVertex(Direction.OUT, authorizations); if (vOut != null) { searchIndex.addElement(graph, vOut, authorizations); } Element vIn = ((Edge) element).getVertex(Direction.IN, authorizations); if (vIn != null) { searchIndex.addElement(graph, vIn, authorizations); } }
protected void reindexVertices(Authorizations authorizations) { this.searchIndex.addElements(this, new ToElementIterable<Vertex>(getVertices(authorizations)), authorizations); }
@Override public void clearData() { this.vertices.clear(); this.edges.clear(); getSearchIndex().clearData(); }
getSearchIndex().removeProperty( this, element, ); getSearchIndex().addElement(this, element, authorizations);
@Override public void removeEdge(Edge edge, Authorizations authorizations) { if (!((InMemoryEdge) edge).canRead(authorizations)) { return; } this.edges.remove(edge.getId()); getSearchIndex().removeElement(this, edge, authorizations); if (hasEventListeners()) { fireGraphEvent(new RemoveEdgeEvent(this, edge)); } }
public void removeProperty(Element element, Property property, Authorizations authorizations) { if (element instanceof Vertex) { InMemoryVertex vertex = vertices.get(element.getId()); vertex.removePropertyInternal(property.getKey(), property.getName()); } else if (element instanceof Edge) { InMemoryEdge edge = edges.get(element.getId()); edge.removePropertyInternal(property.getKey(), property.getName()); } else { throw new IllegalArgumentException("Unexpected element type: " + element.getClass().getName()); } getSearchIndex().removeProperty(this, element, property, authorizations); if (hasEventListeners()) { fireGraphEvent(new RemovePropertyEvent(this, element, property)); } }
@Override public VertexQuery query(String queryString, Authorizations authorizations) { return getGraph().getSearchIndex().queryVertex(getGraph(), this, queryString, authorizations); }
protected void setupPropertyDefinition(PropertyDefinition propertyDefinition) { try { getSearchIndex().addPropertyDefinition(propertyDefinition); } catch (IOException e) { throw new SecureGraphException("Could not add property definition to search index", e); } }
@Override public SearchIndexSecurityGranularity getSearchIndexSecurityGranularity() { return getSearchIndex().getSearchIndexSecurityGranularity(); } }
@Override public void flush() { if (getSearchIndex() != null) { this.searchIndex.flush(); } }
getSearchIndex().removeProperty( this, element, ); getSearchIndex().addElement(this, element, authorizations);
@Override public void removeVertex(Vertex vertex, Authorizations authorizations) { if (!((InMemoryVertex) vertex).canRead(authorizations)) { return; } List<Edge> edgesToRemove = toList(vertex.getEdges(Direction.BOTH, authorizations)); for (Edge edgeToRemove : edgesToRemove) { removeEdge(edgeToRemove, authorizations); } this.vertices.remove(vertex.getId()); getSearchIndex().removeElement(this, vertex, authorizations); if (hasEventListeners()) { fireGraphEvent(new RemoveVertexEvent(this, vertex)); } }
void removeProperty(AccumuloElement element, Property property, Authorizations authorizations) { String rowPrefix = getRowPrefixForElement(element); Mutation m = new Mutation(rowPrefix + element.getId()); elementMutationBuilder.addPropertyRemoveToMutation(m, property); addMutations(getWriterFromElementType(element), m); getSearchIndex().removeProperty(this, element, property, authorizations); if (hasEventListeners()) { queueEvent(new RemovePropertyEvent(this, element, property)); } }
@Override public VertexQuery query(String queryString, Authorizations authorizations) { return getGraph().getSearchIndex().queryVertex(getGraph(), this, queryString, authorizations); }
protected void setupPropertyDefinition(PropertyDefinition propertyDefinition) { try { getSearchIndex().addPropertyDefinition(propertyDefinition); } catch (IOException e) { throw new SecureGraphException("Could not add property definition to search index", e); } }
@Override public SearchIndexSecurityGranularity getSearchIndexSecurityGranularity() { return getSearchIndex().getSearchIndexSecurityGranularity(); } }
@Override public void flush() { if (getSearchIndex() != null) { this.searchIndex.flush(); } }
@Override public void addElement(SearchIndex searchIndex, Graph graph, Element element, Authorizations authorizations) { if (!getConfig().isUpdateEdgeBoost()) { return; } if (!(element instanceof Edge)) { return; } Element vOut = ((Edge) element).getVertex(Direction.OUT, authorizations); if (vOut != null) { searchIndex.addElement(graph, vOut, authorizations); } Element vIn = ((Edge) element).getVertex(Direction.IN, authorizations); if (vIn != null) { searchIndex.addElement(graph, vIn, authorizations); } }
private void reindexEdges(Authorizations authorizations) { this.searchIndex.addElements(this, new ToElementIterable<Edge>(getEdges(authorizations)), authorizations); }
@Override public void removeVertex(Vertex vertex, Authorizations authorizations) { if (vertex == null) { throw new IllegalArgumentException("vertex cannot be null"); } getSearchIndex().removeElement(this, vertex, authorizations); // Remove all edges that this vertex participates. for (Edge edge : vertex.getEdges(Direction.BOTH, authorizations)) { removeEdge(edge, authorizations); } addMutations(getVerticesWriter(), getDeleteRowMutation(AccumuloConstants.VERTEX_ROW_KEY_PREFIX + vertex.getId())); if (hasEventListeners()) { queueEvent(new RemoveVertexEvent(this, vertex)); } }