public Iterable<KeyValuePair> getKeyValuePairsForVertex(AccumuloVertex vertex) { List<KeyValuePair> results = new ArrayList<>(); Text vertexRowKey = new Text(vertex.getId()); results.add(new KeyValuePair(new Key(vertexRowKey, AccumuloVertex.CF_SIGNAL, ElementMutationBuilder.EMPTY_TEXT, visibilityToAccumuloVisibility(vertex.getVisibility()), vertex.getTimestamp()), EMPTY_VALUE)); if (vertex.getPropertyDeleteMutations().iterator().hasNext()) { throw new VertexiumException("Cannot get key/value pairs for property deletions"); } for (PropertySoftDeleteMutation propertySoftDeleteMutation : vertex.getPropertySoftDeleteMutations()) { addPropertySoftDeleteToKeyValuePairs(results, vertexRowKey, propertySoftDeleteMutation); } for (Property property : vertex.getProperties()) { addPropertyToKeyValuePairs(results, vertexRowKey, 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; }
public Iterable<KeyValuePair> getKeyValuePairsForVertex(AccumuloVertex vertex) { List<KeyValuePair> results = new ArrayList<>(); Text vertexRowKey = new Text(vertex.getId()); results.add(new KeyValuePair(new Key(vertexRowKey, AccumuloVertex.CF_SIGNAL, ElementMutationBuilder.EMPTY_TEXT, visibilityToAccumuloVisibility(vertex.getVisibility()), vertex.getTimestamp()), EMPTY_VALUE)); if (vertex.getPropertyDeleteMutations().iterator().hasNext()) { throw new VertexiumException("Cannot get key/value pairs for property deletions"); } for (PropertySoftDeleteMutation propertySoftDeleteMutation : vertex.getPropertySoftDeleteMutations()) { addPropertySoftDeleteToKeyValuePairs(results, vertexRowKey, propertySoftDeleteMutation); } for (Property property : vertex.getProperties()) { addPropertyToKeyValuePairs(results, vertexRowKey, 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; }