sliftutils 1.7.121 → 1.7.122
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/treeSummary.ts.cache +2 -2
- package/index.d.ts +74 -7
- package/misc/dist/environment.ts.cache +2 -2
- package/misc/dist/getSecret.ts.cache +2 -2
- package/misc/dist/strings.ts.cache +2 -2
- package/misc/dist/zip.ts.cache +2 -2
- package/misc/https/dist/certs.ts.cache +2 -2
- package/misc/https/dist/persistentLocalStorage.ts.cache +2 -2
- package/package.json +2 -2
- package/render-utils/dist/observer.tsx.cache +2 -2
- package/storage/BulkDatabase2/BulkDatabase2.d.ts +14 -2
- package/storage/BulkDatabase2/BulkDatabase2.ts +15 -2
- package/storage/BulkDatabase2/BulkDatabaseBase.d.ts +57 -5
- package/storage/BulkDatabase2/BulkDatabaseBase.ts +288 -137
- package/storage/BulkDatabase2/LoadedIndex.d.ts +1 -0
- package/storage/BulkDatabase2/LoadedIndex.ts +2 -1
- package/storage/BulkDatabase2/blockCache.ts +6 -1
- package/storage/BulkDatabase2/dist/BulkDatabaseBase.ts.cache +257 -162
- package/storage/BulkDatabase2/dist/LoadedIndex.ts.cache +2 -2
- package/storage/BulkDatabase2/dist/blockCache.ts.cache +8 -3
- package/storage/BulkDatabase2/dist/syncClient.ts.cache +30 -4
- package/storage/BulkDatabase2/syncClient.d.ts +2 -0
- package/storage/BulkDatabase2/syncClient.ts +27 -2
- package/storage/PrivateFileSystemStorage.ts +43 -6
- package/storage/dist/ArchivesDisk.ts.cache +2 -2
- package/storage/dist/FileFolderAPI.tsx.cache +2 -2
- package/storage/dist/IArchives.ts.cache +2 -2
- package/storage/dist/IndexedDBFileFolderAPI.ts.cache +2 -2
- package/storage/dist/JSONStorage.ts.cache +2 -2
- package/storage/dist/PendingManager.tsx.cache +2 -2
- package/storage/dist/PrivateFileSystemStorage.ts.cache +43 -8
- package/storage/dist/StreamingLogs.ts.cache +2 -2
- package/storage/dist/TransactionFile.ts.cache +2 -2
- package/storage/dist/TransactionStorage.ts.cache +2 -2
- package/storage/dist/backblaze.ts.cache +2 -2
- package/storage/dist/fileSystemPointer.ts.cache +2 -2
- package/storage/dist/remoteFileStorage.ts.cache +2 -2
- package/storage/remoteStorage/dist/ArchivesDelayed.ts.cache +2 -2
- package/storage/remoteStorage/dist/ArchivesRemote.ts.cache +2 -2
- package/storage/remoteStorage/dist/ArchivesUrl.ts.cache +2 -2
- package/storage/remoteStorage/dist/accessStats.ts.cache +2 -2
- package/storage/remoteStorage/dist/blobStore.ts.cache +2 -2
- package/storage/remoteStorage/dist/bucketDisk.ts.cache +2 -2
- package/storage/remoteStorage/dist/certTrustModal.tsx.cache +2 -2
- package/storage/remoteStorage/dist/chainStartup.ts.cache +2 -2
- package/storage/remoteStorage/dist/cliArgs.ts.cache +2 -2
- package/storage/remoteStorage/dist/createArchives.ts.cache +2 -2
- package/storage/remoteStorage/dist/deployTakeover.ts.cache +2 -2
- package/storage/remoteStorage/dist/intermediateManagement.ts.cache +2 -2
- package/storage/remoteStorage/dist/intermediateSources.ts.cache +2 -2
- package/storage/remoteStorage/dist/remoteConfig.ts.cache +2 -2
- package/storage/remoteStorage/dist/serverConfig.ts.cache +2 -2
- package/storage/remoteStorage/dist/sourceWrapper.ts.cache +2 -2
- package/storage/remoteStorage/dist/sourcesList.ts.cache +2 -2
- package/storage/remoteStorage/dist/storageClientController.ts.cache +2 -2
- package/storage/remoteStorage/dist/storageController.ts.cache +2 -2
- package/storage/remoteStorage/dist/storageLogs.ts.cache +2 -2
- package/storage/remoteStorage/dist/storageServerState.ts.cache +2 -2
- package/storage/remoteStorage/dist/storeConfig.ts.cache +2 -2
- package/storage/remoteStorage/dist/storePlan.ts.cache +2 -2
- package/storage/remoteStorage/dist/storeSources.ts.cache +2 -2
- package/storage/remoteStorage/dist/storeSync.ts.cache +2 -2
- package/storage/remoteStorage/dist/validation.ts.cache +2 -2
- package/yarn.lock +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getFileStorageNested2 } from "../FileFolderAPI";
|
|
2
2
|
import { observable, runInAction, onBecomeObserved, onBecomeUnobserved } from "../../render-utils/mobxTyped";
|
|
3
|
-
import { BulkDatabaseBase, ReactiveDeps, BulkDatabase2Config, BulkFileInfoListing, MergeAttemptResult } from "./BulkDatabaseBase";
|
|
3
|
+
import { BulkDatabaseBase, ReactiveDeps, BulkDatabase2Config, BulkFileInfoListing, MergeAttemptResult, CompactionPlan } from "./BulkDatabaseBase";
|
|
4
4
|
|
|
5
5
|
export { BulkDatabaseBase, noopReactiveDeps, bulkDatabase2Timing } from "./BulkDatabaseBase";
|
|
6
|
-
export type { ReactiveDeps, StorageFactory, BulkDatabase2Config, BulkFileDetails, BulkFileEntry, BulkFileInfoListing, MergeAttemptResult, MergeSkipReason } from "./BulkDatabaseBase";
|
|
6
|
+
export type { ReactiveDeps, StorageFactory, BulkDatabase2Config, BulkFileDetails, BulkFileEntry, BulkFileInfoListing, MergeAttemptResult, MergeSkipReason, CompactionPlan, CompactionStep, CompactionStepKind, CompactionTrigger } from "./BulkDatabaseBase";
|
|
7
7
|
|
|
8
8
|
/** Per-column on-disk size info, as reported by getColumnInfo/getReaderInfo. */
|
|
9
9
|
export type BulkColumnInfo = { column: string; byteSize: number };
|
|
@@ -106,6 +106,19 @@ export interface IBulkDatabase2<T extends { key: string }> {
|
|
|
106
106
|
*/
|
|
107
107
|
getFileInfo(): Promise<BulkFileInfoListing>;
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Every compaction the files on disk currently call for, without performing any of them. This is the
|
|
111
|
+
* same plan the background merge pass builds and then executes, so it says exactly what the database
|
|
112
|
+
* is about to do, to which files, and (via `startTime`) when.
|
|
113
|
+
*
|
|
114
|
+
* A step that isn't `ready` is still listed with its `triggers`, so you can see how close it is: each
|
|
115
|
+
* trigger carries the current `value`, the `threshold` that sets the step off, and their `fraction`.
|
|
116
|
+
*
|
|
117
|
+
* Not free: working out the dedup steps walks the key list of every combined file, so this is O(total
|
|
118
|
+
* keys). Fine to call when showing collection status, not something to poll on a short timer.
|
|
119
|
+
*/
|
|
120
|
+
planCompaction(): Promise<CompactionPlan>;
|
|
121
|
+
|
|
109
122
|
/**
|
|
110
123
|
* Consolidate on-disk files. Optional to call; the database also does this in the background.
|
|
111
124
|
* Returns whether anything was merged, or (via skipReason) why the pass never ran — another merge
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { FileStorage } from "../FileFolderAPI";
|
|
2
|
+
import { BulkFileInfo, StreamFileInfo } from "./LoadedIndex";
|
|
2
3
|
export declare const BULK_ROOT_FOLDER = "bulkDatabases2";
|
|
3
4
|
export declare const bulkDatabase2Timing: {
|
|
4
5
|
streamSealAgeMs: number;
|
|
5
6
|
visibleMergeIntervalMs: number;
|
|
6
7
|
mergeSpacingMs: number;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
streamFoldTriggerRows: number;
|
|
8
|
+
looseBulkTriggerBytes: number;
|
|
9
|
+
looseBulkTriggerFiles: number;
|
|
10
10
|
streamFoldTriggerBytes: number;
|
|
11
11
|
streamFileMaxBytes: number;
|
|
12
|
+
liveWriterProbeMs: number;
|
|
12
13
|
streamFoldHardLimitBytes: number;
|
|
13
14
|
writeFlushMaxDelayMs: number;
|
|
14
15
|
fileSetPollIntervalMs: number;
|
|
@@ -34,6 +35,46 @@ export type MergeAttemptResult = {
|
|
|
34
35
|
lockHolderId?: string;
|
|
35
36
|
lockExpiresInMs?: number;
|
|
36
37
|
};
|
|
38
|
+
/** One threshold a compaction step is measured against. `value` is where the collection stands now and `threshold` is what sets the step off, so `fraction` (value/threshold) reads as how close it is - 1 or more means met. Deliberately not clamped, so an overdue step reads as how far past due it is. */
|
|
39
|
+
export type CompactionTrigger = {
|
|
40
|
+
name: string;
|
|
41
|
+
value: number;
|
|
42
|
+
threshold: number;
|
|
43
|
+
fraction: number;
|
|
44
|
+
met: boolean;
|
|
45
|
+
/** How to render value/threshold. "fraction" values are 0..1. */
|
|
46
|
+
unit: "bytes" | "count" | "fraction";
|
|
47
|
+
};
|
|
48
|
+
/** streamHardLimit and streamFold are phase 1 (stream -> bulk), looseCombine is phase 2 (loose bulk -> combined bulk), dedupAll and dedupKeyGroup are phase 3. */
|
|
49
|
+
export type CompactionStepKind = "streamHardLimit" | "streamFold" | "looseCombine" | "dedupAll" | "dedupKeyGroup";
|
|
50
|
+
export type CompactionStep = {
|
|
51
|
+
phase: 1 | 2 | 3;
|
|
52
|
+
kind: CompactionStepKind;
|
|
53
|
+
/** Whether this step runs on the next pass. Authoritative: on top of `requires` it accounts for inputs the step needs beyond its thresholds (e.g. two files to combine), so it can be false even with every trigger met. */
|
|
54
|
+
ready: boolean;
|
|
55
|
+
/** Whether every trigger has to be met for this step, or just one of them. */
|
|
56
|
+
requires: "any" | "all";
|
|
57
|
+
triggers: CompactionTrigger[];
|
|
58
|
+
/** When this step's merge starts, given merges are spaced mergeSpacingMs apart. Only set when ready. */
|
|
59
|
+
startTime?: number;
|
|
60
|
+
/** The files this step consumes, as of when the plan was made. */
|
|
61
|
+
bulkFiles: BulkFileInfo[];
|
|
62
|
+
streamFiles: StreamFileInfo[];
|
|
63
|
+
/** Total size of those inputs. */
|
|
64
|
+
bytes: number;
|
|
65
|
+
/** dedupKeyGroup only - the key range the step rewrites. */
|
|
66
|
+
keyRange?: {
|
|
67
|
+
lo: string;
|
|
68
|
+
hi: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
/** Every compaction the current file set calls for, in the order a merge pass runs them, plus how close each not-yet-ready one is to its thresholds. */
|
|
72
|
+
export type CompactionPlan = {
|
|
73
|
+
collection: string;
|
|
74
|
+
/** When the plan was computed; every startTime is measured from here. */
|
|
75
|
+
time: number;
|
|
76
|
+
steps: CompactionStep[];
|
|
77
|
+
};
|
|
37
78
|
export declare class BulkDatabaseBase<T extends {
|
|
38
79
|
key: string;
|
|
39
80
|
}> {
|
|
@@ -58,7 +99,6 @@ export declare class BulkDatabaseBase<T extends {
|
|
|
58
99
|
private currentStreamFileBytes;
|
|
59
100
|
private mergeInFlight;
|
|
60
101
|
private lastMergeSkipLogMs;
|
|
61
|
-
private streamRowsOnDisk;
|
|
62
102
|
private streamBytesOnDisk;
|
|
63
103
|
private fileSetPollTimer;
|
|
64
104
|
private rebuildPromise;
|
|
@@ -78,6 +118,7 @@ export declare class BulkDatabaseBase<T extends {
|
|
|
78
118
|
};
|
|
79
119
|
isRemote(): Promise<boolean>;
|
|
80
120
|
private streamNeedsFold;
|
|
121
|
+
private findAbandonedStreams;
|
|
81
122
|
private automaticCompactionAllowed;
|
|
82
123
|
isKeyWatched(key: string): boolean;
|
|
83
124
|
private ensureIndex;
|
|
@@ -121,8 +162,19 @@ export declare class BulkDatabaseBase<T extends {
|
|
|
121
162
|
private mergeFileSetInner;
|
|
122
163
|
private canDeleteStream;
|
|
123
164
|
private mergeSpacingDelay;
|
|
165
|
+
private splitBulkTier;
|
|
166
|
+
private analyzeDuplicates;
|
|
167
|
+
private filesForKeyRange;
|
|
168
|
+
/**
|
|
169
|
+
* Every compaction the files on disk currently call for, without performing any of them. A merge pass
|
|
170
|
+
* builds exactly this and then runs the steps whose `ready` is true, so the plan is precisely what the
|
|
171
|
+
* database is about to do — and a step that isn't ready still reports its `triggers`, so a caller can
|
|
172
|
+
* see how close it is (50MB of stream data out of the 64MB that would fold it, and so on).
|
|
173
|
+
*
|
|
174
|
+
* O(total keys): the phase 3 steps need every combined file's key list walked.
|
|
175
|
+
*/
|
|
176
|
+
planCompaction(): Promise<CompactionPlan>;
|
|
124
177
|
private testMergeINTERNAL_DO_NOT_CALL;
|
|
125
|
-
private findDuplicateGroups;
|
|
126
178
|
getSingleField<C extends keyof T>(key: string, column: C): Promise<T[C] | undefined>;
|
|
127
179
|
getSingleFieldObj<C extends keyof T>(key: string, column: C): Promise<{
|
|
128
180
|
key: string;
|