StreamingPropertyValueTable(AccumuloGraph graph, String dataRowKey, StreamingPropertyValueTableRef valueRef, long timestamp) { super(valueRef.getValueType()); this.timestamp = timestamp; this.searchIndex(valueRef.isSearchIndex()); this.graph = graph; this.dataRowKey = dataRowKey; this.data = valueRef.getData(); }
@Override public StreamingPropertyValue toStreamingPropertyValue(AccumuloGraph graph, long timestamp) { return new StreamingPropertyValueTable(graph, getDataRowKey(), this, timestamp); } }
private StreamingPropertyValueRef saveStreamingPropertyValueSmall( ElementMutationBuilder elementMutationBuilder, String rowKey, Property property, byte[] data, StreamingPropertyValue propertyValue ) { String dataTableRowKey = new DataTableRowKey(rowKey, property).getRowKey(); Mutation dataMutation = new Mutation(dataTableRowKey); dataMutation.put(EMPTY_TEXT, EMPTY_TEXT, property.getTimestamp(), new Value(data)); elementMutationBuilder.saveDataMutation(dataMutation); return new StreamingPropertyValueTableRef(dataTableRowKey, propertyValue, data); }
@Override protected Class<?> getValueType(Object value) { if (value instanceof StreamingPropertyValueTableRef) { return ((StreamingPropertyValueTableRef) value).getValueType(); } return super.getValueType(value); }
private StreamingPropertyValueRef saveStreamingPropertyValueSmall( ElementMutationBuilder elementMutationBuilder, String rowKey, Property property, byte[] data, StreamingPropertyValue propertyValue ) { String dataTableRowKey = new DataTableRowKey(rowKey, property).getRowKey(); Mutation dataMutation = new Mutation(dataTableRowKey); dataMutation.put(EMPTY_TEXT, EMPTY_TEXT, property.getTimestamp(), new Value(data)); elementMutationBuilder.saveDataMutation(dataMutation); return new StreamingPropertyValueTableRef(dataTableRowKey, propertyValue, data); }
@Override protected Class<?> getValueType(Object value) { if (value instanceof StreamingPropertyValueTableRef) { return ((StreamingPropertyValueTableRef) value).getValueType(); } return super.getValueType(value); }
StreamingPropertyValueTable(AccumuloGraph graph, String dataRowKey, StreamingPropertyValueTableRef valueRef, long timestamp) { super(valueRef.getValueType()); this.timestamp = timestamp; this.searchIndex(valueRef.isSearchIndex()); this.graph = graph; this.dataRowKey = dataRowKey; this.data = valueRef.getData(); }
private void addLegacySPVData( String vertexId, long timestamp, String propertyKey, String propertyName, String propertyValue ) throws MutationsRejectedException { String dataRowKey = new DataTableRowKey(vertexId, propertyKey, propertyName).getRowKey() + VALUE_SEPARATOR + timestamp; Mutation addPropertyMutation = new Mutation(vertexId); byte[] data = propertyValue.getBytes(); StreamingPropertyValue spv = StreamingPropertyValue.create(propertyValue); StreamingPropertyValueTableRef spvValue = new StreamingPropertyValueTableRef(dataRowKey, spv, data); Metadata metadata = Metadata.create(); Property property = new MutablePropertyImpl(propertyKey, propertyName, spvValue, metadata, timestamp, new HashSet<>(), new Visibility(""), FetchHints.ALL); Text columnQualifier = KeyHelper.getColumnQualifierFromPropertyColumnQualifier(property, getGraph().getNameSubstitutionStrategy()); addPropertyMutation.put(AccumuloElement.CF_PROPERTY, columnQualifier, new Value(getGraph().getVertexiumSerializer().objectToBytes(spvValue))); getGraph().getVerticesWriter().addMutation(addPropertyMutation); Mutation addDataMutation = new Mutation(dataRowKey); addDataMutation.put(EMPTY_TEXT, EMPTY_TEXT, timestamp - 1000, new Value(data)); getGraph().getDataWriter().addMutation(addDataMutation); getGraph().flush(); }
@Override public StreamingPropertyValue toStreamingPropertyValue(AccumuloGraph graph, long timestamp) { return new StreamingPropertyValueTable(graph, getDataRowKey(), this, timestamp); } }