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: README.md
+47-15
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,8 @@ Note that the implementation of algorithm support two interaction modes:
31
31
32
32
But actually nothing forbidens to interact in both modes at same time.
33
33
34
+
Both types of interface developed to IPACR (Interaction Protocol of Algorithms Cache Replacement) conformance.
35
+
34
36
35
37
##### note №2:
36
38
Note that the implementation of algorithm stores keys in binary, that is, for set of keys from the first example bellow key will be stored as in second example:
@@ -187,14 +189,16 @@ max key size
187
189
internal - erlang interface for inner interaction in Erlang node
188
190
external - outside interface for interaction from the world outside
189
191
192
+
###### Both types of interface developed to IPACR (Interaction Protocol of Algorithms Cache Replacement) conformance.
#### execute scoring of offset counter and get keys by it into external table
248
252
###### Please pay attantion, that it`s preferably using interface with internal table 'fetch/0', because it ensures a data consistency with your system!
249
253
###### internal:
250
254
251
-
T = ets:new(stub,[ %% tid()
255
+
T = ets:new(stub,[ %% tid()
252
256
bag,public,{write_concurrency,true},
253
257
{decentralized_counters,true}
254
258
]).
255
259
lfu:fetch(T).
256
260
ets:tab2list(T).
257
261
258
-
#### execute scoring of offset counter and get keys by it into internal table for follow delete
262
+
#### execute scoring of offset counter and get keys by it into internal table for follow delete (support both interaction types)
263
+
##### without confirm
264
+
###### internal:
265
+
###### Please pay attantion, that exist of internal table expires after following request to fetching 'fetch/0' or to clean 'clean/0'!
#### execute scoring of offset counter and get keys by it into external table for follow delete
289
+
#### execute scoring of offset counter and get keys by it into external table for follow delete (support only internal interaction type)
271
290
###### Please pay attantion, that it`s preferably using interface with internal table 'clean/0', because it ensures a data consistency with your system!
291
+
##### without confirm
292
+
###### internal:
293
+
294
+
T = ets:new(stub,[ %% tid()
295
+
bag,public,{write_concurrency,true},
296
+
{decentralized_counters,true}
297
+
]).
298
+
T = lfu:clean(T). %% ref()
299
+
or
300
+
T = lfu:clean(async,T). %% ref()
301
+
302
+
##### with confirm
272
303
###### internal:
273
304
274
-
T = ets:new(stub,[ %% tid()
305
+
T = ets:new(stub,[ %% tid()
275
306
bag,public,{write_concurrency,true},
276
307
{decentralized_counters,true}
277
308
]).
278
-
R = lfu:clean(T). %% ref()
309
+
{T,R} = lfu:clean(sync,T). %% ref()
279
310
lfu:clean(R,T).
280
311
312
+
281
313
#### put list keys with conters
282
314
###### initialization of state, for example, transfer of state from other implementation 'lfu'
0 commit comments