use of org.vertexium.accumulo.iterator.model.EdgeInfo in project vertexium by visallo.
the class ElementMutationBuilder method alterEdgeVertexInVertex.
public boolean alterEdgeVertexInVertex(Mutation vertexInMutation, Edge edge, Visibility newVisibility) {
ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility);
if (currentColumnVisibility.equals(newColumnVisibility)) {
return false;
}
EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edge.getLabel()), edge.getVertexId(Direction.OUT));
vertexInMutation.putDelete(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), currentColumnVisibility);
vertexInMutation.put(AccumuloVertex.CF_IN_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue());
return true;
}
use of org.vertexium.accumulo.iterator.model.EdgeInfo in project vertexium by visallo.
the class ElementMutationBuilder method getVertexTableKeyValuePairsEdge.
public Iterable<KeyValuePair> getVertexTableKeyValuePairsEdge(AccumuloEdge edge) {
List<KeyValuePair> results = new ArrayList<>();
ColumnVisibility edgeColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
String edgeLabel = edge.getNewEdgeLabel() != null ? edge.getNewEdgeLabel() : edge.getLabel();
Text edgeIdText = new Text(edge.getId());
long timestamp = edge.getTimestamp();
// out vertex.
Text vertexOutIdRowKey = new Text(edge.getVertexId(Direction.OUT));
org.vertexium.accumulo.iterator.model.EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edgeLabel), edge.getVertexId(Direction.IN));
results.add(new KeyValuePair(new Key(vertexOutIdRowKey, AccumuloVertex.CF_OUT_EDGE, edgeIdText, edgeColumnVisibility, timestamp), edgeInfo.toValue()));
// in vertex.
Text vertexInIdRowKey = new Text(edge.getVertexId(Direction.IN));
edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edgeLabel), edge.getVertexId(Direction.OUT));
results.add(new KeyValuePair(new Key(vertexInIdRowKey, AccumuloVertex.CF_IN_EDGE, edgeIdText, edgeColumnVisibility, timestamp), edgeInfo.toValue()));
return results;
}
use of org.vertexium.accumulo.iterator.model.EdgeInfo in project vertexium by visallo.
the class ElementMutationBuilder method alterEdgeVertexOutVertex.
public boolean alterEdgeVertexOutVertex(Mutation vertexOutMutation, Edge edge, Visibility newVisibility) {
ColumnVisibility currentColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility());
ColumnVisibility newColumnVisibility = visibilityToAccumuloVisibility(newVisibility);
if (currentColumnVisibility.equals(newColumnVisibility)) {
return false;
}
EdgeInfo edgeInfo = new EdgeInfo(getNameSubstitutionStrategy().deflate(edge.getLabel()), edge.getVertexId(Direction.IN));
vertexOutMutation.putDelete(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), currentColumnVisibility);
vertexOutMutation.put(AccumuloVertex.CF_OUT_EDGE, new Text(edge.getId()), newColumnVisibility, edgeInfo.toValue());
return true;
}
Aggregations