dataply 0.0.24-alpha.8 → 0.0.24-alpha.9
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.
package/dist/cjs/index.js
CHANGED
|
@@ -1650,7 +1650,7 @@ var BPTreeTransaction = class _BPTreeTransaction {
|
|
|
1650
1650
|
},
|
|
1651
1651
|
primaryGt: {
|
|
1652
1652
|
asc: {
|
|
1653
|
-
start: (tx, v) => tx.
|
|
1653
|
+
start: (tx, v) => tx.insertableRightestEndNodeByPrimary(v[0]),
|
|
1654
1654
|
end: () => null,
|
|
1655
1655
|
direction: 1,
|
|
1656
1656
|
earlyTerminate: false
|
|
@@ -2189,7 +2189,7 @@ var BPTreeSyncTransaction = class extends BPTreeTransaction {
|
|
|
2189
2189
|
return this.getNode(node.next);
|
|
2190
2190
|
}
|
|
2191
2191
|
insertableEndNode(value, direction) {
|
|
2192
|
-
const insertableNode = this.
|
|
2192
|
+
const insertableNode = direction === -1 ? this.insertableNodeByPrimary(value) : this.insertableRightestNodeByPrimary(value);
|
|
2193
2193
|
let key;
|
|
2194
2194
|
switch (direction) {
|
|
2195
2195
|
case -1:
|
|
@@ -3317,7 +3317,7 @@ var BPTreeAsyncTransaction = class extends BPTreeTransaction {
|
|
|
3317
3317
|
return await this.getNode(node.next);
|
|
3318
3318
|
}
|
|
3319
3319
|
async insertableEndNode(value, direction) {
|
|
3320
|
-
const insertableNode = await this.
|
|
3320
|
+
const insertableNode = direction === -1 ? await this.insertableNodeByPrimary(value) : await this.insertableRightestNodeByPrimary(value);
|
|
3321
3321
|
let key;
|
|
3322
3322
|
switch (direction) {
|
|
3323
3323
|
case -1:
|
|
@@ -8203,6 +8203,22 @@ var PageMVCCStrategy = class {
|
|
|
8203
8203
|
this.dirtyPages.delete(pageId);
|
|
8204
8204
|
}
|
|
8205
8205
|
}
|
|
8206
|
+
/**
|
|
8207
|
+
* 지정된 페이지들만 디스크에 기록합니다.
|
|
8208
|
+
* WAL 없이 트랜잭션 커밋 시, 해당 트랜잭션의 dirty pages만 선택적으로 flush합니다.
|
|
8209
|
+
* @param pages 기록할 페이지 맵 (PageID -> PageData)
|
|
8210
|
+
*/
|
|
8211
|
+
async flushPages(pages) {
|
|
8212
|
+
if (pages.size === 0) {
|
|
8213
|
+
return;
|
|
8214
|
+
}
|
|
8215
|
+
const sortedPageIds = Array.from(pages.keys()).sort((a, b) => a - b);
|
|
8216
|
+
for (const pageId of sortedPageIds) {
|
|
8217
|
+
const data = pages.get(pageId);
|
|
8218
|
+
const position = pageId * this.pageSize;
|
|
8219
|
+
await this._writeToDisk(data, position);
|
|
8220
|
+
}
|
|
8221
|
+
}
|
|
8206
8222
|
/**
|
|
8207
8223
|
* 메인 DB 파일의 물리적 동기화를 수행합니다 (fsync).
|
|
8208
8224
|
*/
|
|
@@ -9578,7 +9594,9 @@ var Transaction = class {
|
|
|
9578
9594
|
for (const [pageId, data] of this.dirtyPages) {
|
|
9579
9595
|
await this.pageStrategy.write(pageId, data);
|
|
9580
9596
|
}
|
|
9581
|
-
if (this.pfs.wal) {
|
|
9597
|
+
if (!this.pfs.wal) {
|
|
9598
|
+
await this.pfs.strategy.flushPages(this.dirtyPages);
|
|
9599
|
+
} else {
|
|
9582
9600
|
this.pfs.wal.incrementWrittenPages(this.dirtyPages.size);
|
|
9583
9601
|
if (this.pfs.wal.shouldCheckpoint(this.pfs.options.walCheckpointThreshold)) {
|
|
9584
9602
|
shouldTriggerCheckpoint = true;
|
|
@@ -33,6 +33,12 @@ export declare class PageMVCCStrategy {
|
|
|
33
33
|
* WAL 체크포인트 시점에 호출되어야 합니다.
|
|
34
34
|
*/
|
|
35
35
|
flush(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* 지정된 페이지들만 디스크에 기록합니다.
|
|
38
|
+
* WAL 없이 트랜잭션 커밋 시, 해당 트랜잭션의 dirty pages만 선택적으로 flush합니다.
|
|
39
|
+
* @param pages 기록할 페이지 맵 (PageID -> PageData)
|
|
40
|
+
*/
|
|
41
|
+
flushPages(pages: Map<number, Uint8Array>): Promise<void>;
|
|
36
42
|
/**
|
|
37
43
|
* 메인 DB 파일의 물리적 동기화를 수행합니다 (fsync).
|
|
38
44
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dataply",
|
|
3
|
-
"version": "0.0.24-alpha.
|
|
3
|
+
"version": "0.0.24-alpha.9",
|
|
4
4
|
"description": "A lightweight storage engine for Node.js with support for MVCC, WAL.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "izure <admin@izure.org>",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"hookall": "^2.2.0",
|
|
50
50
|
"mvcc-api": "^1.3.4",
|
|
51
51
|
"ryoiki": "^1.2.0",
|
|
52
|
-
"serializable-bptree": "^8.3.
|
|
52
|
+
"serializable-bptree": "^8.3.3"
|
|
53
53
|
}
|
|
54
54
|
}
|