Last active
December 31, 2015 11:09
-
-
Save okram/7977938 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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