private Mutation createMutationForVertex(AccumuloVertex vertex) { String vertexRowKey = vertex.getId(); Mutation m = new Mutation(vertexRowKey); m.put( AccumuloVertex.CF_SIGNAL, EMPTY_TEXT, visibilityToAccumuloVisibility(vertex.getVisibility()), vertex.getTimestamp(), EMPTY_VALUE); for (PropertyDeleteMutation propertyDeleteMutation : vertex.getPropertyDeleteMutations()) { addPropertyDeleteToMutation(m, propertyDeleteMutation); } for (PropertySoftDeleteMutation propertySoftDeleteMutation : vertex.getPropertySoftDeleteMutations()) { addPropertySoftDeleteToMutation(m, propertySoftDeleteMutation); } for (Property property : vertex.getProperties()) { addPropertyToMutation(vertex.getGraph(), m, vertexRowKey, property); } return m; }
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; }