public Iterable<KeyValuePair> getEdgeTableKeyValuePairsEdge(AccumuloEdge edge) { List<KeyValuePair> results = new ArrayList<>(); ColumnVisibility edgeColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility()); Text edgeRowKey = new Text(edge.getId()); String edgeLabel = edge.getLabel(); if (edge.getNewEdgeLabel() != null) { throw new VertexiumException("Cannot get key/value pairs for label changes"); } results.add(new KeyValuePair(new Key(edgeRowKey, AccumuloEdge.CF_SIGNAL, new Text(edgeLabel), edgeColumnVisibility, edge.getTimestamp()), ElementMutationBuilder.EMPTY_VALUE)); results.add(new KeyValuePair(new Key(edgeRowKey, AccumuloEdge.CF_OUT_VERTEX, new Text(edge.getVertexId(Direction.OUT)), edgeColumnVisibility, edge.getTimestamp()), ElementMutationBuilder.EMPTY_VALUE)); results.add(new KeyValuePair(new Key(edgeRowKey, AccumuloEdge.CF_IN_VERTEX, new Text(edge.getVertexId(Direction.IN)), edgeColumnVisibility, edge.getTimestamp()), ElementMutationBuilder.EMPTY_VALUE)); if (edge.getPropertyDeleteMutations().iterator().hasNext()) { throw new VertexiumException("Cannot get key/value pairs for property deletions"); } for (PropertySoftDeleteMutation propertySoftDeleteMutation : edge.getPropertySoftDeleteMutations()) { addPropertySoftDeleteToKeyValuePairs(results, edgeRowKey, propertySoftDeleteMutation); } for (Property property : edge.getProperties()) { addPropertyToKeyValuePairs(results, edgeRowKey, property); } return results; }
public Iterable<KeyValuePair> getEdgeTableKeyValuePairsEdge(AccumuloEdge edge) { List<KeyValuePair> results = new ArrayList<>(); ColumnVisibility edgeColumnVisibility = visibilityToAccumuloVisibility(edge.getVisibility()); Text edgeRowKey = new Text(edge.getId()); String edgeLabel = edge.getLabel(); if (edge.getNewEdgeLabel() != null) { throw new VertexiumException("Cannot get key/value pairs for label changes"); } results.add(new KeyValuePair(new Key(edgeRowKey, AccumuloEdge.CF_SIGNAL, new Text(edgeLabel), edgeColumnVisibility, edge.getTimestamp()), ElementMutationBuilder.EMPTY_VALUE)); results.add(new KeyValuePair(new Key(edgeRowKey, AccumuloEdge.CF_OUT_VERTEX, new Text(edge.getVertexId(Direction.OUT)), edgeColumnVisibility, edge.getTimestamp()), ElementMutationBuilder.EMPTY_VALUE)); results.add(new KeyValuePair(new Key(edgeRowKey, AccumuloEdge.CF_IN_VERTEX, new Text(edge.getVertexId(Direction.IN)), edgeColumnVisibility, edge.getTimestamp()), ElementMutationBuilder.EMPTY_VALUE)); if (edge.getPropertyDeleteMutations().iterator().hasNext()) { throw new VertexiumException("Cannot get key/value pairs for property deletions"); } for (PropertySoftDeleteMutation propertySoftDeleteMutation : edge.getPropertySoftDeleteMutations()) { addPropertySoftDeleteToKeyValuePairs(results, edgeRowKey, propertySoftDeleteMutation); } for (Property property : edge.getProperties()) { addPropertyToKeyValuePairs(results, edgeRowKey, property); } return results; }