use of org.janusgraph.diskstorage.keycolumnvalue.keyvalue.KVMutation in project janusgraph by JanusGraph.
the class BerkeleyJEStoreManager method mutateMany.
@Override
public void mutateMany(Map<String, KVMutation> mutations, StoreTransaction txh) throws BackendException {
for (Map.Entry<String, KVMutation> mutation : mutations.entrySet()) {
BerkeleyJEKeyValueStore store = openDatabase(mutation.getKey());
KVMutation mutationValue = mutation.getValue();
if (!mutationValue.hasAdditions() && !mutationValue.hasDeletions()) {
log.debug("Empty mutation set for {}, doing nothing", mutation.getKey());
} else {
log.debug("Mutating {}", mutation.getKey());
}
if (mutationValue.hasAdditions()) {
for (KeyValueEntry entry : mutationValue.getAdditions()) {
store.insert(entry.getKey(), entry.getValue(), txh);
log.trace("Insertion on {}: {}", mutation.getKey(), entry);
}
}
if (mutationValue.hasDeletions()) {
for (StaticBuffer del : mutationValue.getDeletions()) {
store.delete(del, txh);
log.trace("Deletion on {}: {}", mutation.getKey(), del);
}
}
}
}
Aggregations