Log when we remove expired entries

This commit is contained in:
chimp1984 2020-11-04 12:02:38 -05:00
parent 012c54cf02
commit f10d2318f3
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3

View File

@ -511,10 +511,12 @@ public class P2PDataStorage implements MessageListener, ConnectionListener, Pers
// Batch processing can cause performance issues, so do all of the removes first, then update the listeners
// to let them know about the removes.
toRemoveList.forEach(toRemoveItem -> {
log.debug("We found an expired data entry. We remove the protectedData:\n\t" +
Utilities.toTruncatedString(toRemoveItem.getValue()));
});
if (log.isDebugEnabled()) {
toRemoveList.forEach(toRemoveItem -> {
log.debug("We found an expired data entry. We remove the protectedData:\n\t{}",
Utilities.toTruncatedString(toRemoveItem.getValue()));
});
}
removeFromMapAndDataStore(toRemoveList);
if (sequenceNumberMap.size() > this.maxSequenceNumberMapSizeBeforePurge) {
@ -937,6 +939,8 @@ public class P2PDataStorage implements MessageListener, ConnectionListener, Pers
if (entriesToRemoveWithPayloadHash.isEmpty())
return;
log.info("Remove {} expired data entries", entriesToRemoveWithPayloadHash.size());
ArrayList<ProtectedStorageEntry> entriesForSignal = new ArrayList<>(entriesToRemoveWithPayloadHash.size());
entriesToRemoveWithPayloadHash.forEach(entryToRemoveWithPayloadHash -> {
ByteArray hashOfPayload = entryToRemoveWithPayloadHash.getKey();