Search in sources :

Example 51 with Span

use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.

the class AccumuloGraph method getExtendedDataInRange.

public Iterable<ExtendedDataRow> getExtendedDataInRange(Range extendedDataRowKeyRange, Authorizations authorizations) {
    Span trace = Trace.start("getExtendedDataInRange");
    trace.data("rangeInclusiveStart", extendedDataRowKeyRange.getInclusiveStart());
    trace.data("rangeExclusiveStart", extendedDataRowKeyRange.getExclusiveEnd());
    org.apache.accumulo.core.data.Range range = vertexiumRangeToAccumuloRange(extendedDataRowKeyRange);
    return getExtendedDataRowsInRange(trace, Collections.singletonList(range), FetchHints.ALL, authorizations);
}
Also used : Span(org.apache.accumulo.core.trace.Span)

Example 52 with Span

use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.

the class AccumuloGraph method getVerticesInRange.

@Override
public Iterable<Vertex> getVerticesInRange(Range idRange, FetchHints fetchHints, Long endTime, Authorizations authorizations) {
    Span trace = Trace.start("getVerticesInRange");
    trace.data("rangeInclusiveStart", idRange.getInclusiveStart());
    trace.data("rangeExclusiveStart", idRange.getExclusiveEnd());
    traceDataFetchHints(trace, fetchHints);
    org.apache.accumulo.core.data.Range range = vertexiumRangeToAccumuloRange(idRange);
    return getVerticesInRange(trace, range, fetchHints, endTime, authorizations);
}
Also used : Span(org.apache.accumulo.core.trace.Span)

Example 53 with Span

use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.

the class AccumuloGraph method getVerticesWithPrefix.

@Override
public Iterable<Vertex> getVerticesWithPrefix(String vertexIdPrefix, FetchHints fetchHints, Long endTime, Authorizations authorizations) {
    Span trace = Trace.start("getVerticesWithPrefix");
    trace.data("vertexIdPrefix", vertexIdPrefix);
    traceDataFetchHints(trace, fetchHints);
    org.apache.accumulo.core.data.Range range = org.apache.accumulo.core.data.Range.prefix(vertexIdPrefix);
    return getVerticesInRange(trace, range, fetchHints, endTime, authorizations);
}
Also used : Span(org.apache.accumulo.core.trace.Span)

Example 54 with Span

use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.

the class AccumuloGraph method deleteVertex.

@Override
public void deleteVertex(Vertex vertex, Authorizations authorizations) {
    checkNotNull(vertex, "vertex cannot be null");
    Span trace = Trace.start("deleteVertex");
    trace.data("vertexId", vertex.getId());
    try {
        getSearchIndex().deleteElement(this, vertex, authorizations);
        // Delete all edges that this vertex participates.
        for (Edge edge : vertex.getEdges(Direction.BOTH, authorizations)) {
            deleteEdge(edge, authorizations);
        }
        deleteAllExtendedDataForElement(vertex, authorizations);
        addMutations(VertexiumObjectType.VERTEX, getDeleteRowMutation(vertex.getId()));
        if (hasEventListeners()) {
            queueEvent(new DeleteVertexEvent(this, vertex));
        }
    } finally {
        trace.stop();
    }
}
Also used : Span(org.apache.accumulo.core.trace.Span)

Example 55 with Span

use of org.apache.accumulo.core.trace.Span in project vertexium by visallo.

the class AccumuloGraph method getEdge.

@Override
public Edge getEdge(String edgeId, FetchHints fetchHints, Long endTime, Authorizations authorizations) {
    Span trace = Trace.start("getEdge");
    trace.data("edgeId", edgeId);
    try {
        return singleOrDefault(getEdgesInRange(trace, edgeId, edgeId, fetchHints, endTime, authorizations), null);
    } catch (IllegalStateException ex) {
        throw new VertexiumException("Failed to find edge with id: " + edgeId, ex);
    } catch (RuntimeException ex) {
        if (ex.getCause() instanceof AccumuloSecurityException) {
            throw new SecurityVertexiumException("Could not get edge " + edgeId + " with authorizations: " + authorizations, authorizations, ex.getCause());
        }
        throw ex;
    }
}
Also used : 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