@rocicorp/zero 1.12.0-canary.6 → 1.12.0-canary.8
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/out/zero/package.js +10 -10
- package/out/zero/package.js.map +1 -1
- package/out/zero-cache/src/auth/write-authorizer.js +9 -2
- package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
- package/out/zero-cache/src/server/change-streamer.js +1 -0
- package/out/zero-cache/src/server/change-streamer.js.map +1 -1
- package/out/zero-cache/src/services/change-source/common/replica-restore.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source-init.js +17 -9
- package/out/zero-cache/src/services/change-source/pg/change-source-init.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.js +1 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +1 -2
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.js +57 -14
- package/out/zero-cache/src/services/mutagen/pusher.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.js +1 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +22 -2
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/workers/syncer.js +9 -1
- package/out/zero-cache/src/workers/syncer.js.map +1 -1
- package/out/zero-client/src/client/version.js +1 -1
- package/out/zero-protocol/src/inspect-down.d.ts +81 -81
- package/out/zero-protocol/src/up.d.ts +60 -60
- package/package.json +10 -10
- package/out/shared/src/cache.d.ts +0 -22
- package/out/shared/src/cache.d.ts.map +0 -1
- package/out/shared/src/custom-key-map.d.ts +0 -26
- package/out/shared/src/custom-key-map.d.ts.map +0 -1
- package/out/shared/src/custom-key-set.d.ts +0 -25
- package/out/shared/src/custom-key-set.d.ts.map +0 -1
- package/out/shared/src/logging-test-utils.d.ts +0 -12
- package/out/shared/src/logging-test-utils.d.ts.map +0 -1
- package/out/shared/src/queue.d.ts +0 -53
- package/out/shared/src/queue.d.ts.map +0 -1
- package/out/shared/src/ring-buffer.d.ts +0 -42
- package/out/shared/src/ring-buffer.d.ts.map +0 -1
- package/out/shared/src/sorted-entries.d.ts +0 -2
- package/out/shared/src/sorted-entries.d.ts.map +0 -1
- package/out/zero/src/server/change-streamer.d.ts +0 -2
- package/out/zero/src/server/change-streamer.d.ts.map +0 -1
- package/out/zero/src/server/main.d.ts +0 -2
- package/out/zero/src/server/main.d.ts.map +0 -1
- package/out/zero/src/server/reaper.d.ts +0 -2
- package/out/zero/src/server/reaper.d.ts.map +0 -1
- package/out/zero/src/server/replicator.d.ts +0 -2
- package/out/zero/src/server/replicator.d.ts.map +0 -1
- package/out/zero/src/server/syncer.d.ts +0 -2
- package/out/zero/src/server/syncer.d.ts.map +0 -1
- package/out/zero-cache/src/auth/jwt.d.ts +0 -12
- package/out/zero-cache/src/auth/jwt.d.ts.map +0 -1
- package/out/zero-cache/src/auth/load-permissions.d.ts +0 -17
- package/out/zero-cache/src/auth/load-permissions.d.ts.map +0 -1
- package/out/zero-cache/src/auth/write-authorizer.d.ts +0 -28
- package/out/zero-cache/src/auth/write-authorizer.d.ts.map +0 -1
- package/out/zero-cache/src/config/server-context.d.ts +0 -16
- package/out/zero-cache/src/config/server-context.d.ts.map +0 -1
- package/out/zero-cache/src/custom/fetch.d.ts +0 -38
- package/out/zero-cache/src/custom/fetch.d.ts.map +0 -1
- package/out/zero-cache/src/custom/metrics.d.ts +0 -31
- package/out/zero-cache/src/custom/metrics.d.ts.map +0 -1
- package/out/zero-cache/src/custom-queries/transform-query.d.ts +0 -68
- package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +0 -1
- package/out/zero-cache/src/db/create.d.ts +0 -12
- package/out/zero-cache/src/db/create.d.ts.map +0 -1
- package/out/zero-cache/src/db/delete-lite-db.d.ts +0 -2
- package/out/zero-cache/src/db/delete-lite-db.d.ts.map +0 -1
- package/out/zero-cache/src/db/index-predicate.d.ts +0 -4
- package/out/zero-cache/src/db/index-predicate.d.ts.map +0 -1
- package/out/zero-cache/src/db/migration-lite.d.ts +0 -78
- package/out/zero-cache/src/db/migration-lite.d.ts.map +0 -1
- package/out/zero-cache/src/db/migration.d.ts +0 -80
- package/out/zero-cache/src/db/migration.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-copy-binary.d.ts +0 -101
- package/out/zero-cache/src/db/pg-copy-binary.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-copy.d.ts +0 -30
- package/out/zero-cache/src/db/pg-copy.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-type-parser.d.ts +0 -15
- package/out/zero-cache/src/db/pg-type-parser.d.ts.map +0 -1
- package/out/zero-cache/src/db/transaction-pool.d.ts +0 -205
- package/out/zero-cache/src/db/transaction-pool.d.ts.map +0 -1
- package/out/zero-cache/src/db/warmup.d.ts +0 -4
- package/out/zero-cache/src/db/warmup.d.ts.map +0 -1
- package/out/zero-cache/src/observability/events.d.ts +0 -15
- package/out/zero-cache/src/observability/events.d.ts.map +0 -1
- package/out/zero-cache/src/observability/log-throttle.d.ts +0 -44
- package/out/zero-cache/src/observability/log-throttle.d.ts.map +0 -1
- package/out/zero-cache/src/server/anonymous-otel-start.d.ts +0 -21
- package/out/zero-cache/src/server/anonymous-otel-start.d.ts.map +0 -1
- package/out/zero-cache/src/server/change-streamer.d.ts +0 -3
- package/out/zero-cache/src/server/change-streamer.d.ts.map +0 -1
- package/out/zero-cache/src/server/inspector-delegate.d.ts +0 -71
- package/out/zero-cache/src/server/inspector-delegate.d.ts.map +0 -1
- package/out/zero-cache/src/server/main.d.ts +0 -3
- package/out/zero-cache/src/server/main.d.ts.map +0 -1
- package/out/zero-cache/src/server/otel-diag-logger.d.ts +0 -16
- package/out/zero-cache/src/server/otel-diag-logger.d.ts.map +0 -1
- package/out/zero-cache/src/server/otel-start.d.ts +0 -3
- package/out/zero-cache/src/server/otel-start.d.ts.map +0 -1
- package/out/zero-cache/src/server/priority-op.d.ts +0 -8
- package/out/zero-cache/src/server/priority-op.d.ts.map +0 -1
- package/out/zero-cache/src/server/reaper.d.ts +0 -3
- package/out/zero-cache/src/server/reaper.d.ts.map +0 -1
- package/out/zero-cache/src/server/replicator.d.ts +0 -10
- package/out/zero-cache/src/server/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/server/slot-keeper.d.ts +0 -26
- package/out/zero-cache/src/server/slot-keeper.d.ts.map +0 -1
- package/out/zero-cache/src/server/syncer-assigner.d.ts +0 -14
- package/out/zero-cache/src/server/syncer-assigner.d.ts.map +0 -1
- package/out/zero-cache/src/server/syncer.d.ts +0 -3
- package/out/zero-cache/src/server/syncer.d.ts.map +0 -1
- package/out/zero-cache/src/server/worker-dispatcher.d.ts +0 -17
- package/out/zero-cache/src/server/worker-dispatcher.d.ts.map +0 -1
- package/out/zero-cache/src/services/analyze.d.ts +0 -9
- package/out/zero-cache/src/services/analyze.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/change-source.d.ts +0 -39
- package/out/zero-cache/src/services/change-source/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts +0 -57
- package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts +0 -55
- package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts +0 -24
- package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts +0 -140
- package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts +0 -14
- package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/custom/change-source.d.ts +0 -25
- package/out/zero-cache/src/services/change-source/custom/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts +0 -14
- package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts +0 -36
- package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts +0 -72
- package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +0 -127
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts +0 -57
- package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +0 -155
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +0 -17
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts +0 -28
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts +0 -76
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts +0 -169
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts +0 -16
- package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts +0 -15
- package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts +0 -127
- package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +0 -9
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts +0 -68
- package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts +0 -72
- package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts +0 -50
- package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts +0 -12
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts +0 -57
- package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/broadcast.d.ts +0 -98
- package/out/zero-cache/src/services/change-streamer/broadcast.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts +0 -34
- package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts +0 -34
- package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts +0 -158
- package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts +0 -19
- package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +0 -78
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts +0 -152
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +0 -575
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts +0 -24
- package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts +0 -15
- package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/forwarder.d.ts +0 -49
- package/out/zero-cache/src/services/change-streamer/forwarder.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts +0 -80
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts +0 -88
- package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts +0 -15
- package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts +0 -243
- package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/schema/init.d.ts +0 -6
- package/out/zero-cache/src/services/change-streamer/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts +0 -152
- package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts +0 -33
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts +0 -11
- package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts +0 -92
- package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts +0 -36
- package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot.d.ts +0 -22
- package/out/zero-cache/src/services/change-streamer/snapshot.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts +0 -99
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts +0 -83
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts +0 -121
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts +0 -73
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts +0 -62
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts +0 -114
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/storer.d.ts +0 -276
- package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/subscribe.d.ts +0 -485
- package/out/zero-cache/src/services/change-streamer/subscribe.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/subscriber.d.ts +0 -205
- package/out/zero-cache/src/services/change-streamer/subscriber.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts +0 -52
- package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts.map +0 -1
- package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts +0 -57
- package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/commands.d.ts +0 -77
- package/out/zero-cache/src/services/litestream/commands.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +0 -78
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/metrics.d.ts +0 -31
- package/out/zero-cache/src/services/litestream/metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/restore-progress.d.ts +0 -24
- package/out/zero-cache/src/services/litestream/restore-progress.d.ts.map +0 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts +0 -40
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +0 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +0 -63
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-log-db.d.ts +0 -368
- package/out/zero-cache/src/services/replicator/change-log-db.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts +0 -56
- package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-processor.d.ts +0 -37
- package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/drain-handler.d.ts +0 -82
- package/out/zero-cache/src/services/replicator/drain-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts +0 -25
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/notifier.d.ts +0 -9
- package/out/zero-cache/src/services/replicator/notifier.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/replication-status.d.ts +0 -71
- package/out/zero-cache/src/services/replicator/replication-status.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/replicator.d.ts +0 -86
- package/out/zero-cache/src/services/replicator/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts +0 -55
- package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts +0 -132
- package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts +0 -120
- package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/write-worker-client.d.ts +0 -111
- package/out/zero-cache/src/services/replicator/write-worker-client.d.ts.map +0 -1
- package/out/zero-cache/src/services/run-ast.d.ts +0 -39
- package/out/zero-cache/src/services/run-ast.d.ts.map +0 -1
- package/out/zero-cache/src/services/runner.d.ts +0 -19
- package/out/zero-cache/src/services/runner.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts +0 -17
- package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts +0 -26
- package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts +0 -79
- package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +0 -97
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts +0 -18
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts +0 -184
- package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts +0 -22
- package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +0 -128
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts +0 -294
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts +0 -81
- package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts +0 -45
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts +0 -53
- package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts +0 -33
- package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts +0 -51
- package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +0 -34
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +0 -296
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts +0 -7
- package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/push-cost.d.ts +0 -132
- package/out/zero-cache/src/services/view-syncer/push-cost.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts +0 -55
- package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-covering.d.ts +0 -28
- package/out/zero-cache/src/services/view-syncer/query-covering.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-shape.d.ts +0 -25
- package/out/zero-cache/src/services/view-syncer/query-shape.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-stats.d.ts +0 -89
- package/out/zero-cache/src/services/view-syncer/query-stats.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts +0 -90
- package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts +0 -17
- package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +0 -86
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts +0 -5
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +0 -563
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts +0 -95
- package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +0 -420
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/tracer.d.ts +0 -2
- package/out/zero-cache/src/services/view-syncer/tracer.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts +0 -10
- package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +0 -133
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +0 -1
- package/out/zero-cache/src/types/downstream.d.ts +0 -11
- package/out/zero-cache/src/types/downstream.d.ts.map +0 -1
- package/out/zero-cache/src/types/error-with-level.d.ts +0 -9
- package/out/zero-cache/src/types/error-with-level.d.ts.map +0 -1
- package/out/zero-cache/src/types/pg-patch.d.ts +0 -21
- package/out/zero-cache/src/types/pg-patch.d.ts.map +0 -1
- package/out/zero-cache/src/types/pg-versions.d.ts +0 -3
- package/out/zero-cache/src/types/pg-versions.d.ts.map +0 -1
- package/out/zero-cache/src/types/poke-chunk.d.ts +0 -18
- package/out/zero-cache/src/types/poke-chunk.d.ts.map +0 -1
- package/out/zero-cache/src/types/streams.d.ts +0 -115
- package/out/zero-cache/src/types/streams.d.ts.map +0 -1
- package/out/zero-cache/src/types/subscription.d.ts +0 -197
- package/out/zero-cache/src/types/subscription.d.ts.map +0 -1
- package/out/zero-cache/src/workers/connect-params.d.ts +0 -28
- package/out/zero-cache/src/workers/connect-params.d.ts.map +0 -1
- package/out/zero-cache/src/workers/connection.d.ts +0 -77
- package/out/zero-cache/src/workers/connection.d.ts.map +0 -1
- package/out/zero-cache/src/workers/replicator.d.ts +0 -57
- package/out/zero-cache/src/workers/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts +0 -14
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +0 -1
- package/out/zero-cache/src/workers/syncer.d.ts +0 -67
- package/out/zero-cache/src/workers/syncer.d.ts.map +0 -1
- package/out/zero-events/src/index.d.ts +0 -27
- package/out/zero-events/src/index.d.ts.map +0 -1
- package/out/zero-events/src/json.d.ts +0 -20
- package/out/zero-events/src/json.d.ts.map +0 -1
- package/out/zero-events/src/status.d.ts +0 -144
- package/out/zero-events/src/status.d.ts.map +0 -1
- package/out/zqlite/src/database-storage.d.ts +0 -43
- package/out/zqlite/src/database-storage.d.ts.map +0 -1
- package/out/zqlite/src/explain-queries.d.ts +0 -4
- package/out/zqlite/src/explain-queries.d.ts.map +0 -1
- package/out/zqlite/src/internal/sql-inline.d.ts +0 -13
- package/out/zqlite/src/internal/sql-inline.d.ts.map +0 -1
- package/out/zqlite/src/resolve-scalar-subqueries.d.ts +0 -72
- package/out/zqlite/src/resolve-scalar-subqueries.d.ts.map +0 -1
- package/out/zqlite/src/sqlite-cost-model.d.ts +0 -17
- package/out/zqlite/src/sqlite-cost-model.d.ts.map +0 -1
- package/out/zqlite/src/sqlite-stat-fanout.d.ts +0 -121
- package/out/zqlite/src/sqlite-stat-fanout.d.ts.map +0 -1
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { ReplicaState } from '../replicator/replicator.ts';
|
|
2
|
-
export type PendingUpstreamCommit = {
|
|
3
|
-
readonly watermark: string;
|
|
4
|
-
readonly commitTimeMs: number;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Pairs the upstream commit timestamps carried by `version-ready`
|
|
8
|
-
* notifications with the moment the corresponding change is poked to clients,
|
|
9
|
-
* yielding the end-to-end serving lag.
|
|
10
|
-
*
|
|
11
|
-
* This measures completion, not backlog: an observation is produced only when
|
|
12
|
-
* work actually reaches clients, so the resulting histogram is a latency
|
|
13
|
-
* distribution rather than a periodic snapshot of how far behind things are.
|
|
14
|
-
* A ViewSyncer that is stuck contributes nothing until it recovers, instead of
|
|
15
|
-
* re-reporting its age on every sample tick.
|
|
16
|
-
*
|
|
17
|
-
* "Reaches clients" includes an advancement that had nothing to send this
|
|
18
|
-
* client group. Such an advancement still establishes that the group is
|
|
19
|
-
* current as of that commit, so it must clear the pending commit; a tracker
|
|
20
|
-
* that waited for a *data* poke would instead accumulate the oldest commit
|
|
21
|
-
* across every quiet interval and report the whole interval as lag the next
|
|
22
|
-
* time the group happened to match a transaction. The caller is responsible
|
|
23
|
-
* for passing the replica version it advanced to rather than the CVR version,
|
|
24
|
-
* which only moves when there is something to write.
|
|
25
|
-
*/
|
|
26
|
-
export declare class E2EServingLagTracker {
|
|
27
|
-
#private;
|
|
28
|
-
get pending(): PendingUpstreamCommit | null;
|
|
29
|
-
/**
|
|
30
|
-
* Records the upstream commit behind a `version-ready` notification.
|
|
31
|
-
*
|
|
32
|
-
* Notifications coalesce when the ViewSyncer is busy, so one state may stand
|
|
33
|
-
* in for several commits. The *oldest* commit time is kept, since it bounds
|
|
34
|
-
* the lag of everything the notification subsumed, while the watermark
|
|
35
|
-
* advances to the newest — that is the one that must be served for all of
|
|
36
|
-
* the subsumed commits to have been delivered.
|
|
37
|
-
*/
|
|
38
|
-
onVersionReady({ watermark, upstreamCommitTimeMs }: ReplicaState): void;
|
|
39
|
-
/**
|
|
40
|
-
* Called once a version has been poked to clients.
|
|
41
|
-
*
|
|
42
|
-
* @return the observation to record, or `null` if the served version does
|
|
43
|
-
* not yet cover an outstanding upstream commit.
|
|
44
|
-
*/
|
|
45
|
-
onVersionServed(servedVersion: string, nowMs: number): Observation | null;
|
|
46
|
-
}
|
|
47
|
-
export type Observation = {
|
|
48
|
-
/** End-to-end lag in milliseconds, clamped to be non-negative. */
|
|
49
|
-
readonly lagMs: number;
|
|
50
|
-
/** Whether the clamp was applied, i.e. the raw measurement was negative. */
|
|
51
|
-
readonly clamped: boolean;
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=e2e-serving-lag.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"e2e-serving-lag.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/e2e-serving-lag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAE9D,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,oBAAoB;;IAG/B,IAAI,OAAO,IAAI,qBAAqB,GAAG,IAAI,CAE1C;IAED;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAC,SAAS,EAAE,oBAAoB,EAAC,EAAE,YAAY,GAAG,IAAI,CAYpE;IAED;;;;;OAKG;IACH,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAmBxE;CACF;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export type MonotonicClock = () => number;
|
|
2
|
-
/**
|
|
3
|
-
* A soft wall-clock budget for one view-syncer hydration pass.
|
|
4
|
-
*
|
|
5
|
-
* Callers check the budget only at query boundaries. Consequently, a query
|
|
6
|
-
* that starts before the limit is reached is always allowed to finish.
|
|
7
|
-
*
|
|
8
|
-
* The budget measures hydration work. Intervals that are not hydration --
|
|
9
|
-
* notably the remote custom-query transform round trips -- are discounted via
|
|
10
|
-
* {@link excluding}, so that endpoint latency cannot spend a budget that only
|
|
11
|
-
* evicting queries could recover.
|
|
12
|
-
*/
|
|
13
|
-
export declare class HydrationBudget {
|
|
14
|
-
#private;
|
|
15
|
-
readonly limitMs: number;
|
|
16
|
-
constructor(limitMs: number, now?: MonotonicClock);
|
|
17
|
-
/**
|
|
18
|
-
* Runs `fn`, discounting the time it takes as non-hydration work. The
|
|
19
|
-
* interval is measured with this budget's own clock, so an injected clock
|
|
20
|
-
* governs both the elapsed time and what is excluded from it.
|
|
21
|
-
*/
|
|
22
|
-
excluding<T>(fn: () => Promise<T>): Promise<T>;
|
|
23
|
-
elapsedMs(): number;
|
|
24
|
-
/**
|
|
25
|
-
* Whether the budget is spent. A disabled budget (`limitMs === 0`) is never
|
|
26
|
-
* exhausted. The elapsed time at the first exhausted check is retained in
|
|
27
|
-
* {@link exhaustedAtMs} so that reporting does not re-read the clock.
|
|
28
|
-
*/
|
|
29
|
-
exhausted(): boolean;
|
|
30
|
-
/** The elapsed time at which {@link exhausted} first returned true. */
|
|
31
|
-
get exhaustedAtMs(): number | undefined;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=hydration-budget.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hydration-budget.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/hydration-budget.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,qBAAa,eAAe;;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAMzB,YACE,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,cAAkD,EASxD;IAED;;;;OAIG;IACG,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOnD;IAED,SAAS,IAAI,MAAM,CAElB;IAED;;;;OAIG;IACH,SAAS,IAAI,OAAO,CAUnB;IAED,uEAAuE;IACvE,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;CACF"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { MonotonicClock } from './hydration-budget.ts';
|
|
2
|
-
/**
|
|
3
|
-
* How long a tripped query stays rejected before a retry is allowed.
|
|
4
|
-
*
|
|
5
|
-
* A query that blows the timeout is almost always slow because of the shape
|
|
6
|
-
* of its data rather than because of transient load, so retrying it on every
|
|
7
|
-
* reconnect would burn a full timeout each time. The cooldown keeps that cost
|
|
8
|
-
* to at most one timeout per cooldown period per query.
|
|
9
|
-
*/
|
|
10
|
-
export declare const DEFAULT_CIRCUIT_BREAKER_OPEN_MS: number;
|
|
11
|
-
/**
|
|
12
|
-
* A per-query circuit breaker for view-syncer hydration.
|
|
13
|
-
*
|
|
14
|
-
* Hydration of a single query is aborted once its processing time exceeds
|
|
15
|
-
* {@link timeoutMs}. Callers check {@link exceeded} at the yield points of a
|
|
16
|
-
* hydration, so a query is only ever aborted between time slices.
|
|
17
|
-
*
|
|
18
|
-
* Once a query has been aborted the breaker is "open" for its transformation
|
|
19
|
-
* hash: {@link isOpen} reports true for {@link openMs}, and callers reject the
|
|
20
|
-
* query up front instead of hydrating it again. After that the breaker is
|
|
21
|
-
* implicitly half-open: the next hydration attempt runs, and either succeeds
|
|
22
|
-
* or trips the breaker again.
|
|
23
|
-
*
|
|
24
|
-
* The breaker is keyed by transformation hash rather than query hash because
|
|
25
|
-
* the transformation (permissions, auth context) determines the pipeline that
|
|
26
|
-
* runs, and a different transformation of the same query may well be fast.
|
|
27
|
-
*/
|
|
28
|
-
export declare class HydrationCircuitBreaker {
|
|
29
|
-
#private;
|
|
30
|
-
readonly timeoutMs: number;
|
|
31
|
-
readonly openMs: number;
|
|
32
|
-
constructor(timeoutMs: number, openMs?: number, now?: MonotonicClock);
|
|
33
|
-
/** Whether the breaker does anything at all. */
|
|
34
|
-
get enabled(): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Whether a hydration that has consumed `elapsedMs` of processing time must
|
|
37
|
-
* be aborted. Always false when the breaker is disabled.
|
|
38
|
-
*/
|
|
39
|
-
exceeded(elapsedMs: number): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Records that hydrating `transformationHash` was aborted.
|
|
42
|
-
*
|
|
43
|
-
* Trips are rare, so this is also when expired entries are swept, which
|
|
44
|
-
* keeps the map bounded by the number of hashes tripped within one cooldown
|
|
45
|
-
* rather than by every hash ever tripped.
|
|
46
|
-
*/
|
|
47
|
-
trip(transformationHash: string): void;
|
|
48
|
-
/** Whether `transformationHash` is currently rejected. */
|
|
49
|
-
isOpen(transformationHash: string): boolean;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=hydration-circuit-breaker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hydration-circuit-breaker.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/hydration-circuit-breaker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,QAAa,CAAC;AAE1D;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,uBAAuB;;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAIxB,YACE,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,MAAwC,EAChD,GAAG,GAAE,cAAkD,EAUxD;IAED,gDAAgD;IAChD,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEnC;IAED;;;;;;OAMG;IACH,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAQrC;IAED,0DAA0D;IAC1D,MAAM,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAU1C;CACF"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import type { AnalyzeQueryResult } from '../../../../zero-protocol/src/analyze-query-result.ts';
|
|
3
|
-
import type { QueryServerMetrics } from '../../../../zero-protocol/src/inspect-down.ts';
|
|
4
|
-
import { type UnparsedInspectUpMessage } from '../../../../zero-protocol/src/inspect-up.ts';
|
|
5
|
-
import type { NormalizedZeroConfig } from '../../config/normalize.ts';
|
|
6
|
-
import type { InspectorDelegate } from '../../server/inspector-delegate.ts';
|
|
7
|
-
import type { ClientHandler } from './client-handler.ts';
|
|
8
|
-
import type { ConnectionContext } from './connection-context-manager.ts';
|
|
9
|
-
import type { CVRStore } from './cvr-store.ts';
|
|
10
|
-
import type { CVRSnapshot } from './cvr.ts';
|
|
11
|
-
export declare function handleInspect(lc: LogContext, body: UnparsedInspectUpMessage[1], cvr: CVRSnapshot, client: ClientHandler, inspectorDelegate: InspectorDelegate, clientGroupID: string, authOwner: object, cvrStore: CVRStore, config: NormalizedZeroConfig, ctx: ConnectionContext): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Removes the planner's `filter` nodes from `joinPlans` for clients before
|
|
14
|
-
* protocol 53, which added that node type. 1.9 and 1.10 clients fail to parse
|
|
15
|
-
* a node type they don't know, and the failed parse puts the client in its
|
|
16
|
-
* error state.
|
|
17
|
-
*
|
|
18
|
-
* @visibleForTesting
|
|
19
|
-
*/
|
|
20
|
-
export declare function analyzeResultForProtocol(result: AnalyzeQueryResult, protocolVersion: number): AnalyzeQueryResult;
|
|
21
|
-
/**
|
|
22
|
-
* Converts per-query server metrics to the appropriate wire format based on the
|
|
23
|
-
* client's protocol version.
|
|
24
|
-
*
|
|
25
|
-
* Protocol >= 51: new format — `query-hydration-server-ms` (plain number) +
|
|
26
|
-
* `query-update-server` (TDigest).
|
|
27
|
-
* Protocol < 51: old format — `query-materialization-server` (TDigest) +
|
|
28
|
-
* `query-update-server` (TDigest). The scalar hydration time is wrapped into a
|
|
29
|
-
* one-point TDigest for backward compatibility.
|
|
30
|
-
*
|
|
31
|
-
* @visibleForTesting
|
|
32
|
-
*/
|
|
33
|
-
export declare function metricsForProtocol(metrics: QueryServerMetrics | null, protocolVersion: number): QueryServerMetrics | null;
|
|
34
|
-
//# sourceMappingURL=inspect-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspect-handler.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/inspect-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAKjD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,uDAAuD,CAAC;AAC9F,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,6CAA6C,CAAC;AAGrD,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAMpE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,oCAAoC,CAAC;AAE1E,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAE1C,wBAAsB,aAAa,CACjC,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,wBAAwB,CAAC,CAAC,CAAC,EACjC,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,aAAa,EACrB,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,MAAM,EAGrB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,oBAAoB,EAC5B,GAAG,EAAE,iBAAiB,GACrB,OAAO,CAAC,IAAI,CAAC,CA+Jf;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,kBAAkB,EAC1B,eAAe,EAAE,MAAM,GACtB,kBAAkB,CAUpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,kBAAkB,GAAG,IAAI,EAClC,eAAe,EAAE,MAAM,GACtB,kBAAkB,GAAG,IAAI,CAmB3B"}
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import type { AST, LiteralValue } from '../../../../zero-protocol/src/ast.ts';
|
|
3
|
-
import type { ClientSchema } from '../../../../zero-protocol/src/client-schema.ts';
|
|
4
|
-
import type { Row } from '../../../../zero-protocol/src/data.ts';
|
|
5
|
-
import { ChangeType } from '../../../../zql/src/ivm/change-type.ts';
|
|
6
|
-
import { type Input } from '../../../../zql/src/ivm/operator.ts';
|
|
7
|
-
import type { PlanWarning } from '../../../../zql/src/planner/planner-warnings.ts';
|
|
8
|
-
import type { ClientGroupStorage } from '../../../../zqlite/src/database-storage.ts';
|
|
9
|
-
import { type LoadedPermissions } from '../../auth/load-permissions.ts';
|
|
10
|
-
import type { LogConfig, ZeroConfig } from '../../config/zero-config.ts';
|
|
11
|
-
import type { LiteAndZqlSpec } from '../../db/specs.ts';
|
|
12
|
-
import type { InspectorDelegate } from '../../server/inspector-delegate.ts';
|
|
13
|
-
import { type RowKey } from '../../types/row-key.ts';
|
|
14
|
-
import { type ShardID } from '../../types/shards.ts';
|
|
15
|
-
import type { DeferredWritesBudget } from './deferred-writes-budget.ts';
|
|
16
|
-
import { type QueryPushProgress, type ShouldCutOffPush } from './push-cutoff.ts';
|
|
17
|
-
import { type QueryShape } from './query-shape.ts';
|
|
18
|
-
import type { QueryStats } from './query-stats.ts';
|
|
19
|
-
import type { Snapshotter } from './snapshotter.ts';
|
|
20
|
-
type RowOp<Op extends Omit<ChangeType, ChangeType.CHILD>> = {
|
|
21
|
-
readonly type: Op;
|
|
22
|
-
readonly queryID: string;
|
|
23
|
-
readonly table: string;
|
|
24
|
-
readonly rowKey: Row;
|
|
25
|
-
readonly row: Row;
|
|
26
|
-
};
|
|
27
|
-
export type RowAdd = RowOp<ChangeType.ADD>;
|
|
28
|
-
export type RowRemove = RowOp<ChangeType.REMOVE>;
|
|
29
|
-
export type RowEdit = RowOp<ChangeType.EDIT>;
|
|
30
|
-
export type RowChange = RowAdd | RowRemove | RowEdit;
|
|
31
|
-
export type QueryInfo = {
|
|
32
|
-
readonly transformedAst: AST;
|
|
33
|
-
readonly originalAst?: AST | undefined;
|
|
34
|
-
readonly transformationHash: string;
|
|
35
|
-
readonly queryName?: string | undefined;
|
|
36
|
-
};
|
|
37
|
-
export type HydrationStats = {
|
|
38
|
-
/** The rows the hydration output. */
|
|
39
|
-
readonly rowCount: number;
|
|
40
|
-
/**
|
|
41
|
-
* The rows the hydration read from the replica, including rows that were
|
|
42
|
-
* then filtered out, e.g. by a filter that could not be pushed to SQLite or
|
|
43
|
-
* by an EXISTS that did not match. Much greater than {@link rowCount} means
|
|
44
|
-
* the query does a lot of work for the rows it returns.
|
|
45
|
-
*/
|
|
46
|
-
readonly rowsRead: number;
|
|
47
|
-
/** What the planner warned about the plan it chose for the query. */
|
|
48
|
-
readonly planWarnings: readonly PlanWarning[];
|
|
49
|
-
/** The {@link queryShape} of the query, computed when it was hydrated. */
|
|
50
|
-
readonly shape: QueryShape;
|
|
51
|
-
};
|
|
52
|
-
export type PipelineHydrationReason = 'query-set-sync' | 'unchanged-query-rehydrate';
|
|
53
|
-
type PipelineStopReason = 'replace-query' | 'remove-query' | 'abandon-advance' | 'reset' | 'destroy';
|
|
54
|
-
export type AdvancementProgress = {
|
|
55
|
-
/** Raw ChangeLog entries read, including skipped entries and the current change. */
|
|
56
|
-
readonly changesScanned: number;
|
|
57
|
-
/** Yielded source changes whose push processing completed. */
|
|
58
|
-
readonly changesProcessed: number;
|
|
59
|
-
/** Raw entries omitted by the snapshot diff. */
|
|
60
|
-
readonly changesSkipped: number;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* A query whose pipeline was removed by a {@link CostBasedAdvance}, either
|
|
64
|
-
* before the advancement's changes were pushed or partway through them
|
|
65
|
-
* (`'cutoff'`). Before, it is because pushing them to the query was
|
|
66
|
-
* estimated to cost more than hydrating it again (`'estimate'`), or because
|
|
67
|
-
* reading them was, for the queries that were left to push them to
|
|
68
|
-
* (`'read'`). The row changes it output before then have been returned by
|
|
69
|
-
* the advancement. To bring the query to the advancement's
|
|
70
|
-
* version, hydrate it again with {@link PipelineDriver.addQuery}, passing its
|
|
71
|
-
* `originalAst`, once the advancement's changes have been iterated over in
|
|
72
|
-
* their entirety.
|
|
73
|
-
*/
|
|
74
|
-
export type AbandonedQuery = QueryPushProgress & {
|
|
75
|
-
readonly reason: 'estimate' | 'read' | 'cutoff';
|
|
76
|
-
/** What pushing the advancement's changes to it was estimated to cost. */
|
|
77
|
-
readonly estimatedPushMs?: number | undefined;
|
|
78
|
-
readonly transformationHash: string;
|
|
79
|
-
readonly transformedAst: AST;
|
|
80
|
-
/** The AST the query was added with. */
|
|
81
|
-
readonly originalAst: AST;
|
|
82
|
-
readonly queryName?: string | undefined;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Bounds the cost of an advancement query by query, by hydrating a query
|
|
86
|
-
* again when that is cheaper than pushing the advancement's changes through
|
|
87
|
-
* its pipeline. This is an alternative to the client group's advancement
|
|
88
|
-
* time limit, which does not apply to an advancement that is given this.
|
|
89
|
-
* Such an advancement is never aborted for taking too long.
|
|
90
|
-
*/
|
|
91
|
-
export type CostBasedAdvance = {
|
|
92
|
-
/**
|
|
93
|
-
* Between changes, the pipeline of each query that this says to stop
|
|
94
|
-
* pushing to is removed (see {@link PushCutoff}).
|
|
95
|
-
*/
|
|
96
|
-
readonly shouldCutOff: ShouldCutOffPush;
|
|
97
|
-
/**
|
|
98
|
-
* Before any change is pushed, the pipelines of the queries that are
|
|
99
|
-
* estimated to be cheaper to hydrate again than to push the advancement's
|
|
100
|
-
* changes to are removed (see {@link shouldStartOnRebuild}). This is how
|
|
101
|
-
* many times cheaper.
|
|
102
|
-
*/
|
|
103
|
-
readonly rebuildMargin: number;
|
|
104
|
-
};
|
|
105
|
-
/** How an estimate of a query's push time compared with the actual time. */
|
|
106
|
-
export type PushEstimate = {
|
|
107
|
-
readonly queryID: string;
|
|
108
|
-
readonly estimatedPushMs: number;
|
|
109
|
-
readonly pushTimeMs: number;
|
|
110
|
-
};
|
|
111
|
-
export type Timer = {
|
|
112
|
-
elapsedLap: () => number;
|
|
113
|
-
totalElapsed: () => number;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Manages the state of IVM pipelines for a given ViewSyncer (i.e. client group).
|
|
117
|
-
*/
|
|
118
|
-
export declare class PipelineDriver {
|
|
119
|
-
#private;
|
|
120
|
-
constructor(lc: LogContext, logConfig: LogConfig, snapshotter: Snapshotter, shardID: ShardID, storage: ClientGroupStorage, clientGroupID: string, inspectorDelegate: InspectorDelegate, yieldThresholdMs: () => number, enablePlanner?: boolean, config?: ZeroConfig, deferredWrites?: DeferredWritesBudget, queryStats?: QueryStats | undefined);
|
|
121
|
-
/**
|
|
122
|
-
* Initializes the PipelineDriver to the current head of the database.
|
|
123
|
-
* Queries can then be added (i.e. hydrated) with {@link addQuery()}.
|
|
124
|
-
*
|
|
125
|
-
* Must only be called once.
|
|
126
|
-
*/
|
|
127
|
-
init(clientSchema: ClientSchema): void;
|
|
128
|
-
/**
|
|
129
|
-
* @returns Whether the PipelineDriver has been initialized.
|
|
130
|
-
*/
|
|
131
|
-
initialized(): boolean;
|
|
132
|
-
/**
|
|
133
|
-
* Clears the current pipelines and TableSources, returning the PipelineDriver
|
|
134
|
-
* to its initial state. This should be called in response to a schema change,
|
|
135
|
-
* as TableSources need to be recomputed.
|
|
136
|
-
*/
|
|
137
|
-
reset(clientSchema: ClientSchema): void;
|
|
138
|
-
/** @returns The replica version. The PipelineDriver must have been initialized. */
|
|
139
|
-
get replicaVersion(): string;
|
|
140
|
-
/**
|
|
141
|
-
* Returns the current version of the database. This will reflect the
|
|
142
|
-
* latest version change when calling {@link advance()} once the
|
|
143
|
-
* iteration has begun.
|
|
144
|
-
*/
|
|
145
|
-
currentVersion(): string;
|
|
146
|
-
/**
|
|
147
|
-
* Returns the current upstream {app}.permissions, or `null` if none are defined.
|
|
148
|
-
*/
|
|
149
|
-
currentPermissions(): LoadedPermissions | null;
|
|
150
|
-
/**
|
|
151
|
-
* Advances the snapshot to the head of the database without diffing the
|
|
152
|
-
* change log, in preparation for hydrating queries at head.
|
|
153
|
-
*
|
|
154
|
-
* Throws a {@link ResetPipelinesSignal} if the change log records a
|
|
155
|
-
* schema change since the previous snapshot. The table specs (and any
|
|
156
|
-
* TableSources built from them) were computed at or before that snapshot
|
|
157
|
-
* and are stale with respect to the new head, so the caller must
|
|
158
|
-
* {@link reset()} before hydrating. ({@link advance()} detects this when
|
|
159
|
-
* the diff encounters the RESET op; this path skips the diff and so must
|
|
160
|
-
* check explicitly.)
|
|
161
|
-
*
|
|
162
|
-
* @param releasePreviousSnapshot Whether to release the snapshot that the
|
|
163
|
-
* driver was at, which is otherwise left open until the next
|
|
164
|
-
* advance (see `Snapshotter.releasePrevious()`).
|
|
165
|
-
*/
|
|
166
|
-
advanceWithoutDiff(releasePreviousSnapshot?: boolean): string;
|
|
167
|
-
/**
|
|
168
|
-
* Clears storage used for the pipelines. Call this when the
|
|
169
|
-
* PipelineDriver will no longer be used.
|
|
170
|
-
*/
|
|
171
|
-
destroy(): void;
|
|
172
|
-
/** @return Map from query ID to PipelineInfo for all added queries. */
|
|
173
|
-
queries(): ReadonlyMap<string, QueryInfo>;
|
|
174
|
-
/**
|
|
175
|
-
* The queries whose pipelines a {@link CostBasedAdvance} removed and that
|
|
176
|
-
* have not been hydrated again since, by query ID. They are not in
|
|
177
|
-
* {@link queries()}. A query whose hydration is started but does not
|
|
178
|
-
* finish is still one of them.
|
|
179
|
-
*/
|
|
180
|
-
abandonedQueries(): ReadonlyMap<string, AbandonedQuery>;
|
|
181
|
-
/**
|
|
182
|
-
* Stats from the hydration of the pipeline for `queryID`, or `undefined` if
|
|
183
|
-
* the query has no pipeline.
|
|
184
|
-
*/
|
|
185
|
-
hydrationStats(queryID: string): HydrationStats | undefined;
|
|
186
|
-
totalHydrationTimeMs(): number;
|
|
187
|
-
/**
|
|
188
|
-
* The rows the sources hold in memory for the advancement in progress.
|
|
189
|
-
* The advancement's reservation from the {@link DeferredWritesBudget}
|
|
190
|
-
* bounds this.
|
|
191
|
-
*/
|
|
192
|
-
get pendingRows(): number;
|
|
193
|
-
/**
|
|
194
|
-
* The estimated bytes of {@link pendingRows}, which are added to the
|
|
195
|
-
* {@link DeferredWritesBudget}'s held bytes as the advancement goes.
|
|
196
|
-
*/
|
|
197
|
-
get pendingBytes(): number;
|
|
198
|
-
/**
|
|
199
|
-
* Adds a pipeline for the query. The method will hydrate the query using the
|
|
200
|
-
* driver's current snapshot of the database and return a stream of results.
|
|
201
|
-
* Henceforth, updates to the query will be returned when the driver is
|
|
202
|
-
* {@link advance}d. The query and its pipeline can be removed with
|
|
203
|
-
* {@link removeQuery()}.
|
|
204
|
-
*
|
|
205
|
-
* If a query with the same queryID is already added, the existing pipeline
|
|
206
|
-
* will be removed and destroyed before adding the new pipeline.
|
|
207
|
-
*
|
|
208
|
-
* @param timer The caller-controlled {@link Timer} used to determine the
|
|
209
|
-
* final hydration time. (The caller may pause and resume the timer
|
|
210
|
-
* when yielding the thread for time-slicing).
|
|
211
|
-
* @return The rows from the initial hydration of the query.
|
|
212
|
-
*/
|
|
213
|
-
addQuery(transformationHash: string, queryID: string, query: AST, timer: Timer, queryName?: string, hydrationReason?: PipelineHydrationReason): Iterable<RowChange | 'yield'>;
|
|
214
|
-
/**
|
|
215
|
-
* Removes the pipeline for the query. This is a no-op if the query
|
|
216
|
-
* was not added.
|
|
217
|
-
*/
|
|
218
|
-
removeQuery(queryID: string, stopReason?: PipelineStopReason): void;
|
|
219
|
-
/**
|
|
220
|
-
* Current XOR signature of the row-set attached to `queryID`, or
|
|
221
|
-
* `undefined` if no pipeline for the query is currently active.
|
|
222
|
-
* Maintained incrementally by {@link addQuery} and {@link advance}.
|
|
223
|
-
*/
|
|
224
|
-
rowSetSignature(queryID: string): bigint | undefined;
|
|
225
|
-
/**
|
|
226
|
-
* IDs of the queries whose {@link rowSetSignature} changed (by an ADD or
|
|
227
|
-
* REMOVE from {@link addQuery} or {@link advance}) since the last call to
|
|
228
|
-
* {@link clearChangedRowSetSignatures}.
|
|
229
|
-
*/
|
|
230
|
-
changedRowSetSignatures(): ReadonlySet<string>;
|
|
231
|
-
/**
|
|
232
|
-
* Called once the {@link changedRowSetSignatures} have been persisted.
|
|
233
|
-
*/
|
|
234
|
-
clearChangedRowSetSignatures(): void;
|
|
235
|
-
/**
|
|
236
|
-
* Returns the value of the row with the given primary key `pk`,
|
|
237
|
-
* or `undefined` if there is no such row. The pipeline must have been
|
|
238
|
-
* initialized.
|
|
239
|
-
*/
|
|
240
|
-
getRow(table: string, pk: RowKey): Row | undefined;
|
|
241
|
-
/**
|
|
242
|
-
* Advances to the new head of the database.
|
|
243
|
-
*
|
|
244
|
-
* @param timer The caller-controlled {@link Timer} that will be used to
|
|
245
|
-
* measure the progress of the advancement and abort with a
|
|
246
|
-
* {@link ResetPipelinesSignal} if it is estimated to take longer
|
|
247
|
-
* than a hydration.
|
|
248
|
-
* @param costBased If given, the advancement is bounded query by query
|
|
249
|
-
* instead (see {@link CostBasedAdvance}).
|
|
250
|
-
* @return The resulting row changes for all added queries. Note that the
|
|
251
|
-
* `changes` must be iterated over in their entirety in order to
|
|
252
|
-
* advance the database snapshot.
|
|
253
|
-
* @throws A {@link ResetPipelinesSignal} if `costBased` is given and the
|
|
254
|
-
* changes include a schema change, a truncation or a change of
|
|
255
|
-
* the permissions. It is thrown before any change is pushed or
|
|
256
|
-
* any pipeline is removed, as the caller resets the pipelines
|
|
257
|
-
* either way. Without `costBased`, it is iterating over the
|
|
258
|
-
* `changes` that throws it, on getting to that change.
|
|
259
|
-
*/
|
|
260
|
-
advance(timer: Timer, costBased?: CostBasedAdvance): {
|
|
261
|
-
version: string;
|
|
262
|
-
numChanges: number;
|
|
263
|
-
changes: Iterable<RowChange | 'yield'>;
|
|
264
|
-
/** Available throughout iteration and after completion or an abort. */
|
|
265
|
-
progress: () => AdvancementProgress;
|
|
266
|
-
/**
|
|
267
|
-
* The queries whose pipelines the {@link CostBasedAdvance} has removed
|
|
268
|
-
* so far. They can be hydrated again once `changes` has been iterated
|
|
269
|
-
* over.
|
|
270
|
-
*/
|
|
271
|
-
abandoned: () => readonly AbandonedQuery[];
|
|
272
|
-
/**
|
|
273
|
-
* How the estimates of the {@link CostBasedAdvance} compared with the
|
|
274
|
-
* actual push times, for the queries that had an estimate and were
|
|
275
|
-
* pushed all of the changes. Available once `changes` has been iterated
|
|
276
|
-
* over.
|
|
277
|
-
*/
|
|
278
|
-
estimates: () => readonly PushEstimate[];
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Core hydration logic used by {@link PipelineDriver#addQuery}, extracted to a
|
|
283
|
-
* function for reuse by the analyze-query RPC path so that analysis hydrates
|
|
284
|
-
* queries the same way the view-syncer does in production. As there, the rows
|
|
285
|
-
* of a table outside `clientSchema` are keyed by its key in the replica.
|
|
286
|
-
*/
|
|
287
|
-
export declare function hydrate(input: Input, hash: string, clientSchema: ClientSchema, tableSpecs: Map<string, LiteAndZqlSpec>): Iterable<RowChange | 'yield'>;
|
|
288
|
-
/**
|
|
289
|
-
* Returns the value of `childField` in the row of `input`, the pipeline of a
|
|
290
|
-
* scalar subquery: `null` if the field is `NULL`, or `undefined` if there is
|
|
291
|
-
* no row. Used by {@link PipelineDriver#addQuery} and the analyze-query RPC
|
|
292
|
-
* path to resolve scalar subqueries the same way.
|
|
293
|
-
*/
|
|
294
|
-
export declare function fetchScalarValue(input: Input, childField: string): LiteralValue | null | undefined;
|
|
295
|
-
export {};
|
|
296
|
-
//# sourceMappingURL=pipeline-driver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-driver.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/pipeline-driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAQjD,OAAO,KAAK,EAAC,GAAG,EAAE,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gDAAgD,CAAC;AACjF,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,uCAAuC,CAAC;AAQ/D,OAAO,EAAC,UAAU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nD;IAED;;;;OAIG;IACH,uBAAuB,IAAI,WAAW,CAAC,MAAM,CAAC,CAE7C;IAED;;OAEG;IACH,4BAA4B,IAAI,IAAI,CAEnC;IA0BD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAIjD;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CACL,KAAK,EAAE,KAAK,EACZ,SAAS,CAAC,EAAE,gBAAgB,GAC3B;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,OAAO,CAAC,CAAC;QACvC,uEAAuE;QACvE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;QACpC;;;;WAIG;QACH,SAAS,EAAE,MAAM,SAAS,cAAc,EAAE,CAAC;QAC3C;;;;;WAKG;QACH,SAAS,EAAE,MAAM,SAAS,YAAY,EAAE,CAAC;KAC1C,CAsEA;CAkjCF;AA2OD;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,GACtC,QAAQ,CAAC,SAAS,GAAG,OAAO,CAAC,CAK/B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,MAAM,GACjB,YAAY,GAAG,IAAI,GAAG,SAAS,CAYjC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PlanWarning } from '../../../../zql/src/planner/planner-warnings.ts';
|
|
2
|
-
/**
|
|
3
|
-
* Explains a {@link PlanWarning} for a zero-cache operator, in terms of the
|
|
4
|
-
* SQLite replica, whose indexes come from the upstream database.
|
|
5
|
-
*/
|
|
6
|
-
export declare function planWarningMessage(warning: PlanWarning): string;
|
|
7
|
-
//# sourceMappingURL=plan-warnings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plan-warnings.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/plan-warnings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,iDAAiD,CAAC;AAEjF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CA+B/D"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Learns what it costs to push a change of each table through each query of
|
|
3
|
-
* a client group, and estimates from it what pushing a batch of changes
|
|
4
|
-
* would cost.
|
|
5
|
-
*
|
|
6
|
-
* The estimates only decide whether a query skips pushing and starts an
|
|
7
|
-
* advancement on rebuild (see {@link shouldStartOnRebuild}). Nothing depends
|
|
8
|
-
* on their accuracy: a query that starts on push when it should not have is
|
|
9
|
-
* cut off (see `PushCutoff`), and one that starts on rebuild costs its
|
|
10
|
-
* hydration time, as it would have at the cutoff.
|
|
11
|
-
*/
|
|
12
|
-
export declare class PushCostEstimator {
|
|
13
|
-
#private;
|
|
14
|
-
/**
|
|
15
|
-
* Records what an advancement cost a query.
|
|
16
|
-
*
|
|
17
|
-
* @param tables The tables the query reads.
|
|
18
|
-
* @param timeMsByTable The time spent pushing the changes of each table
|
|
19
|
-
* to the query. Absent for a table whose changes cost it nothing,
|
|
20
|
-
* e.g. because the rows did not match its filters.
|
|
21
|
-
* @param changesByTable The entries of each table that the advancement
|
|
22
|
-
* read from the change log, whether or not they reached the query,
|
|
23
|
-
* or changed anything at all (a row that is inserted and deleted
|
|
24
|
-
* between two snapshots is an entry that changes nothing). These
|
|
25
|
-
* are the entries that {@link estimate} is given the count of.
|
|
26
|
-
*/
|
|
27
|
-
record(queryID: string, tables: Iterable<string>, timeMsByTable: ReadonlyMap<string, number> | undefined, changesByTable: ReadonlyMap<string, number>): void;
|
|
28
|
-
/**
|
|
29
|
-
* The estimated time to push `changes` to the query, or `undefined` if it
|
|
30
|
-
* has never been pushed any change. A table that the query has never been
|
|
31
|
-
* pushed a change of is estimated to cost nothing.
|
|
32
|
-
*
|
|
33
|
-
* @param tables The tables the query reads.
|
|
34
|
-
* @param changes The number of changes to push, by table.
|
|
35
|
-
*/
|
|
36
|
-
estimate(queryID: string, tables: Iterable<string>, changes: ReadonlyMap<string, number>): number | undefined;
|
|
37
|
-
/** Forgets what was learned about a query. */
|
|
38
|
-
forget(queryID: string): void;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Learns what it costs a client group to read a batch of changes, apart from
|
|
42
|
-
* pushing them through its queries, and estimates from it what reading the
|
|
43
|
-
* next one would cost.
|
|
44
|
-
*
|
|
45
|
-
* Reading has three parts, which do not cost the same entries (see
|
|
46
|
-
* {@link ReadParts}): walking the change log, parsing the entries that
|
|
47
|
-
* the walk returns, and looking up the rows of the entries of the tables
|
|
48
|
-
* that are read. What each costs is learned per entry that it was done for.
|
|
49
|
-
* A cost learned per entry of some other count is only right for a batch
|
|
50
|
-
* with the same mix of entries: charged to the entries that are pushed, for
|
|
51
|
-
* instance, the parsing of a batch that is mostly of tables that no query
|
|
52
|
-
* reads makes the next batch that is not look many times as expensive as it
|
|
53
|
-
* is.
|
|
54
|
-
*
|
|
55
|
-
* No query can be cut off for what this costs, as it is not a cost of any
|
|
56
|
-
* one query. It is what pushing costs all of them together, on top of what
|
|
57
|
-
* it costs each (see {@link shouldRebuildInsteadOfReading}).
|
|
58
|
-
*/
|
|
59
|
-
export declare class ReadCostEstimator {
|
|
60
|
-
#private;
|
|
61
|
-
/**
|
|
62
|
-
* Records what reading a batch cost. Only for a batch that was read to
|
|
63
|
-
* its end.
|
|
64
|
-
*
|
|
65
|
-
* @param timeMs The time spent on each part of reading the batch.
|
|
66
|
-
* @param entries The entries that each part was done for.
|
|
67
|
-
*/
|
|
68
|
-
record(timeMs: ReadParts, entries: ReadParts): void;
|
|
69
|
-
/**
|
|
70
|
-
* The estimated time to read a batch, or `undefined` if none has been
|
|
71
|
-
* read yet.
|
|
72
|
-
*
|
|
73
|
-
* @param entries The entries that each part of reading the batch would be
|
|
74
|
-
* done for.
|
|
75
|
-
*/
|
|
76
|
-
estimate(entries: ReadParts): number | undefined;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* A number for each part of reading a batch of changes: the entries of the
|
|
80
|
-
* change log that the part is done for, or the time that it takes.
|
|
81
|
-
*/
|
|
82
|
-
export type ReadParts = {
|
|
83
|
-
/**
|
|
84
|
-
* Walking the change log, which is done for every entry since the
|
|
85
|
-
* previous snapshot, whether or not the entry is of a table that is read:
|
|
86
|
-
* the entries are in the order they were committed in, not grouped by
|
|
87
|
-
* table.
|
|
88
|
-
*/
|
|
89
|
-
readonly walk: number;
|
|
90
|
-
/**
|
|
91
|
-
* Parsing, which is done for every entry that the walk returns. That is
|
|
92
|
-
* all of them, unless the walk is told which tables are read.
|
|
93
|
-
*/
|
|
94
|
-
readonly parse: number;
|
|
95
|
-
/**
|
|
96
|
-
* Looking up the row in both snapshots, which is done for every entry of
|
|
97
|
-
* a table that is read. This includes the entries that then turn out to
|
|
98
|
-
* change nothing (e.g. a row inserted and deleted since the previous
|
|
99
|
-
* snapshot).
|
|
100
|
-
*/
|
|
101
|
-
readonly lookup: number;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Whether the queries that are left to push a batch to should all be
|
|
105
|
-
* hydrated again instead, without the batch being read: when reading it and
|
|
106
|
-
* pushing it to them is estimated to cost at least `margin` times what
|
|
107
|
-
* hydrating them does.
|
|
108
|
-
*
|
|
109
|
-
* This is {@link shouldStartOnRebuild} for the queries together, with what
|
|
110
|
-
* reading the batch costs added to what pushing it costs each of them. A
|
|
111
|
-
* query that few of the batch's changes reach is cheap to push to, but the
|
|
112
|
-
* whole batch still has to be walked to find those changes.
|
|
113
|
-
*
|
|
114
|
-
* @param estimatedReadMs `undefined` if there is no estimate, in which case
|
|
115
|
-
* the batch is read.
|
|
116
|
-
* @param queries What pushing the batch is estimated to cost each query
|
|
117
|
-
* (nothing, if it has no estimate), and what hydrating it took.
|
|
118
|
-
*/
|
|
119
|
-
export declare function shouldRebuildInsteadOfReading(estimatedReadMs: number | undefined, queries: Iterable<{
|
|
120
|
-
readonly estimatedPushMs: number | undefined;
|
|
121
|
-
readonly hydrationTimeMs: number;
|
|
122
|
-
}>, margin: number): boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Whether a query should start an advancement on rebuild, i.e. be hydrated
|
|
125
|
-
* again without being pushed any of the advancement's changes: when pushing
|
|
126
|
-
* them is estimated to cost at least `margin` times what hydrating it does.
|
|
127
|
-
*
|
|
128
|
-
* The margin is for the imprecision of the estimate. A query without one
|
|
129
|
-
* starts on push.
|
|
130
|
-
*/
|
|
131
|
-
export declare function shouldStartOnRebuild(estimatedPushMs: number | undefined, hydrationTimeMs: number, margin: number): boolean;
|
|
132
|
-
//# sourceMappingURL=push-cost.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"push-cost.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/push-cost.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;GAUG;AACH,qBAAa,iBAAiB;;IAI5B;;;;;;;;;;;;OAYG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EACxB,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EACtD,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1C,IAAI,CAmBN;IAED;;;;;;;OAOG;IACH,QAAQ,CACN,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EACxB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACnC,MAAM,GAAG,SAAS,CAU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