You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: invoker/storage/cache.go
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,16 @@ import (
6
6
"testing_system/lib/logger"
7
7
)
8
8
9
+
// The main idea of cache is following: We have one cache of specific size to hold all types of files.
10
+
// However, we have multiple file types so we must have different getter for each file.
11
+
//
12
+
// So we have single LRUSizeCache that holds all file types. Key for this cache is cacheKey, the internal struct with which we can determine the file type and it's keys.
13
+
//
14
+
// To access cache we have cacheGetter structs. Each cacheGetter responds for single file type.
15
+
// Each cacheGetter accepts any number of uint64 that are transformed to cacheKey struct using cacheGetter.keyGen func.
16
+
//
17
+
// So to access files, we call methods of cacheGetter, that transforms our request to request for LRUSizeCache and LRUSizeCache then does all the cache work.
0 commit comments