Add logging

This commit is contained in:
Andrea Cavalli 2021-02-11 10:43:03 +01:00
parent e5081a62cd
commit b4e25c8573

View File

@ -226,6 +226,7 @@ public class LLLocalDictionary implements LLDictionary {
var rwuLock = itemsLock.getAt(getLockIndex(key));
rwuLock.updateLock().lock();
try {
logger.trace("Reading {}", key);
Optional<byte[]> prevData;
var prevDataHolder = new Holder<byte[]>();
if (db.keyMayExist(cfh, key, prevDataHolder)) {
@ -243,6 +244,7 @@ public class LLLocalDictionary implements LLDictionary {
if (prevData.isPresent() && newData.isEmpty()) {
rwuLock.writeLock().lock();
try {
logger.trace("Deleting {}", key);
changed = true;
db.delete(cfh, key);
} finally {
@ -252,6 +254,7 @@ public class LLLocalDictionary implements LLDictionary {
&& (prevData.isEmpty() || !Arrays.equals(prevData.get(), newData.get()))) {
rwuLock.writeLock().lock();
try {
logger.trace("Writing {}: {}", key, newData.get());
changed = true;
db.put(cfh, key, newData.get());
} finally {