Skip to content

Commit

Permalink
Bug with merging of expired loggables was fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii0lomakin committed Oct 24, 2023
1 parent 53b064b commit e78ed63
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@ class MutableExpiredLoggableCollection implements ExpiredLoggableCollection {
private int _size;

public MutableExpiredLoggableCollection(Log log) {
this(log, null, new LongArrayList(), new IntArrayList(), null);
this(log, null, new LongArrayList(), new IntArrayList(), null, 0);
}

public MutableExpiredLoggableCollection(
Log log,
MutableExpiredLoggableCollection parent,
@NotNull LongArrayList addresses,
@NotNull IntArrayList lengths,
Long2IntOpenHashMap accumulatedStats) {
Long2IntOpenHashMap accumulatedStats, int size) {
this.log = log;
this.parent = parent;
this.addresses = addresses;
this.lengths = lengths;
this.accumulatedStats = accumulatedStats;
this._size = 0;
this._size = size;
}

@Override
Expand Down Expand Up @@ -162,8 +162,10 @@ public ExpiredLoggableCollection mergeWith(ExpiredLoggableCollection parent) {
if (parent instanceof MutableExpiredLoggableCollection) {
MutableExpiredLoggableCollection parentAsMutable = (MutableExpiredLoggableCollection) parent;
return (this.parent != null ? new MutableExpiredLoggableCollection(log,
this, parentAsMutable.addresses, parentAsMutable.lengths, parentAsMutable.accumulatedStats)
: new MutableExpiredLoggableCollection(log, parentAsMutable, addresses, lengths, accumulatedStats))
this, parentAsMutable.addresses, parentAsMutable.lengths, parentAsMutable.accumulatedStats,
parentAsMutable._size)
: new MutableExpiredLoggableCollection(log, parentAsMutable, addresses, lengths, accumulatedStats,
_size))
.applyAccumulateStats();
}

Expand Down

0 comments on commit e78ed63

Please sign in to comment.