datafolder 1.0.51 → 1.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/ChangeLog.md +2 -0
  2. package/package.json +1 -1
  3. package/scripts/airbnb1.js +80 -0
  4. package/scripts/convertBinFiles.js +3 -1
  5. package/scripts/flights2.js +1 -1
  6. package/src/QyAcl.d.ts +1 -1
  7. package/src/QyAcl.js +31 -33
  8. package/src/QyAclSaver.js +3 -3
  9. package/src/QyAclWriter.d.ts +1 -1
  10. package/src/QyAclWriter.js +2 -2
  11. package/src/QyBatch.d.ts +20 -20
  12. package/src/QyBatch.js +237 -237
  13. package/src/QyBinWriter.d.ts +2 -2
  14. package/src/QyBinWriter.js +2 -2
  15. package/src/QyBinaryHeap.js +2 -2
  16. package/src/QyCD.js +2 -2
  17. package/src/QyCache.d.ts +5 -3
  18. package/src/QyCache.js +136 -135
  19. package/src/QyDB.js +2 -2
  20. package/src/QyDefaultOptions.js +5 -4
  21. package/src/QyDir.js +14 -14
  22. package/src/QyEmbeddingWriter.js +2 -2
  23. package/src/QyEmbeddings.js +2 -2
  24. package/src/QyExpireInfo.js +4 -4
  25. package/src/QyExpireMonitor.js +2 -2
  26. package/src/QyExpireProcessor.js +3 -3
  27. package/src/QyFetch.js +2 -2
  28. package/src/QyFile.js +10 -10
  29. package/src/QyFileLogger.js +10 -10
  30. package/src/QyHNSW.js +6 -6
  31. package/src/QyIndexPropTree.js +2 -2
  32. package/src/QyIntersectNode.js +3 -3
  33. package/src/QyItem.js +2 -2
  34. package/src/QyJsonSaver.js +2 -2
  35. package/src/QyKVData.d.ts +3 -1
  36. package/src/QyKVData.js +72 -57
  37. package/src/QyKVDataCleaner.js +9 -12
  38. package/src/QyKVDataCleaner_Worker.d.ts +1 -4
  39. package/src/QyKVDataCleaner_Worker.js +1 -4
  40. package/src/QyKVDataLoader.js +2 -2
  41. package/src/QyKVDataSaver.js +7 -10
  42. package/src/QyKVDataSaver_Worker.d.ts +1 -4
  43. package/src/QyKVDataSaver_Worker.js +4 -7
  44. package/src/QyLogFileSaver.js +3 -3
  45. package/src/QyMessageWorker.js +2 -2
  46. package/src/QyMessager.d.ts +2 -2
  47. package/src/QyMessager.js +6 -6
  48. package/src/QyMessager_Run.js +1 -1
  49. package/src/QyOpRunner.js +5 -5
  50. package/src/QyQueue.js +2 -2
  51. package/src/QySaver.js +27 -27
  52. package/src/QySnapshotCompactor.js +3 -6
  53. package/src/QySnapshotCompactor_Worker.d.ts +1 -4
  54. package/src/QySnapshotCompactor_Worker.js +23 -25
  55. package/src/QySnapshotMapSaver.d.ts +1 -1
  56. package/src/QySnapshotMapSaver.js +7 -10
  57. package/src/QySnapshotMapSaver_Worker.d.ts +1 -5
  58. package/src/QySnapshotMapSaver_Worker.js +22 -30
  59. package/src/QySnapshotSaver.js +8 -11
  60. package/src/QySnapshotSaver_Worker.d.ts +1 -4
  61. package/src/QySnapshotSaver_Worker.js +16 -18
  62. package/src/QySnapshots.d.ts +3 -2
  63. package/src/QySnapshots.js +227 -221
  64. package/src/QyTrigger.js +5 -5
  65. package/src/QyUnionNode.js +3 -3
  66. package/static/datafolderui/QyStyledElement.js +2 -2
  67. package/static/datafolderui/QyUIFolderViewer.js +2 -2
@@ -23,7 +23,7 @@ import {
23
23
  QyEmbeddingWriter as s
24
24
  } from "./QyEmbeddingWriter.js";
25
25
 
26
- class QyEmbeddings {
26
+ class e {
27
27
  embeddingFolder;
28
28
  options;
29
29
  qyEmbeddingWriterMap = new Map();
@@ -115,5 +115,5 @@ function g(t, i) {
115
115
  }
116
116
 
117
117
  export {
118
- QyEmbeddings
118
+ e as QyEmbeddings
119
119
  };
@@ -1,4 +1,4 @@
1
- class QyExpireInfo {
1
+ class e {
2
2
  hashPropTimeMap = new Map();
3
3
  secondTimeHashPropMap = new Map();
4
4
  get isEmpty() {
@@ -80,12 +80,12 @@ function z(e) {
80
80
  return Math.floor(e / 1e3);
81
81
  }
82
82
 
83
- function e(e) {
83
+ function t(e) {
84
84
  return e % 1e3;
85
85
  }
86
86
 
87
87
  export {
88
- QyExpireInfo,
88
+ e as QyExpireInfo,
89
89
  z as getSecond,
90
- e as getSecondM
90
+ t as getSecondM
91
91
  };
@@ -14,7 +14,7 @@ import {
14
14
  QyExpireProcessor as i
15
15
  } from "./QyExpireProcessor.js";
16
16
 
17
- class QyExpireMonitor {
17
+ class e {
18
18
  qyCache;
19
19
  monitoringMap = new Map();
20
20
  roundedStartTime = 0;
@@ -94,6 +94,6 @@ function p(e) {
94
94
  }
95
95
 
96
96
  export {
97
- QyExpireMonitor,
97
+ e as QyExpireMonitor,
98
98
  a as handleExpiredProps
99
99
  };
@@ -10,15 +10,15 @@ import {
10
10
  QyExpireProcessor_Worker as o
11
11
  } from "./QyExpireProcessor_Worker.js";
12
12
 
13
- class QyExpireProcessor extends r {
13
+ class s extends r {
14
14
  constructor(r, s) {
15
15
  s = {
16
16
  ...e("QyExpireProcessor"),
17
17
  ...s
18
- }, super(o, s, s, r);
18
+ }, super(o, [], s, r);
19
19
  }
20
20
  }
21
21
 
22
22
  export {
23
- QyExpireProcessor
23
+ s as QyExpireProcessor
24
24
  };
package/src/QyFetch.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  QyCD as r
3
3
  } from "./QyCD.js";
4
4
 
5
- class QyFetch extends r {
5
+ class e extends r {
6
6
  stack = [];
7
7
  constructor(r) {
8
8
  super(r);
@@ -18,5 +18,5 @@ class QyFetch extends r {
18
18
  }
19
19
 
20
20
  export {
21
- QyFetch
21
+ e as QyFetch
22
22
  };
package/src/QyFile.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  handleExpiredProps as c
29
29
  } from "./QyExpireMonitor.js";
30
30
 
31
- class QyFile extends e {
31
+ class p extends e {
32
32
  _fileContentKey;
33
33
  _fileContent;
34
34
  cChangeId = 0;
@@ -115,7 +115,7 @@ class QyFile extends e {
115
115
  if (void 0 === r) return;
116
116
  if (f(r)) return r ? s ? n : structuredClone(n) : void 0;
117
117
  let e = r.$link;
118
- if (void 0 !== e) return g(i, n, e, r.$spec);
118
+ if (void 0 !== e) return v(i, n, e, r.$spec);
119
119
  if (f(n)) return n;
120
120
  C(r) && (r = Object.fromEntries(r.filter(e => e).map(e => [ e, 1 ])));
121
121
  let o = C(n) ? [] : new Object();
@@ -135,7 +135,7 @@ class QyFile extends e {
135
135
  }
136
136
  prop(e, t = "$clone", i) {
137
137
  var n;
138
- if (t) return e = h(this.fileContent, C(e) ? e : [ e ]), n = t.$link, void 0 !== n ? g(this, e, n, t.$spec, i) : i || "$raw" === t ? e : structuredClone(e);
138
+ if (t) return e = h(this.fileContent, C(e) ? e : [ e ]), n = t.$link, void 0 !== n ? v(this, e, n, t.$spec, i) : i || "$raw" === t ? e : structuredClone(e);
139
139
  }
140
140
  unloadFileContent() {
141
141
  this.created && this.fileContentLoaded && void 0 !== this._fileContent && (this._fileContent = void 0,
@@ -145,7 +145,7 @@ class QyFile extends e {
145
145
  if (this.created && void 0 === this._fileContent && !this.fileContentLoaded) {
146
146
  this.fileContentLoaded = !0;
147
147
  var e = this.qyCache;
148
- if (void 0 !== e && (this._fileContent = e.qyKVData.getValueSync(this.fileContentKey),
148
+ if (void 0 !== e && (this._fileContent = e.getValueSync(this.fileContentKey),
149
149
  !this.underHiddenDir)) {
150
150
  var t, i, n = this;
151
151
  n.cExpireChecked || (n.cExpireChecked = !0, void 0 !== (t = e.getInfoFile(n)?.fileContent?.cExpire) && ([ t, i ] = ((e, t = d()) => {
@@ -168,7 +168,7 @@ class QyFile extends e {
168
168
  }
169
169
  }
170
170
 
171
- function p(e, t, i, n) {
171
+ function g(e, t, i, n) {
172
172
  if (void 0 !== e) {
173
173
  e = e.getFile(t);
174
174
  if (void 0 !== e) return e.view(i, n);
@@ -176,17 +176,17 @@ function p(e, t, i, n) {
176
176
  return t;
177
177
  }
178
178
 
179
- function g(e, t, i, n, r = !1) {
179
+ function v(e, t, i, n, r = !1) {
180
180
  let s = e.qyCache.getDir(i);
181
- if (C(t)) return t.map(e => p(s, e, n, r));
181
+ if (C(t)) return t.map(e => g(s, e, n, r));
182
182
  if (l(t)) {
183
183
  var o, a = new Object();
184
- for (o in t) a[o] = p(s, o, n, r);
184
+ for (o in t) a[o] = g(s, o, n, r);
185
185
  return a;
186
186
  }
187
- return p(s, t, n, r);
187
+ return g(s, t, n, r);
188
188
  }
189
189
 
190
190
  export {
191
- QyFile
191
+ p as QyFile
192
192
  };
@@ -22,7 +22,7 @@ import {
22
22
  logger as o
23
23
  } from "./QyLogger.js";
24
24
 
25
- class QyFileLogger extends t {
25
+ class r extends t {
26
26
  logFileFolder;
27
27
  dateDirPath;
28
28
  timeoutRef;
@@ -40,13 +40,13 @@ class QyFileLogger extends t {
40
40
  return this.dateDirPath;
41
41
  }
42
42
  async _op_start() {
43
- var t = new Date(), t = (this.timeoutRef = setTimeout(this.switch.bind(this), n(t)),
44
- this.dateDirPath = r(this, t));
43
+ var t = new Date(), t = (this.timeoutRef = setTimeout(this.switch.bind(this), h(t)),
44
+ this.dateDirPath = l(this, t));
45
45
  this.qyLogFileSaver.call_start(a(t, "change.txt")), await this.startFileConsole(t);
46
46
  }
47
47
  switch() {
48
- var t = new Date(), t = (this.timeoutRef = setTimeout(this.switch.bind(this), n(t)),
49
- r(this, t));
48
+ var t = new Date(), t = (this.timeoutRef = setTimeout(this.switch.bind(this), h(t)),
49
+ l(this, t));
50
50
  return this.dateDirPath !== t && (this.dateDirPath = t, this.qyLogFileSaver.cast_switch(a(t, "change.txt")),
51
51
  this.switchFileConsole(t)), this;
52
52
  }
@@ -62,19 +62,19 @@ class QyFileLogger extends t {
62
62
  }
63
63
  }
64
64
 
65
- function r(t, e) {
65
+ function l(t, e) {
66
66
  var i = e.getUTCFullYear(), s = e.getUTCMonth() + 1, o = e.getUTCDate(), e = e.getUTCHours();
67
- return a(t.logFileFolder, i.toString(), l(s), l(o), l(e));
67
+ return a(t.logFileFolder, i.toString(), n(s), n(o), n(e));
68
68
  }
69
69
 
70
- function l(t) {
70
+ function n(t) {
71
71
  return t.toString().padStart(2, "0");
72
72
  }
73
73
 
74
- function n(t) {
74
+ function h(t) {
75
75
  return 1e3 * (60 * (60 - t.getUTCMinutes()) - t.getUTCSeconds());
76
76
  }
77
77
 
78
78
  export {
79
- QyFileLogger
79
+ r as QyFileLogger
80
80
  };
package/src/QyHNSW.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./QyBinaryHeap.js";
2
2
 
3
- class QyHNSW {
3
+ class t {
4
4
  probs;
5
5
  constructor(t) {
6
6
  this.probs = (t => {
@@ -29,11 +29,11 @@ function e(r, e = r) {
29
29
  return a;
30
30
  }
31
31
 
32
- function t(t, r) {
32
+ function r(t, r) {
33
33
  return e(t, r) / (Math.sqrt(e(t)) * Math.sqrt(e(r)));
34
34
  }
35
35
 
36
- function r(t, r) {
36
+ function n(t, r) {
37
37
  return 1 / (1 + ((r, e) => {
38
38
  var n = r.length;
39
39
  let a = 0;
@@ -43,7 +43,7 @@ function r(t, r) {
43
43
  }
44
44
 
45
45
  export {
46
- QyHNSW,
47
- t as cosineSimilarity,
48
- r as euclideanSimilarity
46
+ t as QyHNSW,
47
+ r as cosineSimilarity,
48
+ n as euclideanSimilarity
49
49
  };
@@ -73,7 +73,7 @@ function u(e) {
73
73
  return void 0 !== e && void 0 !== (e.$gt ?? e.$lt ?? e.$gte ?? e.$lte);
74
74
  }
75
75
 
76
- class QyIndexPropTree {
76
+ class e {
77
77
  rootNode = new o();
78
78
  changeCount = 0;
79
79
  _allLeafNodes = [];
@@ -128,5 +128,5 @@ class QyIndexPropTree {
128
128
 
129
129
  export {
130
130
  u as isCmpObj,
131
- QyIndexPropTree
131
+ e as QyIndexPropTree
132
132
  };
@@ -2,7 +2,7 @@ import {
2
2
  QyQueryNode as n
3
3
  } from "./QyUnionNode.js";
4
4
 
5
- class QyIntersectNode extends n {
5
+ class i extends n {
6
6
  sorted = !1;
7
7
  constructor() {
8
8
  super(), this.indexCount = -1;
@@ -30,7 +30,7 @@ class QyIntersectNode extends n {
30
30
  void 0 === n || -1 === n.indexCount || ({
31
31
  indexCount: t,
32
32
  nodeList: e
33
- } = this, 0 === t && 0 < e.length) || (n instanceof QyIntersectNode ? e.push(...n.nodeList) : e.push(n),
33
+ } = this, 0 === t && 0 < e.length) || (n instanceof i ? e.push(...n.nodeList) : e.push(n),
34
34
  this.sorted = !1, (-1 === t || t > n.indexCount) && (this.indexCount = n.indexCount));
35
35
  }
36
36
  }
@@ -48,5 +48,5 @@ function r(t, e) {
48
48
  }
49
49
 
50
50
  export {
51
- QyIntersectNode
51
+ i as QyIntersectNode
52
52
  };
package/src/QyItem.js CHANGED
@@ -9,7 +9,7 @@ var a = 4, r = 8, s = 16;
9
9
 
10
10
  var n = 64, h = 128, m = 256;
11
11
 
12
- class QyItem {
12
+ class l {
13
13
  name;
14
14
  parentDir;
15
15
  flagInt = 0;
@@ -91,5 +91,5 @@ export {
91
91
  n as Flag_DExpireChecked,
92
92
  h as Flag_FExpireChecked,
93
93
  m as Flag_CExpireChecked,
94
- QyItem
94
+ l as QyItem
95
95
  };
@@ -6,7 +6,7 @@ import {
6
6
  QySaver as e
7
7
  } from "./QySaver.js";
8
8
 
9
- class QyJsonSaver extends e {
9
+ class r extends e {
10
10
  constructor(e, r = void 0) {
11
11
  super(e, {
12
12
  ...s("QyJsonSaver"),
@@ -22,5 +22,5 @@ class QyJsonSaver extends e {
22
22
  }
23
23
 
24
24
  export {
25
- QyJsonSaver
25
+ r as QyJsonSaver
26
26
  };
package/src/QyKVData.d.ts CHANGED
@@ -12,6 +12,7 @@ export declare class QyKVData {
12
12
  compactMaxChangeId: number;
13
13
  snapshotSavedChangeId: number;
14
14
  maxChangeId: number;
15
+ loadedMaxAclNum: number;
15
16
  emptySnapshotNumVerList: any[];
16
17
  isStopping: boolean;
17
18
  unloadingMemory: boolean;
@@ -24,7 +25,8 @@ export declare class QyKVData {
24
25
  qyKVDataCleaner: QyKVDataCleaner;
25
26
  qyExpireMonitor: QyExpireMonitor;
26
27
  constructor(kvFolder: any, options?: any, qyCache?: any);
27
- start(maxChangeId: any, loadedMaxAclNum: any, qySnapshots: any, keyValueMap: any): this;
28
+ load(): Promise<void>;
29
+ start(): this;
28
30
  stop(): Promise<void>;
29
31
  save(changeId: any, cmdArgAsListArray: any, syncList: any, needPromise: any): any;
30
32
  increaseChangeId(): number;
package/src/QyKVData.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "node:path";
4
4
 
5
5
  import {
6
- open as y
6
+ open as v
7
7
  } from "node:fs/promises";
8
8
 
9
9
  import {
@@ -24,7 +24,7 @@ import {
24
24
 
25
25
  import {
26
26
  readBufferAsync as S,
27
- sleep as c
27
+ sleep as l
28
28
  } from "./QyUtils.js";
29
29
 
30
30
  import {
@@ -36,10 +36,14 @@ import {
36
36
  } from "./QyExpireMonitor.js";
37
37
 
38
38
  import {
39
- getPMFilePath as C
39
+ getPMFilePath as M
40
40
  } from "./QySnapshots.js";
41
41
 
42
- class QyKVData {
42
+ import {
43
+ QyKVDataLoader as c
44
+ } from "./QyKVDataLoader.js";
45
+
46
+ class t {
43
47
  kvFolder;
44
48
  snapshotFolder;
45
49
  qyCache;
@@ -48,6 +52,7 @@ class QyKVData {
48
52
  compactMaxChangeId = 0;
49
53
  snapshotSavedChangeId = 0;
50
54
  maxChangeId = 0;
55
+ loadedMaxAclNum = 0;
51
56
  emptySnapshotNumVerList = [];
52
57
  isStopping = !1;
53
58
  unloadingMemory = !1;
@@ -69,20 +74,30 @@ class QyKVData {
69
74
  this.qyKVDataSaver = new r(this, t, a), this.qySnapshotCompactor = new i(this, t, a),
70
75
  this.qyKVDataCleaner = new p(this, t, a), this.qyExpireMonitor = new h(o, a);
71
76
  }
72
- start(t, a, o, e) {
77
+ async load() {
73
78
  var {
79
+ kvFolder: t,
80
+ options: a
81
+ } = this, [ t, a, o, e ] = await new c(t, a).load();
82
+ this.maxChangeId = t, this.qySnapshots = o, this.keyValueMap = e, this.loadedMaxAclNum = a;
83
+ }
84
+ start() {
85
+ var {
86
+ maxChangeId: t,
87
+ loadedMaxAclNum: a,
88
+ qySnapshots: o,
89
+ keyValueMap: e,
74
90
  options: s,
75
91
  qyKVDataSaver: n,
76
92
  qySnapshotCompactor: r,
77
93
  qyKVDataCleaner: i,
78
94
  qyExpireMonitor: p
79
95
  } = this, {
80
- maxSnapshotNum: h,
81
- snapshotMaxChangeId: l
96
+ maxSnapshotNum: o,
97
+ snapshotMaxChangeId: h
82
98
  } = o;
83
- return n.call_start(t, h, a, e), r.call_start(), i.call_start(), p.start(),
84
- this.maxChangeId = t, this.snapshotSavedChangeId = l, this.qySnapshots = o,
85
- this.keyValueMap = e, this.compactInterval = setInterval(() => d(this), s.compactSnapshotsInterval),
99
+ return n.call_start(t, o, a, e), r.call_start(), i.call_start(), p.start(),
100
+ this.snapshotSavedChangeId = h, this.compactInterval = setInterval(() => m(this), s.compactSnapshotsInterval),
86
101
  this.unloadInterval = setInterval(() => (async o => {
87
102
  if (!o.unloadingMemory) {
88
103
  o.unloadingMemory = !0;
@@ -93,9 +108,9 @@ class QyKVData {
93
108
  let t = 0, a = 0;
94
109
  if (e) {
95
110
  var n, r = s.maxFileCountToUnload, s = e.rootDir;
96
- a = m(o, s), t = a;
97
- for (n of s.allLoadedSubdirs()) if ((a += m(o, n)) > r && (t += a,
98
- a = 0, await c(0), o.isStopping)) break;
111
+ a = u(o, s), t = a;
112
+ for (n of s.allLoadedSubdirs()) if ((a += u(o, n)) > r && (t += a,
113
+ a = 0, await l(0), o.isStopping)) break;
99
114
  }
100
115
  t += a, global.gc && global.gc(), o.unloadingMemory = !1;
101
116
  }
@@ -116,30 +131,30 @@ class QyKVData {
116
131
  let u = m.get(i);
117
132
  if (void 0 === u) return void (c && c.close());
118
133
  let {
119
- info: f,
120
- prefixPM: v
134
+ info: y,
135
+ prefixPM: f
121
136
  } = u;
122
- void 0 === p && (p = v.keys().toArray().sort().reverse());
137
+ void 0 === p && (p = f.keys().toArray().sort().reverse());
123
138
  if (0 === p.length) return void (c && c.close());
124
- if (void 0 === h || h !== f.pMVersion) return c && c.close(),
125
- l = C(t, u.snapshotNum, f.pMVersion), n(r, i, p, f.pMVersion, l, await y(l));
139
+ if (void 0 === h || h !== y.pMVersion) return c && c.close(),
140
+ l = M(t, u.snapshotNum, y.pMVersion), n(r, i, p, y.pMVersion, l, await v(l));
126
141
  for (;0 < p.length; ) {
127
- let e = p.at(-1), s = v.get(e);
142
+ let e = p.at(-1), s = f.get(e);
128
143
  if (s) {
129
144
  let [ t, a ] = s, o = await S(l, c, t, a);
130
145
  if (r.isStopping || void 0 === m.get(i)) return void c.close();
131
- if (h !== f.pMVersion) return c.close(), n(r, i, p);
132
- v.has(e) && d.loadPartialPosMapBuffer(u, e, o);
146
+ if (h !== y.pMVersion) return c.close(), n(r, i, p);
147
+ f.has(e) && d.loadPartialPosMapBuffer(u, e, o);
133
148
  }
134
149
  p.pop();
135
150
  }
136
151
  c.close();
137
152
  g.info("bgLoadPosMap:" + i);
138
153
  }(t, a), t.isStopping) break;
139
- if (await c(0), t.isStopping) break;
154
+ if (await l(0), t.isStopping) break;
140
155
  }
141
- console.timeEnd("bgLoadPosMaps"), !t.isStopping && e.compactAtStart && d(t);
142
- })(this) : s.compactAtStart && d(this), this;
156
+ console.timeEnd("bgLoadPosMaps"), !t.isStopping && e.compactAtStart && m(t);
157
+ })(this) : s.compactAtStart && m(this), this;
143
158
  }
144
159
  async stop() {
145
160
  this.isStopping = !0;
@@ -152,7 +167,7 @@ class QyKVData {
152
167
  qyKVDataCleaner: n,
153
168
  qyExpireMonitor: r
154
169
  } = this;
155
- clearInterval(e), clearInterval(s), await r.stop(), l(this, await t.call_stop()),
170
+ clearInterval(e), clearInterval(s), await r.stop(), d(this, await t.call_stop()),
156
171
  o && o.closeAllFDs(), await a.call_stop(), await n.call_stop();
157
172
  }
158
173
  save(t, a, o, e) {
@@ -182,7 +197,7 @@ class QyKVData {
182
197
  o.set(t, void 0);
183
198
  }
184
199
  _on_snapshotSavedChangeId(t, a) {
185
- l(this, t, a);
200
+ d(this, t, a);
186
201
  }
187
202
  _on_compactUpdates(c) {
188
203
  if (2 === this.compactState) {
@@ -197,28 +212,28 @@ class QyKVData {
197
212
  } = s;
198
213
  ++r.pMVersion, r.verList[0] = r.pMVersion + r.vLVersion;
199
214
  for (e of n.keys()) n.set(e, a.get(e));
200
- r.outdatedCount += i, s.outdatedCount -= i, s.compactOutedCount = 0;
215
+ r.outdatedCount += i, s.curOutdatedCount -= i, s.compactOutedCount = 0;
201
216
  }
202
217
  }
203
218
  if (t) {
204
219
  var p = (c = d).qySnapshots.numToSnapshotMap;
205
- for ([ g, v ] of t) {
220
+ for ([ g, f ] of t) {
206
221
  var h, l, {
207
222
  posMap: u,
208
- prefixPM: f
209
- } = v, v = p.get(g), {
210
- posMap: y,
223
+ prefixPM: y
224
+ } = f, f = p.get(g), {
225
+ posMap: v,
211
226
  prefixPM: S,
212
227
  info: g
213
- } = v;
228
+ } = f;
214
229
  ++g.pMVersion, ++g.vLVersion, g.verList[0] = g.pMVersion + g.vLVersion;
215
- for (h of y.keys()) y.set(h, u.get(h));
216
- for (l of S.keys()) S.set(l, f.get(l));
217
- V(v);
230
+ for (h of v.keys()) v.set(h, u.get(h));
231
+ for (l of S.keys()) S.set(l, y.get(l));
232
+ x(f);
218
233
  }
219
234
  }
220
235
  if (m) {
221
- var C, c = m;
236
+ var M, c = m;
222
237
  let e = d.qySnapshots, {
223
238
  numToSnapshotMap: s,
224
239
  keyToSnapshotMap: n
@@ -231,21 +246,21 @@ class QyKVData {
231
246
  info: o
232
247
  } = i;
233
248
  ++o.pMVersion, ++o.vLVersion, o.verList[0] = o.pMVersion + o.vLVersion;
234
- for (C of p.keys()) p.set(C, r.get(C));
235
- V(i);
236
- let h = o.totalCount, l = i.outdatedCount;
249
+ for (M of p.keys()) p.set(M, r.get(M));
250
+ x(i);
251
+ let h = o.totalCount, l = i.curOutdatedCount;
237
252
  for (let [ o ] of a) {
238
- var M, q = s.get(o);
253
+ var C, V = s.get(o);
239
254
  let {
240
255
  posMap: t,
241
256
  info: a
242
- } = q;
243
- for (M of t.keys()) p.set(M, r.get(M)), n.set(M, i);
244
- V(q), h += a.totalCount, l += q.outdatedCount, e.delSnapshot(q);
257
+ } = V;
258
+ for (C of t.keys()) p.set(C, r.get(C)), n.set(C, i);
259
+ x(V), h += a.totalCount, l += V.curOutdatedCount, e.delSnapshot(V);
245
260
  }
246
- o.totalCount = h, i.outdatedCount = l;
261
+ o.totalCount = h, i.curOutdatedCount = l;
247
262
  }
248
- this.snapshotSavedChangeId >= this.compactMaxChangeId ? (x(this), this.compactState = 1) : this.compactState = 3;
263
+ this.snapshotSavedChangeId >= this.compactMaxChangeId ? (q(this), this.compactState = 1) : this.compactState = 3;
249
264
  }
250
265
  }
251
266
  monitorContentExpire(t, a) {
@@ -262,14 +277,14 @@ class QyKVData {
262
277
  }
263
278
  }
264
279
 
265
- function l(t, a, o = void 0) {
280
+ function d(t, a, o = void 0) {
266
281
  t.snapshotSavedChangeId = a;
267
282
  var {
268
283
  compactState: e,
269
284
  compactMaxChangeId: s,
270
285
  qyKVDataSaver: n
271
286
  } = t;
272
- if (3 === e && s <= a && (x(t), t.compactState = 1), o) {
287
+ if (3 === e && s <= a && (q(t), t.compactState = 1), o) {
273
288
  var r, e = o, i = t.qySnapshots, p = i.keyToSnapshotMap;
274
289
  for (r of e.posMap.keys()) {
275
290
  var h = p.get(r);
@@ -280,16 +295,16 @@ function l(t, a, o = void 0) {
280
295
  }
281
296
  }
282
297
 
283
- function V(t) {
298
+ function x(t) {
284
299
  var {
285
300
  info: a,
286
301
  compactOutedCount: o
287
302
  } = t;
288
- a.totalCount -= a.outdatedCount + o, a.outdatedCount = 0, t.outdatedCount -= o,
303
+ a.totalCount -= a.outdatedCount + o, a.outdatedCount = 0, t.curOutdatedCount -= o,
289
304
  t.compactOutedCount = 0;
290
305
  }
291
306
 
292
- function d(t) {
307
+ function m(t) {
293
308
  if (1 === t.compactState) {
294
309
  var {
295
310
  maxChangeId: a,
@@ -298,22 +313,22 @@ function d(t) {
298
313
  } = t, [ o, s, n, r ] = o.calOutdates();
299
314
  if (0 < s.length || 0 < n.length || 0 < r.length) {
300
315
  t.compactState = 2, t.compactMaxChangeId = a;
301
- for (var i of [ n, r, s ]) for (var p of i) p.compactOutedCount = p.outdatedCount;
316
+ for (var i of [ n, r, s ]) for (var p of i) p.compactOutedCount = p.curOutdatedCount;
302
317
  e.cast_compactSnapshots(n, r, s);
303
318
  }
304
- 0 < o.length && (t.emptySnapshotNumVerList.push(...o), t.snapshotSavedChangeId >= a ? u(t) : 1 === t.compactState && (t.compactState = 3,
319
+ 0 < o.length && (t.emptySnapshotNumVerList.push(...o), t.snapshotSavedChangeId >= a ? y(t) : 1 === t.compactState && (t.compactState = 3,
305
320
  t.compactMaxChangeId = a));
306
321
  }
307
322
  }
308
323
 
309
- function m(t, a) {
324
+ function u(t, a) {
310
325
  var o = t.qySnapshots.snapshotMaxChangeId;
311
326
  let e = 0;
312
327
  if (a.fileMapLoaded) for (var s of a.fileList) ++e, s.cChangeId <= o && (s.visited ? s.visited = !1 : s.unloadFileContent());
313
328
  return e;
314
329
  }
315
330
 
316
- function u(t) {
331
+ function y(t) {
317
332
  var {
318
333
  qyKVDataCleaner: t,
319
334
  emptySnapshotNumVerList: a
@@ -321,10 +336,10 @@ function u(t) {
321
336
  0 < a.length && (t.cast_removeSnapshotsFiles(a), a.length = 0);
322
337
  }
323
338
 
324
- function x(t) {
325
- t.qySnapshotCompactor.cast_saveSnapshotInfos(), u(t);
339
+ function q(t) {
340
+ t.qySnapshotCompactor.cast_saveSnapshotInfos(), y(t);
326
341
  }
327
342
 
328
343
  export {
329
- QyKVData
344
+ t as QyKVData
330
345
  };
@@ -3,25 +3,22 @@ import {
3
3
  } from "./QyMessager.js";
4
4
 
5
5
  import {
6
- getDefaultOptions as a
6
+ getDefaultOptions as s
7
7
  } from "./QyDefaultOptions.js";
8
8
 
9
9
  import {
10
- QyKVDataCleaner_Worker as o
10
+ QyKVDataCleaner_Worker as t
11
11
  } from "./QyKVDataCleaner_Worker.js";
12
12
 
13
- class QyKVDataCleaner extends e {
14
- constructor(e, r, s) {
15
- s = {
16
- ...a("QyKVDataCleaner"),
17
- ...s
18
- }, super(o, {
19
- kvFolder: r,
20
- options: s
21
- }, s, e);
13
+ class r extends e {
14
+ constructor(e, r, a) {
15
+ a = {
16
+ ...s("QyKVDataCleaner"),
17
+ ...a
18
+ }, super(t, [ r ], a, e);
22
19
  }
23
20
  }
24
21
 
25
22
  export {
26
- QyKVDataCleaner
23
+ r as QyKVDataCleaner
27
24
  };