typedefstructquicklist { quicklistNode *head; quicklistNode *tail; unsignedlong count; /* total count of all entries in all ziplists */ unsignedlong len; /* number of quicklistNodes */ int fill : QL_FILL_BITS; /* fill factor for individual nodes */ unsignedint compress : QL_COMP_BITS; /* depth of end nodes not to compress;0=off */ unsignedint bookmark_count: QL_BM_BITS; quicklistBookmark bookmarks[]; } quicklist;
head/tail 首尾节点
count,quicklist Node的个数
fill
正数表示ziplist的最大数据项数
负数
1 2 3 4 5 6 7 8 9 10 11 12
typedefstructquicklistNode { structquicklistNode *prev; structquicklistNode *next; unsignedchar *zl; unsignedint sz; /* ziplist size in bytes */ unsignedint count : 16; /* count of items in ziplist */ unsignedint encoding : 2; /* RAW==1 or LZF==2 */ unsignedint container : 2; /* NONE==1 or ZIPLIST==2 */ unsignedint recompress : 1; /* was this node previous compressed? */ unsignedint attempted_compress : 1; /* node can't compress; too small */ unsignedint extra : 10; /* more bits to steal for future usage */ } quicklistNode;