Skip to content

Commit 644e0f2

Browse files
badrishcCopilot
andcommitted
chore: make CallOnFlush/CallOnEvict/CallOnDiskRead default to false via DIM
All three gate properties on IRecordTriggers now have default implementations returning false. Implementations that don't need any trigger callbacks (like GarnetRecordTriggers) no longer need to explicitly declare them — the empty struct body suffices. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2104e39 commit 644e0f2

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

libs/server/Storage/Functions/GarnetRecordTriggers.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,5 @@ namespace Garnet.server
1313
/// </summary>
1414
public readonly struct GarnetRecordTriggers : IRecordTriggers
1515
{
16-
/// <inheritdoc/>
17-
public bool CallOnFlush => false;
18-
19-
/// <inheritdoc/>
20-
public bool CallOnEvict => false;
21-
22-
/// <inheritdoc/>
23-
public bool CallOnDiskRead => false;
2416
}
2517
}

libs/storage/Tsavorite/cs/src/core/Index/StoreFunctions/IRecordTriggers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ public interface IRecordTriggers
3131
/// If true, <see cref="OnFlush(ref LogRecord)"/> is called per valid record on the
3232
/// original in-memory page before it is flushed to disk.
3333
/// </summary>
34-
bool CallOnFlush { get; }
34+
bool CallOnFlush => false;
3535

3636
/// <summary>
3737
/// If true, <see cref="OnEvict(ref LogRecord, EvictionSource)"/> is called per non-tombstoned
3838
/// record when a page is evicted past HeadAddress. Returning false lets the allocator skip the
3939
/// per-record OnEvict callback when the application has no work to do.
4040
/// Note: Tsavorite's internal heap-size accounting runs regardless of this flag.
4141
/// </summary>
42-
bool CallOnEvict { get; }
42+
bool CallOnEvict => false;
4343

4444
/// <summary>
4545
/// If true, <see cref="OnDiskRead(ref LogRecord)"/> is called per record loaded from
4646
/// disk into memory (recovery, delta log apply, pending reads, push scans).
4747
/// </summary>
48-
bool CallOnDiskRead { get; }
48+
bool CallOnDiskRead => false;
4949

5050
/// <summary>
5151
/// Called when a record is disposed due to delete, expiration, CAS failure, elision,

0 commit comments

Comments
 (0)