public void addPropertyToMutation( AccumuloGraph graph, Mutation m, String rowKey, Property property) { Text columnQualifier = KeyHelper.getColumnQualifierFromPropertyColumnQualifier( property, getNameSubstitutionStrategy()); ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(property.getVisibility()); Object propertyValue = property.getValue(); if (propertyValue instanceof StreamingPropertyValue) { propertyValue = saveStreamingPropertyValue(rowKey, property, (StreamingPropertyValue) propertyValue); } if (propertyValue instanceof DateOnly) { propertyValue = ((DateOnly) propertyValue).getDate(); } // graph can be null if this is running in Map Reduce. We can just assume the property is // already defined. if (graph != null) { graph.ensurePropertyDefined(property.getName(), propertyValue); } Value value = new Value(vertexiumSerializer.objectToBytes(propertyValue)); m.put( AccumuloElement.CF_PROPERTY, columnQualifier, columnVisibility, property.getTimestamp(), value); addPropertyMetadataToMutation(m, property); }
private void addPropertyToKeyValuePairs( List<KeyValuePair> results, Text elementRowKey, Property property) { Text columnQualifier = KeyHelper.getColumnQualifierFromPropertyColumnQualifier( property, getNameSubstitutionStrategy()); ColumnVisibility columnVisibility = visibilityToAccumuloVisibility(property.getVisibility()); Object propertyValue = property.getValue(); if (propertyValue instanceof StreamingPropertyValue) { throw new VertexiumException("StreamingPropertyValue are not supported"); } if (propertyValue instanceof DateOnly) { propertyValue = ((DateOnly) propertyValue).getDate(); } Value value = new Value(vertexiumSerializer.objectToBytes(propertyValue)); results.add( new KeyValuePair( new Key( elementRowKey, AccumuloElement.CF_PROPERTY, columnQualifier, columnVisibility, property.getTimestamp()), value)); addPropertyMetadataToKeyValuePairs(results, elementRowKey, property); }
private void addPropertyMetadataItemAddToMutation( Mutation m, Text columnQualifier, ColumnVisibility metadataVisibility, long propertyTimestamp, Object value) { Value metadataValue = new Value(vertexiumSerializer.objectToBytes(value)); m.put( AccumuloElement.CF_PROPERTY_METADATA, columnQualifier, metadataVisibility, propertyTimestamp, metadataValue); }
private void addPropertyMetadataItemAddToKeyValuePairs( List<KeyValuePair> results, Text vertexRowKey, Text columnQualifier, ColumnVisibility metadataVisibility, long propertyTimestamp, Object value) { Value metadataValue = new Value(vertexiumSerializer.objectToBytes(value)); results.add( new KeyValuePair( new Key( vertexRowKey, AccumuloElement.CF_PROPERTY_METADATA, columnQualifier, metadataVisibility, propertyTimestamp), metadataValue)); }