Search in sources :

Example 16 with Span

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);
}
Also used : Span(org.apache.accumulo.core.trace.Span)

Example 17 with Span

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();
    }
}
Also used : Span(org.apache.accumulo.core.trace.Span)

Example 18 with Span

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();
    }
}
Also used : Text(org.apache.hadoop.io.Text) ColumnVisibility(org.apache.accumulo.core.security.ColumnVisibility) Mutation(org.apache.accumulo.core.data.Mutation) Span(org.apache.accumulo.core.trace.Span)

Example 19 with Span

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();
    }
}
Also used : ColumnVisibility(org.apache.accumulo.core.security.ColumnVisibility) Span(org.apache.accumulo.core.trace.Span)

Example 20 with Span

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();
    }
}
Also used : ColumnVisibility(org.apache.accumulo.core.security.ColumnVisibility) Span(org.apache.accumulo.core.trace.Span)

Aggregations

Span (org.apache.accumulo.core.trace.Span)56 Key (org.apache.accumulo.core.data.Key)12 Value (org.apache.accumulo.core.data.Value)12 IOException (java.io.IOException)11 ColumnVisibility (org.apache.accumulo.core.security.ColumnVisibility)10 Text (org.apache.hadoop.io.Text)9 StreamingPropertyValue (org.vertexium.property.StreamingPropertyValue)8 AccumuloException (org.apache.accumulo.core.client.AccumuloException)7 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)7 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)6 PartialKey (org.apache.accumulo.core.data.PartialKey)6 Mutation (org.apache.accumulo.core.data.Mutation)5 IndexHint (org.vertexium.search.IndexHint)5 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)4 Connector (org.apache.accumulo.core.client.Connector)4 Scanner (org.apache.accumulo.core.client.Scanner)4 ReplicationTableOfflineException (org.apache.accumulo.core.replication.ReplicationTableOfflineException)4 Status (org.apache.accumulo.server.replication.proto.Replication.Status)4 Test (org.junit.Test)4 FileNotFoundException (java.io.FileNotFoundException)3