Add logging
This commit is contained in:
parent
e5081a62cd
commit
b4e25c8573
@ -226,6 +226,7 @@ public class LLLocalDictionary implements LLDictionary {
|
|||||||
var rwuLock = itemsLock.getAt(getLockIndex(key));
|
var rwuLock = itemsLock.getAt(getLockIndex(key));
|
||||||
rwuLock.updateLock().lock();
|
rwuLock.updateLock().lock();
|
||||||
try {
|
try {
|
||||||
|
logger.trace("Reading {}", key);
|
||||||
Optional<byte[]> prevData;
|
Optional<byte[]> prevData;
|
||||||
var prevDataHolder = new Holder<byte[]>();
|
var prevDataHolder = new Holder<byte[]>();
|
||||||
if (db.keyMayExist(cfh, key, prevDataHolder)) {
|
if (db.keyMayExist(cfh, key, prevDataHolder)) {
|
||||||
@ -243,6 +244,7 @@ public class LLLocalDictionary implements LLDictionary {
|
|||||||
if (prevData.isPresent() && newData.isEmpty()) {
|
if (prevData.isPresent() && newData.isEmpty()) {
|
||||||
rwuLock.writeLock().lock();
|
rwuLock.writeLock().lock();
|
||||||
try {
|
try {
|
||||||
|
logger.trace("Deleting {}", key);
|
||||||
changed = true;
|
changed = true;
|
||||||
db.delete(cfh, key);
|
db.delete(cfh, key);
|
||||||
} finally {
|
} finally {
|
||||||
@ -252,6 +254,7 @@ public class LLLocalDictionary implements LLDictionary {
|
|||||||
&& (prevData.isEmpty() || !Arrays.equals(prevData.get(), newData.get()))) {
|
&& (prevData.isEmpty() || !Arrays.equals(prevData.get(), newData.get()))) {
|
||||||
rwuLock.writeLock().lock();
|
rwuLock.writeLock().lock();
|
||||||
try {
|
try {
|
||||||
|
logger.trace("Writing {}: {}", key, newData.get());
|
||||||
changed = true;
|
changed = true;
|
||||||
db.put(cfh, key, newData.get());
|
db.put(cfh, key, newData.get());
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
Reference in New Issue
Block a user