use of org.vertexium.property.MutablePropertyImpl in project vertexium by visallo.
the class ElementBase method getEdgeLabelProperty.
protected Property getEdgeLabelProperty() {
if (edgeLabelProperty == null && this instanceof Edge) {
String edgeLabel = ((Edge) this).getLabel();
edgeLabelProperty = new MutablePropertyImpl(ElementMutation.DEFAULT_KEY, Edge.LABEL_PROPERTY_NAME, edgeLabel, null, getTimestamp(), null, null, getFetchHints());
}
return edgeLabelProperty;
}
use of org.vertexium.property.MutablePropertyImpl in project vertexium by visallo.
the class ExistingElementMutationImplTest method testHasChangesDeleteProperty.
@Test
public void testHasChangesDeleteProperty() {
mutation.deleteProperty(new MutablePropertyImpl("key1", "name1", "value", null, null, null, new Visibility(""), FetchHints.ALL));
assertTrue("should have changes", mutation.hasChanges());
}
use of org.vertexium.property.MutablePropertyImpl in project vertexium by visallo.
the class ExistingElementMutationImplTest method testHasChangesSoftDeleteProperty.
@Test
public void testHasChangesSoftDeleteProperty() {
mutation.softDeleteProperty(new MutablePropertyImpl("key1", "name1", "value", null, null, null, new Visibility(""), FetchHints.ALL));
assertTrue("should have changes", mutation.hasChanges());
}
use of org.vertexium.property.MutablePropertyImpl in project vertexium by visallo.
the class AccumuloGraphTestBase method addLegacySPVData.
// need to add it manually because the key format changed
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 = new Metadata();
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();
}
use of org.vertexium.property.MutablePropertyImpl in project vertexium by visallo.
the class ExistingElementMutationImpl method addPropertyValue.
@Override
public ElementMutation<T> addPropertyValue(String key, String name, Object value, Metadata metadata, Long timestamp, Visibility visibility) {
Preconditions.checkNotNull(name, "property name cannot be null for property: " + name + ":" + key);
Preconditions.checkNotNull(value, "property value cannot be null for property: " + name + ":" + key);
properties.add(new MutablePropertyImpl(key, name, value, metadata, timestamp, null, visibility, FetchHints.ALL_INCLUDING_HIDDEN));
return this;
}
Aggregations