diff --git a/2014/12/23/my-new-post/index.html b/2014/12/23/my-new-post/index.html index 59a379cdd7..799b7f7028 100644 --- a/2014/12/23/my-new-post/index.html +++ b/2014/12/23/my-new-post/index.html @@ -436,7 +436,7 @@
- 33 + 34 posts
@@ -474,7 +474,7 @@
- +
diff --git a/2014/12/24/MFC 模态对话框/index.html b/2014/12/24/MFC 模态对话框/index.html index 02f809d3c9..7863492c2d 100644 --- a/2014/12/24/MFC 模态对话框/index.html +++ b/2014/12/24/MFC 模态对话框/index.html @@ -308,16 +308,16 @@ @@ -459,7 +459,7 @@
- 33 + 34 posts
@@ -497,7 +497,7 @@
- +
diff --git a/2014/12/30/Clone-Graph-Part-I/index.html b/2014/12/30/Clone-Graph-Part-I/index.html index c2dbe10e24..a8a1ec04ed 100644 --- a/2014/12/30/Clone-Graph-Part-I/index.html +++ b/2014/12/30/Clone-Graph-Part-I/index.html @@ -61,8 +61,8 @@ - + @@ -310,16 +310,16 @@ @@ -363,8 +363,8 @@ @@ -483,7 +489,7 @@
- 33 + 34 posts
@@ -521,7 +527,7 @@
- +
diff --git a/2020/01/22/redis数据结构介绍六/index.html b/2020/01/22/redis数据结构介绍六/index.html new file mode 100644 index 0000000000..3305f118fb --- /dev/null +++ b/2020/01/22/redis数据结构介绍六/index.html @@ -0,0 +1,705 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + redis数据结构介绍六 | Nicksxs's Blog + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ + +

What hurts more, the pain of hard work or the pain of regret?

+
+ + +
+ + + +
+
+ + +
+ + 0% +
+ + + + +
+
+
+ + +
+ + +
+ + + +
+ + + + + +
+

+ redis数据结构介绍六 +

+ + +
+ + + + +
+ + +

这应该是 redis 系列的最后一篇了,讲下快表,其实最前面讲的链表在早先的 redis 版本中也作为 list 的数据结构使用过,但是单纯的链表的缺陷之前也说了,插入便利,但是空间利用率低,并且不能进行二分查找等,检索效率低,ziplist 压缩表的产生也是同理,希望获得更好的性能,包括存储空间和访问性能等,原来我也不懂这个快表要怎么快,然后明白了一个道理,其实并没有什么银弹,只是大牛们会在适合的时候使用最适合的数据结构来实现性能的最大化,这里面有一招就是不同数据结构的组合调整,比如 Java 中的 HashMap,在链表节点数大于 8 时会转变成红黑树,以此提高访问效率,不费话了,回到快表,quicklist,这个数据结构主要使用在 list 类型中,如果我说其实这个 quicklist 就是个链表,可能大家不太会相信,但是事实上的确可以认为 quicklist 是个双向链表,看下代码

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* quicklistNode is a 32 byte struct describing a ziplist for a quicklist.
* We use bit fields keep the quicklistNode at 32 bytes.
* count: 16 bits, max 65536 (max zl bytes is 65k, so max count actually < 32k).
* encoding: 2 bits, RAW=1, LZF=2.
* container: 2 bits, NONE=1, ZIPLIST=2.
* recompress: 1 bit, bool, true if node is temporarry decompressed for usage.
* attempted_compress: 1 bit, boolean, used for verifying during testing.
* extra: 10 bits, free for future use; pads out the remainder of 32 bits */
typedef struct quicklistNode {
struct quicklistNode *prev;
struct quicklistNode *next;
unsigned char *zl;
unsigned int sz; /* ziplist size in bytes */
unsigned int count : 16; /* count of items in ziplist */
unsigned int encoding : 2; /* RAW==1 or LZF==2 */
unsigned int container : 2; /* NONE==1 or ZIPLIST==2 */
unsigned int recompress : 1; /* was this node previous compressed? */
unsigned int attempted_compress : 1; /* node can't compress; too small */
unsigned int extra : 10; /* more bits to steal for future usage */
} quicklistNode;

/* quicklistLZF is a 4+N byte struct holding 'sz' followed by 'compressed'.
* 'sz' is byte length of 'compressed' field.
* 'compressed' is LZF data with total (compressed) length 'sz'
* NOTE: uncompressed length is stored in quicklistNode->sz.
* When quicklistNode->zl is compressed, node->zl points to a quicklistLZF */
typedef struct quicklistLZF {
unsigned int sz; /* LZF size in bytes*/
char compressed[];
} quicklistLZF;

/* quicklist is a 40 byte struct (on 64-bit systems) describing a quicklist.
* 'count' is the number of total entries.
* 'len' is the number of quicklist nodes.
* 'compress' is: -1 if compression disabled, otherwise it's the number
* of quicklistNodes to leave uncompressed at ends of quicklist.
* 'fill' is the user-requested (or default) fill factor. */
typedef struct quicklist {
quicklistNode *head;
quicklistNode *tail;
unsigned long count; /* total count of all entries in all ziplists */
unsigned long len; /* number of quicklistNodes */
int fill : 16; /* fill factor for individual nodes */
unsigned int compress : 16; /* depth of end nodes not to compress;0=off */
} quicklist;
+

粗略看下,quicklist 里有 head,tail, quicklistNode里有 prev,next 指针,是不是有链表的基本轮廓了,那么为啥这玩意要称为快表呢,快在哪,关键就在这个unsigned char *zl;zl 是不是前面又看到过,就是 ziplist ,这是什么鬼,链表里用压缩表,这不套娃么,先别急,回顾下前面说的 ziplist,ziplist 有哪些特点,内存利用率高,可以从表头快速定位到尾节点,节点可以从后往前找,但是有个缺点,就是从中间插入的效率比较低,需要整体往后移,这个其实是普通数组的优化版,但还是有数组的一些劣势,所以要真的快,是不是可以将链表跟数组真的结合起来。

+

ziplist

这里有两个 redis 的配置参数,list-max-ziplist-sizelist-compress-depth,先来说第一个,既然快表是将链表跟压缩表数组结合起来使用,那么具体怎么用呢,比如我有一个 10 个元素的 list,那具体怎么放,每个 quicklistNode 里放多大的 ziplist,假如每个快表节点的 ziplist 只放一个元素,那么其实这就退化成了一个链表,如果 10 个元素放在一个 quicklistNode 的 ziplist 里,那就退化成了一个 ziplist,所以有了这个 list-max-ziplist-size,而且它还比较牛,能取正负值,当是正值时,对应的就是每个 quicklistNode 的 ziplist 中的元素个数,比如配置了 list-max-ziplist-size = 5,那么我刚才的 10 个元素的 list 就是一个两个 quicklistNode 组成的快表,每个 quicklistNode 中的 ziplist 包含了五个元素,当 list-max-ziplist-size取负值的时候,它限制了 ziplist 的字节数

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
size_t offset = (-fill) - 1;
if (offset < (sizeof(optimization_level) / sizeof(*optimization_level))) {
if (sz <= optimization_level[offset]) {
return 1;
} else {
return 0;
}
} else {
return 0;
}

/* Optimization levels for size-based filling */
static const size_t optimization_level[] = {4096, 8192, 16384, 32768, 65536};

/* Create a new quicklist.
* Free with quicklistRelease(). */
quicklist *quicklistCreate(void) {
struct quicklist *quicklist;

quicklist = zmalloc(sizeof(*quicklist));
quicklist->head = quicklist->tail = NULL;
quicklist->len = 0;
quicklist->count = 0;
quicklist->compress = 0;
quicklist->fill = -2;
return quicklist;
}
+

这个 fill 就是传进来的 list-max-ziplist-size, 具体对应的就是

+
    +
  • -5: 每个quicklist节点上的ziplist大小不能超过64 Kb。(注:1kb => 1024 bytes)
  • +
  • -4: 每个quicklist节点上的ziplist大小不能超过32 Kb。
  • +
  • -3: 每个quicklist节点上的ziplist大小不能超过16 Kb。
  • +
  • -2: 每个quicklist节点上的ziplist大小不能超过8 Kb。(-2是Redis给出的默认值)也就是上面的 quicklist->fill = -2;
  • +
  • -1: 每个quicklist节点上的ziplist大小不能超过4 Kb。
  • +
+

压缩

list-compress-depth这个参数呢是用来配置压缩的,等等压缩是为啥,不是里面已经是压缩表了么,大牛们就是为了性能殚精竭虑,这里考虑到的是一个场景,一般状况下,list 都是两端的访问频率比较高,那么是不是可以对中间的数据进行压缩,那么这个参数就是用来表示

+
1
/* depth of end nodes not to compress;0=off */
+
    +
  • 0,代表不压缩,默认值
  • +
  • 1,两端各一个节点不压缩
  • +
  • 2,两端各两个节点不压缩
  • +
  • … 依次类推
    压缩后的 ziplist 就会变成 quicklistLZF,然后替换 zl 指针,这里使用的是 LZF 压缩算法,压缩后的 quicklistLZF 中的 compressed 也是个柔性数组,压缩后的 ziplist 整个就放进这个柔性数组
  • +
+

插入过程

简单说下插入元素的过程

+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/* Wrapper to allow argument-based switching between HEAD/TAIL pop */
void quicklistPush(quicklist *quicklist, void *value, const size_t sz,
int where) {
if (where == QUICKLIST_HEAD) {
quicklistPushHead(quicklist, value, sz);
} else if (where == QUICKLIST_TAIL) {
quicklistPushTail(quicklist, value, sz);
}
}

/* Add new entry to head node of quicklist.
*
* Returns 0 if used existing head.
* Returns 1 if new head created. */
int quicklistPushHead(quicklist *quicklist, void *value, size_t sz) {
quicklistNode *orig_head = quicklist->head;
if (likely(
_quicklistNodeAllowInsert(quicklist->head, quicklist->fill, sz))) {
quicklist->head->zl =
ziplistPush(quicklist->head->zl, value, sz, ZIPLIST_HEAD);
quicklistNodeUpdateSz(quicklist->head);
} else {
quicklistNode *node = quicklistCreateNode();
node->zl = ziplistPush(ziplistNew(), value, sz, ZIPLIST_HEAD);

quicklistNodeUpdateSz(node);
_quicklistInsertNodeBefore(quicklist, quicklist->head, node);
}
quicklist->count++;
quicklist->head->count++;
return (orig_head != quicklist->head);
}

/* Add new entry to tail node of quicklist.
*
* Returns 0 if used existing tail.
* Returns 1 if new tail created. */
int quicklistPushTail(quicklist *quicklist, void *value, size_t sz) {
quicklistNode *orig_tail = quicklist->tail;
if (likely(
_quicklistNodeAllowInsert(quicklist->tail, quicklist->fill, sz))) {
quicklist->tail->zl =
ziplistPush(quicklist->tail->zl, value, sz, ZIPLIST_TAIL);
quicklistNodeUpdateSz(quicklist->tail);
} else {
quicklistNode *node = quicklistCreateNode();
node->zl = ziplistPush(ziplistNew(), value, sz, ZIPLIST_TAIL);

quicklistNodeUpdateSz(node);
_quicklistInsertNodeAfter(quicklist, quicklist->tail, node);
}
quicklist->count++;
quicklist->tail->count++;
return (orig_tail != quicklist->tail);
}

/* Wrappers for node inserting around existing node. */
REDIS_STATIC void _quicklistInsertNodeBefore(quicklist *quicklist,
quicklistNode *old_node,
quicklistNode *new_node) {
__quicklistInsertNode(quicklist, old_node, new_node, 0);
}

REDIS_STATIC void _quicklistInsertNodeAfter(quicklist *quicklist,
quicklistNode *old_node,
quicklistNode *new_node) {
__quicklistInsertNode(quicklist, old_node, new_node, 1);
}

/* Insert 'new_node' after 'old_node' if 'after' is 1.
* Insert 'new_node' before 'old_node' if 'after' is 0.
* Note: 'new_node' is *always* uncompressed, so if we assign it to
* head or tail, we do not need to uncompress it. */
REDIS_STATIC void __quicklistInsertNode(quicklist *quicklist,
quicklistNode *old_node,
quicklistNode *new_node, int after) {
if (after) {
new_node->prev = old_node;
if (old_node) {
new_node->next = old_node->next;
if (old_node->next)
old_node->next->prev = new_node;
old_node->next = new_node;
}
if (quicklist->tail == old_node)
quicklist->tail = new_node;
} else {
new_node->next = old_node;
if (old_node) {
new_node->prev = old_node->prev;
if (old_node->prev)
old_node->prev->next = new_node;
old_node->prev = new_node;
}
if (quicklist->head == old_node)
quicklist->head = new_node;
}
/* If this insert creates the only element so far, initialize head/tail. */
if (quicklist->len == 0) {
quicklist->head = quicklist->tail = new_node;
}

if (old_node)
quicklistCompress(quicklist, old_node);

quicklist->len++;
}
+

前面第一步先根据插入的是头还是尾选择不同的 push 函数,quicklistPushHead 或者 quicklistPushTail,举例分析下从头插入的 quicklistPushHead,先判断当前的 quicklistNode 节点还能不能允许再往 ziplist 里添加元素,如果可以就添加,如果不允许就新建一个 quicklistNode,然后调用 _quicklistInsertNodeBefore 将节点插进去,具体插入quicklist节点的操作类似链表的插入。

+ +
+ + + + + + + + +
+
请我喝杯咖啡
+ + +
+ + + +
+ +
+ + + + +
+ + + + +
+ + +
+ + +
+
+ +
+
+ + + + +
+ + + + + + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/404.html b/404.html index 69dbe557ee..f0936f096c 100644 --- a/404.html +++ b/404.html @@ -340,7 +340,7 @@
- 33 + 34 posts
@@ -378,7 +378,7 @@
- +
diff --git a/404/index.html b/404/index.html index 0fee96650e..de9f1db74a 100644 --- a/404/index.html +++ b/404/index.html @@ -327,7 +327,7 @@
- 33 + 34 posts
@@ -365,7 +365,7 @@
- +
diff --git a/archives/2014/12/index.html b/archives/2014/12/index.html index d0bcc03a05..2ad0f4d593 100644 --- a/archives/2014/12/index.html +++ b/archives/2014/12/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -368,7 +368,7 @@
- 33 + 34 posts
@@ -406,7 +406,7 @@
diff --git a/archives/2014/index.html b/archives/2014/index.html index 110e202ff6..8936038832 100644 --- a/archives/2014/index.html +++ b/archives/2014/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -368,7 +368,7 @@ @@ -406,7 +406,7 @@ diff --git a/archives/2015/01/index.html b/archives/2015/01/index.html index 36bdd88cc2..0b38d3e38e 100644 --- a/archives/2015/01/index.html +++ b/archives/2015/01/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -368,7 +368,7 @@ @@ -406,7 +406,7 @@ diff --git a/archives/2015/03/index.html b/archives/2015/03/index.html index af32f3c2a9..a7daf3fa49 100644 --- a/archives/2015/03/index.html +++ b/archives/2015/03/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -368,7 +368,7 @@ @@ -406,7 +406,7 @@ diff --git a/archives/2015/04/index.html b/archives/2015/04/index.html index 75887b1ccc..cf6c36bc29 100644 --- a/archives/2015/04/index.html +++ b/archives/2015/04/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -348,7 +348,7 @@ @@ -386,7 +386,7 @@ diff --git a/archives/2015/06/index.html b/archives/2015/06/index.html index 31ee22aced..b451f1b01e 100644 --- a/archives/2015/06/index.html +++ b/archives/2015/06/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2015/index.html b/archives/2015/index.html index e0ee92e817..115b1dae53 100644 --- a/archives/2015/index.html +++ b/archives/2015/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -488,7 +488,7 @@ @@ -526,7 +526,7 @@ diff --git a/archives/2016/07/index.html b/archives/2016/07/index.html index be3aef8de7..5c962b682a 100644 --- a/archives/2016/07/index.html +++ b/archives/2016/07/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2016/08/index.html b/archives/2016/08/index.html index 3d647e9f56..2a54e863c4 100644 --- a/archives/2016/08/index.html +++ b/archives/2016/08/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -348,7 +348,7 @@ @@ -386,7 +386,7 @@ diff --git a/archives/2016/09/index.html b/archives/2016/09/index.html index fe11a2bee1..5869232182 100644 --- a/archives/2016/09/index.html +++ b/archives/2016/09/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2016/10/index.html b/archives/2016/10/index.html index 718d15421b..179958940b 100644 --- a/archives/2016/10/index.html +++ b/archives/2016/10/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -348,7 +348,7 @@ @@ -386,7 +386,7 @@ diff --git a/archives/2016/11/index.html b/archives/2016/11/index.html index 0255f28e30..844e595583 100644 --- a/archives/2016/11/index.html +++ b/archives/2016/11/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2016/index.html b/archives/2016/index.html index 799d729394..b877f01d0e 100644 --- a/archives/2016/index.html +++ b/archives/2016/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -448,7 +448,7 @@ @@ -486,7 +486,7 @@ diff --git a/archives/2017/03/index.html b/archives/2017/03/index.html index e0f9a739d5..39add7d38b 100644 --- a/archives/2017/03/index.html +++ b/archives/2017/03/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2017/04/index.html b/archives/2017/04/index.html index c23112a744..f01efa51e1 100644 --- a/archives/2017/04/index.html +++ b/archives/2017/04/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2017/05/index.html b/archives/2017/05/index.html index 27e74b6740..15f75f1acf 100644 --- a/archives/2017/05/index.html +++ b/archives/2017/05/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2017/index.html b/archives/2017/index.html index 9eb8959dcf..7386252099 100644 --- a/archives/2017/index.html +++ b/archives/2017/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -368,7 +368,7 @@ @@ -406,7 +406,7 @@ diff --git a/archives/2019/06/index.html b/archives/2019/06/index.html index fea5455d78..9d4c56f30a 100644 --- a/archives/2019/06/index.html +++ b/archives/2019/06/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2019/09/index.html b/archives/2019/09/index.html index 696f5314e7..b1ab08fae5 100644 --- a/archives/2019/09/index.html +++ b/archives/2019/09/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/archives/2019/12/index.html b/archives/2019/12/index.html index 7a4c010868..e5fbe12949 100644 --- a/archives/2019/12/index.html +++ b/archives/2019/12/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -408,7 +408,7 @@ @@ -446,7 +446,7 @@ diff --git a/archives/2019/index.html b/archives/2019/index.html index f2588e4263..12148fc6c6 100644 --- a/archives/2019/index.html +++ b/archives/2019/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -448,7 +448,7 @@ @@ -486,7 +486,7 @@ diff --git a/archives/2020/01/index.html b/archives/2020/01/index.html index 0f9065f32e..0ed4b70858 100644 --- a/archives/2020/01/index.html +++ b/archives/2020/01/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -234,6 +234,26 @@

2020

+ +
@@ -388,7 +408,7 @@ @@ -426,7 +446,7 @@ diff --git a/archives/2020/index.html b/archives/2020/index.html index 465a787e24..4eac9ab7cd 100644 --- a/archives/2020/index.html +++ b/archives/2020/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -234,6 +234,26 @@

2020

+ +
@@ -388,7 +408,7 @@ @@ -426,7 +446,7 @@ diff --git a/archives/index.html b/archives/index.html index 8f161a841a..ce889ccfce 100644 --- a/archives/index.html +++ b/archives/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -234,6 +234,26 @@

2020

+ +
@@ -417,26 +437,6 @@
- -
@@ -514,7 +514,7 @@ @@ -552,7 +552,7 @@ diff --git a/archives/page/2/index.html b/archives/page/2/index.html index 92ac5d2382..6318108fd9 100644 --- a/archives/page/2/index.html +++ b/archives/page/2/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -234,6 +234,26 @@

2019

+ +
@@ -420,26 +440,6 @@
- -
@@ -517,7 +517,7 @@ @@ -555,7 +555,7 @@ diff --git a/archives/page/3/index.html b/archives/page/3/index.html index 797e5a6ad4..c5d925402c 100644 --- a/archives/page/3/index.html +++ b/archives/page/3/index.html @@ -226,7 +226,7 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
@@ -234,6 +234,26 @@

2016

+ +
@@ -417,26 +437,6 @@
- -
@@ -514,7 +514,7 @@ @@ -552,7 +552,7 @@ diff --git a/archives/page/4/index.html b/archives/page/4/index.html index bd7a9db11b..e8f4fac4f1 100644 --- a/archives/page/4/index.html +++ b/archives/page/4/index.html @@ -226,10 +226,33 @@
- OK! 33 posts in total. Keep on posting. + OK! 34 posts in total. Keep on posting.
+
+

2015

+
+ +

2014

@@ -371,7 +394,7 @@ @@ -409,7 +432,7 @@ diff --git a/atom.xml b/atom.xml index 20bc0126fe..52434bde2c 100644 --- a/atom.xml +++ b/atom.xml @@ -6,7 +6,7 @@ - 2020-01-19T17:02:48.081Z + 2020-01-22T13:51:30.951Z https://nicksxs.me/ @@ -16,6 +16,45 @@ Hexo + + redis数据结构介绍六 + + https://nicksxs.me/2020/01/22/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D%E5%85%AD/ + 2020-01-22T13:51:30.000Z + 2020-01-22T13:51:30.951Z + + + + + + + + <p>这应该是 redis 系列的最后一篇了,讲下快表,其实最前面讲的链表在早先的 redis 版本中也作为 list 的数据结构使用过,但是单纯的链表的缺陷之前也说了,插入便利,但是空间利用率低,并且不能进行二分查找等,检索效率低,ziplist + + + + + + + + + + + + + + + + + + + + + + + + + redis数据结构介绍五-第五部分 对象 @@ -269,12 +308,12 @@ + + - - @@ -340,21 +379,21 @@ - - + + - - + + @@ -649,27 +688,4 @@ - - docker-mysql-cluster - - https://nicksxs.me/2016/08/14/docker-mysql-cluster/ - 2016-08-14T08:51:00.000Z - 2020-01-12T13:08:27.011Z - - - - <h3 id="docker-mysql-cluster"><a href="#docker-mysql-cluster" class="headerlink" title="docker-mysql-cluster"></a>docker-mysql-cluster</h3><p>基于docker搭了个mysql集群,稍微记一下,<br>首先是新建mysql主库容<br> - - - - - - - - - - - - - diff --git a/baidu_verify_Gl8jtoDV4z.html b/baidu_verify_Gl8jtoDV4z.html index 4dfebe6d2b..9f0b5260d1 100644 --- a/baidu_verify_Gl8jtoDV4z.html +++ b/baidu_verify_Gl8jtoDV4z.html @@ -329,7 +329,7 @@ @@ -367,7 +367,7 @@ diff --git a/baidusitemap.xml b/baidusitemap.xml index 0028e262bf..dcf7b8aede 100644 --- a/baidusitemap.xml +++ b/baidusitemap.xml @@ -1,32 +1,35 @@ + https://nicksxs.me/2020/01/22/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D%E5%85%AD/ + 2020-01-22 + https://nicksxs.me/2020/01/20/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D%E4%BA%94/ 2020-01-19 https://nicksxs.me/2020/01/19/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D%E5%9B%9B/ 2020-01-18 - - https://nicksxs.me/2015/01/14/Two-Sum/ - 2020-01-12 https://nicksxs.me/2019/12/10/Redis-Part-1/ 2020-01-12 - https://nicksxs.me/2016/09/29/binary-watch/ + https://nicksxs.me/2015/01/14/Two-Sum/ 2020-01-12 https://nicksxs.me/2016/11/10/php-abstract-class-and-interface/ 2020-01-12 - https://nicksxs.me/2019/12/26/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D/ + https://nicksxs.me/2016/09/29/binary-watch/ 2020-01-12 - https://nicksxs.me/2015/03/13/Reverse-Integer/ + https://nicksxs.me/2019/12/26/redis%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%BB%8B%E7%BB%8D/ 2020-01-12 https://nicksxs.me/2015/04/14/Add-Two-Number/ 2020-01-12 + + https://nicksxs.me/2015/03/13/Reverse-Integer/ + 2020-01-12 https://nicksxs.me/2016/08/14/docker-mysql-cluster/ 2020-01-12 diff --git a/categories/C/Redis/index.html b/categories/C/Redis/index.html index 65ecfe5bd8..4b670baadc 100644 --- a/categories/C/Redis/index.html +++ b/categories/C/Redis/index.html @@ -235,6 +235,26 @@

2020

+ +
@@ -431,7 +451,7 @@ @@ -469,7 +489,7 @@ diff --git a/categories/C/index.html b/categories/C/index.html index b6e878cbed..ffb1ec993d 100644 --- a/categories/C/index.html +++ b/categories/C/index.html @@ -235,6 +235,26 @@

2020

+ +
@@ -431,7 +451,7 @@ @@ -469,7 +489,7 @@ diff --git a/categories/Java/Design-Patterns/index.html b/categories/Java/Design-Patterns/index.html index d9fba834bf..5b43ba9a42 100644 --- a/categories/Java/Design-Patterns/index.html +++ b/categories/Java/Design-Patterns/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/categories/Java/GC/index.html b/categories/Java/GC/index.html index dc22940395..3a3ca8bddd 100644 --- a/categories/Java/GC/index.html +++ b/categories/Java/GC/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/categories/Java/JVM/index.html b/categories/Java/JVM/index.html index 243013d575..640a472d31 100644 --- a/categories/Java/JVM/index.html +++ b/categories/Java/JVM/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/categories/Java/Singleton/index.html b/categories/Java/Singleton/index.html index 349d503e2d..0b6c4abeac 100644 --- a/categories/Java/Singleton/index.html +++ b/categories/Java/Singleton/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/categories/Java/index.html b/categories/Java/index.html index 6b4683678f..0aa0d6c5d1 100644 --- a/categories/Java/index.html +++ b/categories/Java/index.html @@ -55,7 +55,7 @@ - + @@ -66,7 +66,7 @@ - + - Category: Java | Nicksxs's Blog + Category: java | Nicksxs's Blog + + + + + + +> - Tag: Java | Nicksxs's Blog + Tag: java | Nicksxs's Blog @@ -510,3 +510,4 @@ +tml> diff --git a/tags/leetcode/index.html b/tags/leetcode/index.html index 43f97aea5e..da229b7595 100644 --- a/tags/leetcode/index.html +++ b/tags/leetcode/index.html @@ -514,7 +514,7 @@ @@ -552,7 +552,7 @@ diff --git a/tags/leetcode/page/2/index.html b/tags/leetcode/page/2/index.html index 23cd77201a..9cb55d1d89 100644 --- a/tags/leetcode/page/2/index.html +++ b/tags/leetcode/page/2/index.html @@ -374,7 +374,7 @@ @@ -412,7 +412,7 @@ diff --git a/tags/mfc/index.html b/tags/mfc/index.html index 3ffb5cf530..8feb4e48fb 100644 --- a/tags/mfc/index.html +++ b/tags/mfc/index.html @@ -351,7 +351,7 @@ @@ -389,7 +389,7 @@ diff --git a/tags/mq/index.html b/tags/mq/index.html index 35bb31cb41..f1e5b72982 100644 --- a/tags/mq/index.html +++ b/tags/mq/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/mysql/index.html b/tags/mysql/index.html index 50b4163240..1084080af2 100644 --- a/tags/mysql/index.html +++ b/tags/mysql/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/nginx/index.html b/tags/nginx/index.html index 5641116996..5ead944780 100644 --- a/tags/nginx/index.html +++ b/tags/nginx/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/openresty/index.html b/tags/openresty/index.html index 1adee970c6..513c49a05c 100644 --- a/tags/openresty/index.html +++ b/tags/openresty/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/php/index.html b/tags/php/index.html index 11e823c286..1b20a7a861 100644 --- a/tags/php/index.html +++ b/tags/php/index.html @@ -351,7 +351,7 @@ @@ -389,7 +389,7 @@ diff --git a/tags/python/index.html b/tags/python/index.html index 528ae667eb..4b359c771c 100644 --- a/tags/python/index.html +++ b/tags/python/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/spark/index.html b/tags/spark/index.html index 6457567834..293845cc30 100644 --- a/tags/spark/index.html +++ b/tags/spark/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/swoole/index.html b/tags/swoole/index.html index 84208fcaca..91a5a2e043 100644 --- a/tags/swoole/index.html +++ b/tags/swoole/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/websocket/index.html b/tags/websocket/index.html index 7a4e2561cc..a16476c01d 100644 --- a/tags/websocket/index.html +++ b/tags/websocket/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/分布式锁/index.html b/tags/分布式锁/index.html index ad30c67e5c..c362345227 100644 --- a/tags/分布式锁/index.html +++ b/tags/分布式锁/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/单例/index.html b/tags/单例/index.html index bbb3b07522..b373528229 100644 --- a/tags/单例/index.html +++ b/tags/单例/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/博客,文章/index.html b/tags/博客,文章/index.html index 636c41b4a1..7fbd5bf23a 100644 --- a/tags/博客,文章/index.html +++ b/tags/博客,文章/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/数据结构/index.html b/tags/数据结构/index.html index fc02f99d8a..891ef6225c 100644 --- a/tags/数据结构/index.html +++ b/tags/数据结构/index.html @@ -235,6 +235,26 @@

2020

+ +
@@ -411,7 +431,7 @@ @@ -449,7 +469,7 @@ diff --git a/tags/源码/index.html b/tags/源码/index.html index 2dd5f72f43..9b47b80f08 100644 --- a/tags/源码/index.html +++ b/tags/源码/index.html @@ -235,6 +235,26 @@

2020

+ +
@@ -411,7 +431,7 @@ @@ -449,7 +469,7 @@ diff --git a/tags/设计模式/index.html b/tags/设计模式/index.html index 81a1577cbf..256c028b8b 100644 --- a/tags/设计模式/index.html +++ b/tags/设计模式/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@ diff --git a/tags/读后感/index.html b/tags/读后感/index.html index 57377166d3..3b8c26482c 100644 --- a/tags/读后感/index.html +++ b/tags/读后感/index.html @@ -328,7 +328,7 @@ @@ -366,7 +366,7 @@