use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.
the class AccumuloGraph method getExtendedData.
@Override
public Iterable<ExtendedDataRow> getExtendedData(Iterable<ExtendedDataRowId> ids, Authorizations authorizations) {
List<org.apache.accumulo.core.data.Range> ranges = extendedDataRowIdToRange(ids);
Span trace = Trace.start("getExtendedData");
return getExtendedDataRowsInRange(trace, ranges, FetchHints.ALL, authorizations);
}
use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.
the class AccumuloGraph method softDeleteVertex.
@Override
public void softDeleteVertex(Vertex vertex, Long timestamp, Authorizations authorizations) {
checkNotNull(vertex, "vertex cannot be null");
Span trace = Trace.start("softDeleteVertex");
trace.data("vertexId", vertex.getId());
try {
if (timestamp == null) {
timestamp = IncreasingTime.currentTimeMillis();
}
getSearchIndex().deleteElement(this, vertex, authorizations);
// Delete all edges that this vertex participates.
for (Edge edge : vertex.getEdges(Direction.BOTH, authorizations)) {
softDeleteEdge(edge, timestamp, authorizations);
}
addMutations(VertexiumObjectType.VERTEX, getSoftDeleteRowMutation(vertex.getId(), timestamp));
if (hasEventListeners()) {
queueEvent(new SoftDeleteVertexEvent(this, vertex));
}
} finally {
trace.stop();
}
}
use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.
the class AccumuloGraph method deleteEdge.
@Override
public void deleteEdge(Edge edge, Authorizations authorizations) {
checkNotNull(edge);
Span trace = Trace.start("deleteEdge");
trace.data("edgeId", edge.getId());
try {
getSearchIndex().deleteElement(this, edge, authorizations);
ColumnVisibility visibility = visibilityToAccumuloVisibility(edge.getVisibility());
Mutation outMutation = new Mutation(edge.getVertexId(Direction.OUT));
outMutation.putDelete(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), visibility);
Mutation inMutation = new Mutation(edge.getVertexId(Direction.IN));
inMutation.putDelete(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), visibility);
addMutations(VertexiumObjectType.VERTEX, outMutation, inMutation);
deleteAllExtendedDataForElement(edge, authorizations);
// Deletes everything else related to edge.
addMutations(VertexiumObjectType.EDGE, getDeleteRowMutation(edge.getId()));
if (hasEventListeners()) {
queueEvent(new DeleteEdgeEvent(this, edge));
}
} finally {
trace.stop();
}
}
use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.
the class AccumuloGraph method markPropertyHidden.
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();
}
}
use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.
the class AccumuloGraph method markVertexHidden.
@Override
public void markVertexHidden(Vertex vertex, Visibility visibility, Authorizations authorizations) {
checkNotNull(vertex, "vertex cannot be null");
Span trace = Trace.start("softDeleteVertex");
trace.data("vertexId", vertex.getId());
try {
ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(visibility);
// Delete all edges that this vertex participates.
for (Edge edge : vertex.getEdges(Direction.BOTH, authorizations)) {
markEdgeHidden(edge, visibility, authorizations);
}
addMutations(VertexiumObjectType.VERTEX, getMarkHiddenRowMutation(vertex.getId(), columnVisibility));
getSearchIndex().markElementHidden(this, vertex, visibility, authorizations);
if (hasEventListeners()) {
queueEvent(new MarkHiddenVertexEvent(this, vertex));
}
} finally {
trace.stop();
}
}
Aggregations