@@ -307,32 +307,33 @@ private async Task RunIntegrityCheckAsync(ConcurrentLfu<int, string> lfu, int it
307307 RunIntegrityCheck ( lfu , this . output ) ;
308308 }
309309
310-
311310 private static void RunIntegrityCheck < K , V > ( ConcurrentLfu < K , V > cache , ITestOutputHelper output )
312311 {
313- new ConcurrentLfuIntegrityChecker < K , V > ( cache ) . Validate ( output ) ;
312+ new ConcurrentLfuIntegrityChecker < K , V , AccessOrderNode < K , V > , AccessOrderPolicy < K , V > > ( cache . Core ) . Validate ( output ) ;
314313 }
315314 }
316315
317- public class ConcurrentLfuIntegrityChecker < K , V >
316+ internal class ConcurrentLfuIntegrityChecker < K , V , N , P >
317+ where N : LfuNode < K , V >
318+ where P : struct , INodePolicy < K , V , N >
318319 {
319- private readonly ConcurrentLfu < K , V > cache ;
320+ private readonly ConcurrentLfuCore < K , V , N , P > cache ;
320321
321322 private readonly LfuNodeList < K , V > windowLru ;
322323 private readonly LfuNodeList < K , V > probationLru ;
323324 private readonly LfuNodeList < K , V > protectedLru ;
324325
325- private readonly StripedMpscBuffer < LfuNode < K , V > > readBuffer ;
326- private readonly MpscBoundedBuffer < LfuNode < K , V > > writeBuffer ;
326+ private readonly StripedMpscBuffer < N > readBuffer ;
327+ private readonly MpscBoundedBuffer < N > writeBuffer ;
327328
328- private static FieldInfo windowLruField = typeof ( ConcurrentLfu < K , V > ) . GetField ( "windowLru" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
329- private static FieldInfo probationLruField = typeof ( ConcurrentLfu < K , V > ) . GetField ( "probationLru" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
330- private static FieldInfo protectedLruField = typeof ( ConcurrentLfu < K , V > ) . GetField ( "protectedLru" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
329+ private static FieldInfo windowLruField = typeof ( ConcurrentLfuCore < K , V , N , P > ) . GetField ( "windowLru" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
330+ private static FieldInfo probationLruField = typeof ( ConcurrentLfuCore < K , V , N , P > ) . GetField ( "probationLru" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
331+ private static FieldInfo protectedLruField = typeof ( ConcurrentLfuCore < K , V , N , P > ) . GetField ( "protectedLru" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
331332
332- private static FieldInfo readBufferField = typeof ( ConcurrentLfu < K , V > ) . GetField ( "readBuffer" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
333- private static FieldInfo writeBufferField = typeof ( ConcurrentLfu < K , V > ) . GetField ( "writeBuffer" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
333+ private static FieldInfo readBufferField = typeof ( ConcurrentLfuCore < K , V , N , P > ) . GetField ( "readBuffer" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
334+ private static FieldInfo writeBufferField = typeof ( ConcurrentLfuCore < K , V , N , P > ) . GetField ( "writeBuffer" , BindingFlags . NonPublic | BindingFlags . Instance ) ;
334335
335- public ConcurrentLfuIntegrityChecker ( ConcurrentLfu < K , V > cache )
336+ public ConcurrentLfuIntegrityChecker ( ConcurrentLfuCore < K , V , N , P > cache )
336337 {
337338 this . cache = cache ;
338339
@@ -341,8 +342,8 @@ public ConcurrentLfuIntegrityChecker(ConcurrentLfu<K, V> cache)
341342 this . probationLru = ( LfuNodeList < K , V > ) probationLruField . GetValue ( cache ) ;
342343 this . protectedLru = ( LfuNodeList < K , V > ) protectedLruField . GetValue ( cache ) ;
343344
344- this . readBuffer = ( StripedMpscBuffer < LfuNode < K , V > > ) readBufferField . GetValue ( cache ) ;
345- this . writeBuffer = ( MpscBoundedBuffer < LfuNode < K , V > > ) writeBufferField . GetValue ( cache ) ;
345+ this . readBuffer = ( StripedMpscBuffer < N > ) readBufferField . GetValue ( cache ) ;
346+ this . writeBuffer = ( MpscBoundedBuffer < N > ) writeBufferField . GetValue ( cache ) ;
346347 }
347348
348349 public void Validate ( ITestOutputHelper output )
0 commit comments