Skip to content

Instantly share code, notes, and snippets.

@okram
Last active December 31, 2015 11:09
Show Gist options
  • Save okram/7977938 to your computer and use it in GitHub Desktop.
Save okram/7977938 to your computer and use it in GitHub Desktop.
if (this.trackState && faunusVertex.isLoaded()) {
final TitanVertex titanVertex = (TitanVertex) this.graph.getVertex(faunusVertex.getId());
for (final FaunusProperty property : faunusVertex.getPropertiesWithState()) {
if (property.isNew()) {
// TODO is this right?
titanVertex.addProperty(property.getName(), property.getValue());
context.getCounter(Counters.VERTEX_PROPERTIES_CREATED).increment(1l);
} else if (property.isDeleted()) {
// TODO: what if there are multiple properties of the same key?
titanVertex.removeProperty(property.getName());
context.getCounter(Counters.VERTEX_PROPERTIES_DELETED).increment(1l);
}
}
return titanVertex;
}
/////////////
else if (property.isDeleted()) {
// TODO: what if there are multiple properties of the same key?
for(TitanProperty p : titanVertex.getProperties(property.getName())) {
if(p.getValue().equals(property.getValue()))
p.remove();
}
context.getCounter(Counters.VERTEX_PROPERTIES_DELETED).increment(1l);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment