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