sliftutils 1.4.72 → 1.4.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "1.4.72",
3
+ "version": "1.4.73",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -262,7 +262,7 @@ export class BulkDatabaseBase<T extends { key: string }> {
262
262
  db.reloadFromDisk();
263
263
  }
264
264
  }
265
- if (flushed.length) console.log(`[bulk2] heap ${fmtBytes(usedHeapBytes)} over ${fmtBytes(bulkDatabase2Timing.memoryFlushHeapBytes)} flushed ${flushed.length} large collection(s): ${flushed.join(", ")}`);
265
+ if (flushed.length) console.log(`[bulk2] heap ${fmtBytes(usedHeapBytes)} over ${fmtBytes(bulkDatabase2Timing.memoryFlushHeapBytes)} - flushed ${flushed.length} large collection(s): ${flushed.join(", ")}`);
266
266
  }
267
267
 
268
268
  public static clearCache() {
@@ -706,7 +706,7 @@ export class BulkDatabaseBase<T extends { key: string }> {
706
706
  }
707
707
  return;
708
708
  }
709
- console.warn(`${this.name}: skipping unreadable bulk file ${file.fileName} (recent may be in-progress): ${message}`);
709
+ console.warn(`${this.name}: skipping unreadable bulk file ${file.fileName} (recent - may be in-progress): ${message}`);
710
710
  }
711
711
 
712
712
  // The one merge primitive. Reads + plans + writes outputs before deleting any input, so a crash
@@ -815,7 +815,7 @@ export class BulkDatabaseBase<T extends { key: string }> {
815
815
  const outTotal = outputs.reduce((a, f) => a + f.size, 0);
816
816
  log(`${magenta("wrote")}: ${outputs.length} output file(s), ${fmtBytes(outTotal)}${carriedDeletes ? `, ${carriedDeletes} tombstones carried` : ""}`);
817
817
 
818
- console.group(`${blue(this.name)} ${magenta("merge")}: ${fmtBytes(inTotal)} ${fmtBytes(outTotal)} (${inputs.length}→${outputs.length} files) in ${formatTime(Date.now() - mergeStartMs)}`);
818
+ console.group(`${blue(this.name)} ${magenta("merge")}: ${fmtBytes(inTotal)} -> ${fmtBytes(outTotal)} (${inputs.length}->${outputs.length} files) in ${formatTime(Date.now() - mergeStartMs)}`);
819
819
  for (const line of steps) console.log(line);
820
820
  console.groupEnd();
821
821
 
@@ -896,7 +896,7 @@ export class BulkDatabaseBase<T extends { key: string }> {
896
896
  const sizes = await Promise.all(streamFiles.map(async f => { try { return (await storage.getInfo(f.fileName))?.size ?? 0; } catch { return 0; } }));
897
897
  const totalStreamBytes = sizes.reduce((a, b) => a + b, 0);
898
898
  if (totalStreamBytes > bulkDatabase2Timing.streamFoldHardLimitBytes) {
899
- console.log(`${blue(this.name)} ${magenta("fold")} stream tier ${fmtBytes(totalStreamBytes)} over hard limit ${fmtBytes(bulkDatabase2Timing.streamFoldHardLimitBytes)} folding all streams now`);
899
+ console.log(`${blue(this.name)} ${magenta("fold")} stream tier ${fmtBytes(totalStreamBytes)} over hard limit ${fmtBytes(bulkDatabase2Timing.streamFoldHardLimitBytes)} - folding all streams now`);
900
900
  if (await this.mergeFileSet([], streamFiles, false, true)) merged = true;
901
901
  }
902
902
  }
@@ -964,7 +964,7 @@ export class BulkDatabaseBase<T extends { key: string }> {
964
964
  }
965
965
  const dupFraction = totalSlots ? (totalSlots - uniqueKeys.size) / totalSlots : 0;
966
966
  if (totalBytes > DEDUP_TRIGGER_BYTES && dupFraction > DEDUP_TRIGGER_FRACTION) {
967
- console.log(`${blue(this.name)} ${magenta("dedup")}: ${fmtBytes(totalBytes)} across ${bulkFiles.length} bulk file(s), ${Math.round(dupFraction * 100)}% duplicate key-slots folding all at once`);
967
+ console.log(`${blue(this.name)} ${magenta("dedup")}: ${fmtBytes(totalBytes)} across ${bulkFiles.length} bulk file(s), ${Math.round(dupFraction * 100)}% duplicate key-slots - folding all at once`);
968
968
  if (!await runMerge(bulkFiles, [])) return merged;
969
969
  return merged;
970
970
  }
@@ -609,12 +609,12 @@ export async function autocompactBulkDatabases(root: string): Promise<void> {
609
609
  } catch { continue; } // no bulkDatabases2 here
610
610
  for (const name of names) {
611
611
  const start = Date.now();
612
- console.log(` [autocompact] ${name}: starting merge…`);
612
+ console.log(` [autocompact] ${name}: starting merge`);
613
613
  try {
614
614
  await getCompactor(baseDir, name).tryMergeNow();
615
615
  console.log(` [autocompact] ${name}: done (${Date.now() - start}ms)`);
616
616
  } catch (e) {
617
- console.warn(` [autocompact] ${name}: failed after ${Date.now() - start}ms ${(e as Error).message}`);
617
+ console.warn(` [autocompact] ${name}: failed after ${Date.now() - start}ms - ${(e as Error).message}`);
618
618
  }
619
619
  }
620
620
  }