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(); } }