从版本< 12.1 >
xu yang编辑
在2022/04/27 12:30上
到版本
xu yang编辑
在2022/04/27 12:12上
>
修改评论 该版本没有评论

Summary

Details

Page properties
Content
... ... @@ -1,12 +4,10 @@
1 -get命令本质是调用了lookupKeyRead这个底层方法,
2 -lookupKeyRead方法如下:
3 -
4 4  {{plantuml}}
5 5  @startuml
6 6  start
7 7  
5 +:GET Command;
8 8  
9 -: lookupKeyReadWithFlags;
7 +: lookupKeyRead();
10 10  
11 11  
12 12  end
... ... @@ -13,37 +13,15 @@
13 13  @enduml
14 14  {{/plantuml}}
15 15  
16 -
17 -lookupKeyReadWithFlags方法如下:
18 -
19 19  {{plantuml}}
20 20  @startuml
21 21  start
22 22  
23 -if(调用expireIfNeeded方法判断key是否过期)then(1)
24 -note left
25 -返回1代表已经过期
26 -endnote
27 -if(当前环境为主节点)then(yes)
28 -:返回null;
29 -stop
30 -endif
18 +:lookupKeyRead();
31 31  
32 -if(当前环境为从节点,并且命令为读的时候,那说明key过期是安全的)then(yes)
33 -:返回null;
34 -stop
35 -endif
36 -endif
20 +: lookupKeyReadWithFlags();
37 37  
38 -:调用lookupKey方法,查询value的值;
39 -if(返回值为空)then(yes)
40 -:缓存命中+1;
41 -else(no)
42 -:缓存非命中+1;
43 -endif
44 44  
45 -:返回查询的结果;
46 -
47 47  end
48 48  @enduml
49 49  {{/plantuml}}