@fluidframework/container-runtime 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.1
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/CHANGELOG.md +18 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +9 -1
- package/api-report/container-runtime.api.md +124 -107
- package/dist/blobManager.d.ts +4 -4
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +1473 -0
- package/dist/container-runtime-beta.d.ts +300 -0
- package/dist/container-runtime-public.d.ts +300 -0
- package/dist/container-runtime-untrimmed.d.ts +1836 -0
- package/dist/containerRuntime.d.ts +30 -30
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +62 -40
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -1
- package/dist/dataStoreRegistry.js +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +10 -15
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +77 -40
- package/dist/dataStores.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +41 -13
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +215 -78
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +34 -37
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +121 -46
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +26 -18
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +18 -25
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +29 -45
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +0 -5
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +14 -42
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts +11 -5
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +43 -19
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +4 -5
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +15 -7
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +6 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +1 -0
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +1 -0
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -1
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +2 -2
- package/dist/summary/runWhileConnectedCoordinator.js +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/summarizer.d.ts +1 -1
- package/dist/summary/summarizer.js +1 -1
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +30 -30
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +10 -10
- package/dist/summary/summaryCollection.js +1 -1
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +3 -3
- package/dist/summary/summaryFormat.js.map +1 -1
- package/lib/blobManager.d.ts +4 -4
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js.map +1 -1
- package/lib/container-runtime-alpha.d.ts +1473 -0
- package/lib/container-runtime-beta.d.ts +300 -0
- package/lib/container-runtime-public.d.ts +300 -0
- package/lib/container-runtime-untrimmed.d.ts +1836 -0
- package/lib/containerRuntime.d.ts +30 -30
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +64 -42
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +1 -1
- package/lib/dataStoreRegistry.js +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +10 -15
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +80 -43
- package/lib/dataStores.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +41 -13
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +217 -80
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +37 -40
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +121 -46
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +25 -17
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +18 -25
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +27 -43
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +0 -5
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +15 -43
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.d.ts +11 -5
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +43 -19
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/index.d.ts +14 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +15 -1
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +15 -7
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +6 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +1 -0
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +1 -0
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -1
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +2 -2
- package/lib/summary/runWhileConnectedCoordinator.js +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/summarizer.d.ts +1 -1
- package/lib/summary/summarizer.js +1 -1
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +30 -30
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +10 -10
- package/lib/summary/summaryCollection.js +1 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +3 -3
- package/lib/summary/summaryFormat.js.map +1 -1
- package/package.json +42 -19
- package/src/blobManager.ts +5 -5
- package/src/containerRuntime.ts +86 -56
- package/src/dataStoreRegistry.ts +1 -1
- package/src/dataStores.ts +140 -69
- package/src/gc/garbageCollection.md +14 -15
- package/src/gc/garbageCollection.ts +256 -96
- package/src/gc/gcConfigs.ts +50 -52
- package/src/gc/gcDefinitions.ts +137 -52
- package/src/gc/gcHelpers.ts +31 -52
- package/src/gc/gcTelemetry.ts +16 -57
- package/src/gc/gcUnreferencedStateTracker.ts +61 -22
- package/src/gc/index.ts +6 -4
- package/src/index.ts +19 -1
- package/src/messageTypes.ts +19 -4
- package/src/opLifecycle/definitions.ts +1 -1
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +1 -0
- package/src/summary/orderedClientElection.ts +1 -1
- package/src/summary/runWhileConnectedCoordinator.ts +2 -2
- package/src/summary/summarizer.ts +1 -1
- package/src/summary/summarizerTypes.ts +30 -30
- package/src/summary/summaryCollection.ts +10 -10
- package/src/summary/summaryFormat.ts +3 -3
- package/dist/id-compressor/appendOnlySortedMap.d.ts +0 -124
- package/dist/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
- package/dist/id-compressor/appendOnlySortedMap.js +0 -318
- package/dist/id-compressor/appendOnlySortedMap.js.map +0 -1
- package/dist/id-compressor/finalSpace.d.ts +0 -29
- package/dist/id-compressor/finalSpace.d.ts.map +0 -1
- package/dist/id-compressor/finalSpace.js +0 -62
- package/dist/id-compressor/finalSpace.js.map +0 -1
- package/dist/id-compressor/idCompressor.d.ts +0 -54
- package/dist/id-compressor/idCompressor.d.ts.map +0 -1
- package/dist/id-compressor/idCompressor.js +0 -495
- package/dist/id-compressor/idCompressor.js.map +0 -1
- package/dist/id-compressor/identifiers.d.ts +0 -32
- package/dist/id-compressor/identifiers.d.ts.map +0 -1
- package/dist/id-compressor/identifiers.js +0 -15
- package/dist/id-compressor/identifiers.js.map +0 -1
- package/dist/id-compressor/index.d.ts +0 -13
- package/dist/id-compressor/index.d.ts.map +0 -1
- package/dist/id-compressor/index.js +0 -32
- package/dist/id-compressor/index.js.map +0 -1
- package/dist/id-compressor/persistanceUtilities.d.ts +0 -22
- package/dist/id-compressor/persistanceUtilities.d.ts.map +0 -1
- package/dist/id-compressor/persistanceUtilities.js +0 -43
- package/dist/id-compressor/persistanceUtilities.js.map +0 -1
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
- package/dist/id-compressor/sessionSpaceNormalizer.js +0 -80
- package/dist/id-compressor/sessionSpaceNormalizer.js.map +0 -1
- package/dist/id-compressor/sessions.d.ts +0 -115
- package/dist/id-compressor/sessions.d.ts.map +0 -1
- package/dist/id-compressor/sessions.js +0 -305
- package/dist/id-compressor/sessions.js.map +0 -1
- package/dist/id-compressor/utilities.d.ts +0 -52
- package/dist/id-compressor/utilities.d.ts.map +0 -1
- package/dist/id-compressor/utilities.js +0 -169
- package/dist/id-compressor/utilities.js.map +0 -1
- package/lib/id-compressor/appendOnlySortedMap.d.ts +0 -124
- package/lib/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
- package/lib/id-compressor/appendOnlySortedMap.js +0 -314
- package/lib/id-compressor/appendOnlySortedMap.js.map +0 -1
- package/lib/id-compressor/finalSpace.d.ts +0 -29
- package/lib/id-compressor/finalSpace.d.ts.map +0 -1
- package/lib/id-compressor/finalSpace.js +0 -58
- package/lib/id-compressor/finalSpace.js.map +0 -1
- package/lib/id-compressor/idCompressor.d.ts +0 -54
- package/lib/id-compressor/idCompressor.d.ts.map +0 -1
- package/lib/id-compressor/idCompressor.js +0 -491
- package/lib/id-compressor/idCompressor.js.map +0 -1
- package/lib/id-compressor/identifiers.d.ts +0 -32
- package/lib/id-compressor/identifiers.d.ts.map +0 -1
- package/lib/id-compressor/identifiers.js +0 -11
- package/lib/id-compressor/identifiers.js.map +0 -1
- package/lib/id-compressor/index.d.ts +0 -13
- package/lib/id-compressor/index.d.ts.map +0 -1
- package/lib/id-compressor/index.js +0 -13
- package/lib/id-compressor/index.js.map +0 -1
- package/lib/id-compressor/persistanceUtilities.d.ts +0 -22
- package/lib/id-compressor/persistanceUtilities.d.ts.map +0 -1
- package/lib/id-compressor/persistanceUtilities.js +0 -34
- package/lib/id-compressor/persistanceUtilities.js.map +0 -1
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
- package/lib/id-compressor/sessionSpaceNormalizer.js +0 -76
- package/lib/id-compressor/sessionSpaceNormalizer.js.map +0 -1
- package/lib/id-compressor/sessions.d.ts +0 -115
- package/lib/id-compressor/sessions.d.ts.map +0 -1
- package/lib/id-compressor/sessions.js +0 -290
- package/lib/id-compressor/sessions.js.map +0 -1
- package/lib/id-compressor/utilities.d.ts +0 -52
- package/lib/id-compressor/utilities.d.ts.map +0 -1
- package/lib/id-compressor/utilities.js +0 -151
- package/lib/id-compressor/utilities.js.map +0 -1
- package/src/id-compressor/README.md +0 -3
- package/src/id-compressor/appendOnlySortedMap.ts +0 -366
- package/src/id-compressor/finalSpace.ts +0 -67
- package/src/id-compressor/idCompressor.ts +0 -630
- package/src/id-compressor/identifiers.ts +0 -42
- package/src/id-compressor/index.ts +0 -26
- package/src/id-compressor/persistanceUtilities.ts +0 -58
- package/src/id-compressor/sessionSpaceNormalizer.ts +0 -83
- package/src/id-compressor/sessions.ts +0 -405
- package/src/id-compressor/utilities.ts +0 -190
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/id-compressor/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACN,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SessionSpaceNormalizer = exports.AppendOnlySortedMap = exports.writeNumericUuid = exports.readNumericUuid = exports.isStableId = exports.generateStableId = exports.assertIsStableId = exports.addNumericUuids = exports.subtractNumericUuids = exports.stableIdFromNumericUuid = exports.offsetNumericUuid = exports.numericUuidFromStableId = exports.assertIsSessionId = exports.createSessionId = exports.compareFiniteNumbers = exports.IdCompressor = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* Exports for `id-compressor`
|
|
10
|
-
*/
|
|
11
|
-
var idCompressor_1 = require("./idCompressor");
|
|
12
|
-
Object.defineProperty(exports, "IdCompressor", { enumerable: true, get: function () { return idCompressor_1.IdCompressor; } });
|
|
13
|
-
var utilities_1 = require("./utilities");
|
|
14
|
-
Object.defineProperty(exports, "compareFiniteNumbers", { enumerable: true, get: function () { return utilities_1.compareFiniteNumbers; } });
|
|
15
|
-
Object.defineProperty(exports, "createSessionId", { enumerable: true, get: function () { return utilities_1.createSessionId; } });
|
|
16
|
-
Object.defineProperty(exports, "assertIsSessionId", { enumerable: true, get: function () { return utilities_1.assertIsSessionId; } });
|
|
17
|
-
Object.defineProperty(exports, "numericUuidFromStableId", { enumerable: true, get: function () { return utilities_1.numericUuidFromStableId; } });
|
|
18
|
-
Object.defineProperty(exports, "offsetNumericUuid", { enumerable: true, get: function () { return utilities_1.offsetNumericUuid; } });
|
|
19
|
-
Object.defineProperty(exports, "stableIdFromNumericUuid", { enumerable: true, get: function () { return utilities_1.stableIdFromNumericUuid; } });
|
|
20
|
-
Object.defineProperty(exports, "subtractNumericUuids", { enumerable: true, get: function () { return utilities_1.subtractNumericUuids; } });
|
|
21
|
-
Object.defineProperty(exports, "addNumericUuids", { enumerable: true, get: function () { return utilities_1.addNumericUuids; } });
|
|
22
|
-
Object.defineProperty(exports, "assertIsStableId", { enumerable: true, get: function () { return utilities_1.assertIsStableId; } });
|
|
23
|
-
Object.defineProperty(exports, "generateStableId", { enumerable: true, get: function () { return utilities_1.generateStableId; } });
|
|
24
|
-
Object.defineProperty(exports, "isStableId", { enumerable: true, get: function () { return utilities_1.isStableId; } });
|
|
25
|
-
var persistanceUtilities_1 = require("./persistanceUtilities");
|
|
26
|
-
Object.defineProperty(exports, "readNumericUuid", { enumerable: true, get: function () { return persistanceUtilities_1.readNumericUuid; } });
|
|
27
|
-
Object.defineProperty(exports, "writeNumericUuid", { enumerable: true, get: function () { return persistanceUtilities_1.writeNumericUuid; } });
|
|
28
|
-
var appendOnlySortedMap_1 = require("./appendOnlySortedMap");
|
|
29
|
-
Object.defineProperty(exports, "AppendOnlySortedMap", { enumerable: true, get: function () { return appendOnlySortedMap_1.AppendOnlySortedMap; } });
|
|
30
|
-
var sessionSpaceNormalizer_1 = require("./sessionSpaceNormalizer");
|
|
31
|
-
Object.defineProperty(exports, "SessionSpaceNormalizer", { enumerable: true, get: function () { return sessionSpaceNormalizer_1.SessionSpaceNormalizer; } });
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/id-compressor/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AAEH,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,yCAYqB;AAXpB,iHAAA,oBAAoB,OAAA;AACpB,4GAAA,eAAe,OAAA;AACf,8GAAA,iBAAiB,OAAA;AACjB,oHAAA,uBAAuB,OAAA;AACvB,8GAAA,iBAAiB,OAAA;AACjB,oHAAA,uBAAuB,OAAA;AACvB,iHAAA,oBAAoB,OAAA;AACpB,4GAAA,eAAe,OAAA;AACf,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAChB,uGAAA,UAAU,OAAA;AAEX,+DAA2E;AAAlE,uHAAA,eAAe,OAAA;AAAE,wHAAA,gBAAgB,OAAA;AAC1C,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Exports for `id-compressor`\n */\n\nexport { IdCompressor } from \"./idCompressor\";\nexport {\n\tcompareFiniteNumbers,\n\tcreateSessionId,\n\tassertIsSessionId,\n\tnumericUuidFromStableId,\n\toffsetNumericUuid,\n\tstableIdFromNumericUuid,\n\tsubtractNumericUuids,\n\taddNumericUuids,\n\tassertIsStableId,\n\tgenerateStableId,\n\tisStableId,\n} from \"./utilities\";\nexport { readNumericUuid, writeNumericUuid } from \"./persistanceUtilities\";\nexport { AppendOnlySortedMap } from \"./appendOnlySortedMap\";\nexport { SessionSpaceNormalizer } from \"./sessionSpaceNormalizer\";\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { NumericUuid } from "./identifiers";
|
|
6
|
-
export declare function writeNumber(buffer: Float64Array, index: number, value: number): number;
|
|
7
|
-
export declare function writeNumericUuid(buffer: BigUint64Array, index: number, value: NumericUuid): number;
|
|
8
|
-
export declare function writeBoolean(buffer: Float64Array, index: number, value: boolean): number;
|
|
9
|
-
/**
|
|
10
|
-
* Helper type to allow returning a value when reading as well as incrementing an index to make
|
|
11
|
-
* deserialization easier.
|
|
12
|
-
* Should be constructed with two views of the same buffer and index set to 0.
|
|
13
|
-
*/
|
|
14
|
-
export interface Index {
|
|
15
|
-
bufferFloat: Float64Array;
|
|
16
|
-
bufferUint: BigUint64Array;
|
|
17
|
-
index: number;
|
|
18
|
-
}
|
|
19
|
-
export declare function readNumber(index: Index): number;
|
|
20
|
-
export declare function readNumericUuid(index: Index): NumericUuid;
|
|
21
|
-
export declare function readBoolean(index: Index): boolean;
|
|
22
|
-
//# sourceMappingURL=persistanceUtilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persistanceUtilities.d.ts","sourceRoot":"","sources":["../../src/id-compressor/persistanceUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGtF;AAED,wBAAgB,gBAAgB,CAC/B,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,WAAW,GAChB,MAAM,CAIR;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAExF;AAED;;;;GAIG;AACH,MAAM,WAAW,KAAK;IACrB,WAAW,EAAE,YAAY,CAAC;IAC1B,UAAU,EAAE,cAAc,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAI/C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAMzD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAEjD"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.readBoolean = exports.readNumericUuid = exports.readNumber = exports.writeBoolean = exports.writeNumericUuid = exports.writeNumber = void 0;
|
|
8
|
-
const halfNumeric = BigInt("0xFFFFFFFFFFFFFFFF");
|
|
9
|
-
const sixtyFour = BigInt(64);
|
|
10
|
-
function writeNumber(buffer, index, value) {
|
|
11
|
-
buffer[index] = value;
|
|
12
|
-
return index + 1;
|
|
13
|
-
}
|
|
14
|
-
exports.writeNumber = writeNumber;
|
|
15
|
-
function writeNumericUuid(buffer, index, value) {
|
|
16
|
-
buffer[index] = value & halfNumeric;
|
|
17
|
-
buffer[index + 1] = value >> sixtyFour;
|
|
18
|
-
return index + 2; // UUID values are 16 bytes.
|
|
19
|
-
}
|
|
20
|
-
exports.writeNumericUuid = writeNumericUuid;
|
|
21
|
-
function writeBoolean(buffer, index, value) {
|
|
22
|
-
return writeNumber(buffer, index, value ? 1 : 0);
|
|
23
|
-
}
|
|
24
|
-
exports.writeBoolean = writeBoolean;
|
|
25
|
-
function readNumber(index) {
|
|
26
|
-
const value = index.bufferFloat[index.index];
|
|
27
|
-
index.index += 1;
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
exports.readNumber = readNumber;
|
|
31
|
-
function readNumericUuid(index) {
|
|
32
|
-
const lowerHalf = index.bufferUint[index.index];
|
|
33
|
-
const upperHalf = index.bufferUint[index.index + 1];
|
|
34
|
-
const value = (upperHalf << sixtyFour) | lowerHalf;
|
|
35
|
-
index.index += 2;
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
exports.readNumericUuid = readNumericUuid;
|
|
39
|
-
function readBoolean(index) {
|
|
40
|
-
return readNumber(index) === 1;
|
|
41
|
-
}
|
|
42
|
-
exports.readBoolean = readBoolean;
|
|
43
|
-
//# sourceMappingURL=persistanceUtilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"persistanceUtilities.js","sourceRoot":"","sources":["../../src/id-compressor/persistanceUtilities.ts"],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,SAAS,CAAC;IACnD,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;IACjB,OAAO,KAAoB,CAAC;AAC7B,CAAC;AAND,0CAMC;AAED,SAAgB,WAAW,CAAC,KAAY;IACvC,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAFD,kCAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/* eslint-disable no-bitwise */\nimport { NumericUuid } from \"./identifiers\";\n\nconst halfNumeric = BigInt(\"0xFFFFFFFFFFFFFFFF\");\nconst sixtyFour = BigInt(64);\n\nexport function writeNumber(buffer: Float64Array, index: number, value: number): number {\n\tbuffer[index] = value;\n\treturn index + 1;\n}\n\nexport function writeNumericUuid(\n\tbuffer: BigUint64Array,\n\tindex: number,\n\tvalue: NumericUuid,\n): number {\n\tbuffer[index] = value & halfNumeric;\n\tbuffer[index + 1] = value >> sixtyFour;\n\treturn index + 2; // UUID values are 16 bytes.\n}\n\nexport function writeBoolean(buffer: Float64Array, index: number, value: boolean): number {\n\treturn writeNumber(buffer, index, value ? 1 : 0);\n}\n\n/**\n * Helper type to allow returning a value when reading as well as incrementing an index to make\n * deserialization easier.\n * Should be constructed with two views of the same buffer and index set to 0.\n */\nexport interface Index {\n\tbufferFloat: Float64Array;\n\tbufferUint: BigUint64Array;\n\tindex: number;\n}\n\nexport function readNumber(index: Index): number {\n\tconst value = index.bufferFloat[index.index];\n\tindex.index += 1;\n\treturn value;\n}\n\nexport function readNumericUuid(index: Index): NumericUuid {\n\tconst lowerHalf = index.bufferUint[index.index];\n\tconst upperHalf = index.bufferUint[index.index + 1];\n\tconst value = (upperHalf << sixtyFour) | lowerHalf;\n\tindex.index += 2;\n\treturn value as NumericUuid;\n}\n\nexport function readBoolean(index: Index): boolean {\n\treturn readNumber(index) === 1;\n}\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { AppendOnlySortedMap } from "./appendOnlySortedMap";
|
|
6
|
-
import { LocalCompressedId } from "./identifiers";
|
|
7
|
-
/**
|
|
8
|
-
* The `SessionSpaceNormalizer` tracks the form of the IDs created by the local session.
|
|
9
|
-
* More precisely, it acts as a set of all `LocalCompressedId`s created by the local session and allows querying whether a specific
|
|
10
|
-
* ID was produced by the local session. This information can be used to determine whether the nth ID created by the local session
|
|
11
|
-
* was produced as a local ID (negative) or a final ID (positive).
|
|
12
|
-
*
|
|
13
|
-
* The local and final forms of IDs made by a session can be thought of as two equal-length sparse arrays, aligned such
|
|
14
|
-
* that normalizeLocalToFinal(locals[i]) === finals[i] and vice versa.
|
|
15
|
-
* Below is an example to illustrate how various mappings can arise:
|
|
16
|
-
*
|
|
17
|
-
* ```
|
|
18
|
-
* +- Creation Index
|
|
19
|
-
* / +- Locals
|
|
20
|
-
* / / +- Finals
|
|
21
|
-
* / / /
|
|
22
|
-
* ---+-----+----
|
|
23
|
-
* 0 | -1 | 0 -|___ Two IDs are allocated as locals since no cluster exists. A new cluster is created when acked.
|
|
24
|
-
* 1 | -2 | 1 -|
|
|
25
|
-
* 2 | | 2 -|
|
|
26
|
-
* 3 | | 3 --|-- Three more IDs are allocated as finals eagerly since a cluster exists with available capacity.
|
|
27
|
-
* 4 | | 4 -|
|
|
28
|
-
* 5 | -6 | 10 ----- One ID is allocated as a local (it overflows the existing cluster) and a new cluster is created after ack.
|
|
29
|
-
* 6 | | 11 ----- This ID (and the subsequent few) is allocated eagerly as a final ID into the existing cluster.
|
|
30
|
-
* 7 | | 12
|
|
31
|
-
* 8 | | 13
|
|
32
|
-
* 9 | | 14
|
|
33
|
-
* 10 | -11 | ----- The cluster is out of room, so a local ID is allocated. It has no corresponding final ID since it has not been acked.
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* This class stores the set of local IDs and thus their indices, as local IDs are essentially negative offsets from the first ID.
|
|
37
|
-
* The form (local or final) of a given ID index (for example, the 5th ID made by the local session) can be deduced from this information.
|
|
38
|
-
*/
|
|
39
|
-
export declare class SessionSpaceNormalizer {
|
|
40
|
-
private readonly localIdRanges;
|
|
41
|
-
get idRanges(): Pick<AppendOnlySortedMap<number, number>, "size" | "entries">;
|
|
42
|
-
addLocalRange(baseGenCount: number, count: number): void;
|
|
43
|
-
contains(query: LocalCompressedId): boolean;
|
|
44
|
-
equals(other: SessionSpaceNormalizer): boolean;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=sessionSpaceNormalizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sessionSpaceNormalizer.d.ts","sourceRoot":"","sources":["../../src/id-compressor/sessionSpaceNormalizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,sBAAsB;IAGlC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiE;IAE/F,IAAW,QAAQ,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAEnF;IAEM,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAcxD,QAAQ,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO;IAY3C,MAAM,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO;CAMrD"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SessionSpaceNormalizer = void 0;
|
|
8
|
-
const appendOnlySortedMap_1 = require("./appendOnlySortedMap");
|
|
9
|
-
const utilities_1 = require("./utilities");
|
|
10
|
-
/**
|
|
11
|
-
* The `SessionSpaceNormalizer` tracks the form of the IDs created by the local session.
|
|
12
|
-
* More precisely, it acts as a set of all `LocalCompressedId`s created by the local session and allows querying whether a specific
|
|
13
|
-
* ID was produced by the local session. This information can be used to determine whether the nth ID created by the local session
|
|
14
|
-
* was produced as a local ID (negative) or a final ID (positive).
|
|
15
|
-
*
|
|
16
|
-
* The local and final forms of IDs made by a session can be thought of as two equal-length sparse arrays, aligned such
|
|
17
|
-
* that normalizeLocalToFinal(locals[i]) === finals[i] and vice versa.
|
|
18
|
-
* Below is an example to illustrate how various mappings can arise:
|
|
19
|
-
*
|
|
20
|
-
* ```
|
|
21
|
-
* +- Creation Index
|
|
22
|
-
* / +- Locals
|
|
23
|
-
* / / +- Finals
|
|
24
|
-
* / / /
|
|
25
|
-
* ---+-----+----
|
|
26
|
-
* 0 | -1 | 0 -|___ Two IDs are allocated as locals since no cluster exists. A new cluster is created when acked.
|
|
27
|
-
* 1 | -2 | 1 -|
|
|
28
|
-
* 2 | | 2 -|
|
|
29
|
-
* 3 | | 3 --|-- Three more IDs are allocated as finals eagerly since a cluster exists with available capacity.
|
|
30
|
-
* 4 | | 4 -|
|
|
31
|
-
* 5 | -6 | 10 ----- One ID is allocated as a local (it overflows the existing cluster) and a new cluster is created after ack.
|
|
32
|
-
* 6 | | 11 ----- This ID (and the subsequent few) is allocated eagerly as a final ID into the existing cluster.
|
|
33
|
-
* 7 | | 12
|
|
34
|
-
* 8 | | 13
|
|
35
|
-
* 9 | | 14
|
|
36
|
-
* 10 | -11 | ----- The cluster is out of room, so a local ID is allocated. It has no corresponding final ID since it has not been acked.
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* This class stores the set of local IDs and thus their indices, as local IDs are essentially negative offsets from the first ID.
|
|
40
|
-
* The form (local or final) of a given ID index (for example, the 5th ID made by the local session) can be deduced from this information.
|
|
41
|
-
*/
|
|
42
|
-
class SessionSpaceNormalizer {
|
|
43
|
-
constructor() {
|
|
44
|
-
// Run-length encoding of IDs that were generated as local IDs. They are stored as a list of tuples (genCount, count)
|
|
45
|
-
// that are sorted on the genCount so that contains checks can use a binary search.
|
|
46
|
-
this.localIdRanges = new appendOnlySortedMap_1.AppendOnlySortedMap(utilities_1.compareFiniteNumbers);
|
|
47
|
-
}
|
|
48
|
-
get idRanges() {
|
|
49
|
-
return this.localIdRanges;
|
|
50
|
-
}
|
|
51
|
-
addLocalRange(baseGenCount, count) {
|
|
52
|
-
const last = this.localIdRanges.last();
|
|
53
|
-
if (last !== undefined) {
|
|
54
|
-
const [lastGenCount, lastCount] = last;
|
|
55
|
-
// Check to see if the added run of local IDs is contiguous with the last range added.
|
|
56
|
-
// If it is, simply merge them (this is the common case).
|
|
57
|
-
if (lastGenCount + lastCount === baseGenCount) {
|
|
58
|
-
this.localIdRanges.replaceLast(lastGenCount, lastCount + count);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
this.localIdRanges.append(baseGenCount, count);
|
|
63
|
-
}
|
|
64
|
-
contains(query) {
|
|
65
|
-
const genCount = (0, utilities_1.genCountFromLocalId)(query);
|
|
66
|
-
const containingBlock = this.localIdRanges.getPairOrNextLower(genCount);
|
|
67
|
-
if (containingBlock !== undefined) {
|
|
68
|
-
const [baseGenCount, count] = containingBlock;
|
|
69
|
-
if (genCount <= baseGenCount + (count - 1)) {
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
equals(other) {
|
|
76
|
-
return this.localIdRanges.equals(other.localIdRanges, (countA, countB) => countA === countB);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.SessionSpaceNormalizer = SessionSpaceNormalizer;
|
|
80
|
-
//# sourceMappingURL=sessionSpaceNormalizer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sessionSpaceNormalizer.js","sourceRoot":"","sources":["../../src/id-compressor/sessionSpaceNormalizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA4D;AAE5D,2CAAwE;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAa,sBAAsB;IAAnC;QACC,qHAAqH;QACrH,mFAAmF;QAClE,kBAAa,GAAG,IAAI,yCAAmB,CAAiB,gCAAoB,CAAC,CAAC;IAsChG,CAAC;IApCA,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IAEM,aAAa,CAAC,YAAoB,EAAE,KAAa;QACvD,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QACvC,IAAI,IAAI,KAAK,SAAS,EAAE;YACvB,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;YACvC,sFAAsF;YACtF,yDAAyD;YACzD,IAAI,YAAY,GAAG,SAAS,KAAK,YAAY,EAAE;gBAC9C,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,YAAY,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC;gBAChE,OAAO;aACP;SACD;QACD,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAEM,QAAQ,CAAC,KAAwB;QACvC,MAAM,QAAQ,GAAG,IAAA,+BAAmB,EAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACxE,IAAI,eAAe,KAAK,SAAS,EAAE;YAClC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,eAAe,CAAC;YAC9C,IAAI,QAAQ,IAAI,YAAY,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE;gBAC3C,OAAO,IAAI,CAAC;aACZ;SACD;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,MAAM,CAAC,KAA6B;QAC1C,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAC/B,KAAK,CAAC,aAAa,EACnB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,MAAM,CACrC,CAAC;IACH,CAAC;CACD;AAzCD,wDAyCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AppendOnlySortedMap } from \"./appendOnlySortedMap\";\nimport { LocalCompressedId } from \"./identifiers\";\nimport { compareFiniteNumbers, genCountFromLocalId } from \"./utilities\";\n\n/**\n * The `SessionSpaceNormalizer` tracks the form of the IDs created by the local session.\n * More precisely, it acts as a set of all `LocalCompressedId`s created by the local session and allows querying whether a specific\n * ID was produced by the local session. This information can be used to determine whether the nth ID created by the local session\n * was produced as a local ID (negative) or a final ID (positive).\n *\n * The local and final forms of IDs made by a session can be thought of as two equal-length sparse arrays, aligned such\n * that normalizeLocalToFinal(locals[i]) === finals[i] and vice versa.\n * Below is an example to illustrate how various mappings can arise:\n *\n * ```\n * +- Creation Index\n * / +- Locals\n * / / +- Finals\n * / / /\n * ---+-----+----\n * 0 | -1 | 0 -|___ Two IDs are allocated as locals since no cluster exists. A new cluster is created when acked.\n * 1 | -2 | 1 -|\n * 2 | | 2 -|\n * 3 | | 3 --|-- Three more IDs are allocated as finals eagerly since a cluster exists with available capacity.\n * 4 | | 4 -|\n * 5 | -6 | 10 ----- One ID is allocated as a local (it overflows the existing cluster) and a new cluster is created after ack.\n * 6 | | 11 ----- This ID (and the subsequent few) is allocated eagerly as a final ID into the existing cluster.\n * 7 | | 12\n * 8 | | 13\n * 9 | | 14\n * 10 | -11 | ----- The cluster is out of room, so a local ID is allocated. It has no corresponding final ID since it has not been acked.\n * ```\n *\n * This class stores the set of local IDs and thus their indices, as local IDs are essentially negative offsets from the first ID.\n * The form (local or final) of a given ID index (for example, the 5th ID made by the local session) can be deduced from this information.\n */\nexport class SessionSpaceNormalizer {\n\t// Run-length encoding of IDs that were generated as local IDs. They are stored as a list of tuples (genCount, count)\n\t// that are sorted on the genCount so that contains checks can use a binary search.\n\tprivate readonly localIdRanges = new AppendOnlySortedMap<number, number>(compareFiniteNumbers);\n\n\tpublic get idRanges(): Pick<AppendOnlySortedMap<number, number>, \"size\" | \"entries\"> {\n\t\treturn this.localIdRanges;\n\t}\n\n\tpublic addLocalRange(baseGenCount: number, count: number): void {\n\t\tconst last = this.localIdRanges.last();\n\t\tif (last !== undefined) {\n\t\t\tconst [lastGenCount, lastCount] = last;\n\t\t\t// Check to see if the added run of local IDs is contiguous with the last range added.\n\t\t\t// If it is, simply merge them (this is the common case).\n\t\t\tif (lastGenCount + lastCount === baseGenCount) {\n\t\t\t\tthis.localIdRanges.replaceLast(lastGenCount, lastCount + count);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.localIdRanges.append(baseGenCount, count);\n\t}\n\n\tpublic contains(query: LocalCompressedId): boolean {\n\t\tconst genCount = genCountFromLocalId(query);\n\t\tconst containingBlock = this.localIdRanges.getPairOrNextLower(genCount);\n\t\tif (containingBlock !== undefined) {\n\t\t\tconst [baseGenCount, count] = containingBlock;\n\t\t\tif (genCount <= baseGenCount + (count - 1)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic equals(other: SessionSpaceNormalizer): boolean {\n\t\treturn this.localIdRanges.equals(\n\t\t\tother.localIdRanges,\n\t\t\t(countA, countB) => countA === countB,\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { SessionId, StableId } from "@fluidframework/runtime-definitions";
|
|
6
|
-
import { FinalCompressedId, LocalCompressedId, NumericUuid } from "./identifiers";
|
|
7
|
-
/**
|
|
8
|
-
* A collection of all sessions known to the compressor (i.e. all finalized/acked allocated UUIDs and their corresponding local and final forms).
|
|
9
|
-
* This collection of all sessions comprises a distributed document's IDs.
|
|
10
|
-
*/
|
|
11
|
-
export declare class Sessions {
|
|
12
|
-
private readonly uuidSpace;
|
|
13
|
-
private readonly sessionCache;
|
|
14
|
-
constructor(sessions?: [sessionBase: NumericUuid, session: Session][]);
|
|
15
|
-
sessions(): IterableIterator<Session>;
|
|
16
|
-
getOrCreate(sessionId: SessionId): Session;
|
|
17
|
-
get(sessionId: SessionId): Session | undefined;
|
|
18
|
-
getContainingCluster(query: StableId): [cluster: IdCluster, alignedLocal: LocalCompressedId] | undefined;
|
|
19
|
-
clusterCollides(cluster: IdCluster): boolean;
|
|
20
|
-
equals(other: Sessions, includeLocalState: boolean): boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* The IDs created by a specific session, stored as a cluster chain to allow for fast conversions.
|
|
24
|
-
*/
|
|
25
|
-
export declare class Session {
|
|
26
|
-
private readonly clusterChain;
|
|
27
|
-
readonly sessionUuid: NumericUuid;
|
|
28
|
-
constructor(sessionId: SessionId | NumericUuid);
|
|
29
|
-
/**
|
|
30
|
-
* Adds a new empty cluster to the cluster chain of this session.
|
|
31
|
-
*/
|
|
32
|
-
addNewCluster(baseFinalId: FinalCompressedId, capacity: number, count: number): IdCluster;
|
|
33
|
-
isEmpty(): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Returns the last cluster in this session's cluster chain, if any.
|
|
36
|
-
*/
|
|
37
|
-
getLastCluster(): IdCluster | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* Converts the local ID from this session to a final ID, if possible.
|
|
40
|
-
* @param includeAllocated - true if the conversion should succeed even if the local ID aligns with a part of the cluster that is allocated but not finalized.
|
|
41
|
-
*/
|
|
42
|
-
tryConvertToFinal(searchLocal: LocalCompressedId, includeAllocated: boolean): FinalCompressedId | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Returns the cluster containing the supplied local ID, if possible.
|
|
45
|
-
* @param includeAllocated - true if the conversion should succeed even if the local ID aligns with a part of the cluster that is allocated but not finalized.
|
|
46
|
-
*/
|
|
47
|
-
getClusterByLocal(localId: LocalCompressedId, includeAllocated: boolean): IdCluster | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Returns the cluster containing the supplied final ID, if possible.
|
|
50
|
-
*/
|
|
51
|
-
getClusterByAllocatedFinal(final: FinalCompressedId): IdCluster | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* Returns the cluster from the supplied cluster chain containing the supplied final ID, if possible.
|
|
54
|
-
* `clusterChain` must be sorted by final/local base ID.
|
|
55
|
-
*/
|
|
56
|
-
static getContainingCluster(finalId: FinalCompressedId, clusterChain: readonly IdCluster[]): IdCluster | undefined;
|
|
57
|
-
static binarySearch<S, T>(search: S, arr: readonly T[], comparator: (a: S, b: T) => number): T | undefined;
|
|
58
|
-
equals(other: Session): boolean;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* A cluster of final (sequenced via consensus), sequentially allocated compressed IDs.
|
|
62
|
-
* A final ID in a cluster decompresses to a sequentially allocated UUID that is the result of adding its offset within
|
|
63
|
-
* the cluster to base UUID for the session that created it.
|
|
64
|
-
*/
|
|
65
|
-
export interface IdCluster {
|
|
66
|
-
/**
|
|
67
|
-
* The session that created this cluster.
|
|
68
|
-
*/
|
|
69
|
-
readonly session: Session;
|
|
70
|
-
/**
|
|
71
|
-
* The first final ID in the cluster.
|
|
72
|
-
*/
|
|
73
|
-
readonly baseFinalId: FinalCompressedId;
|
|
74
|
-
/**
|
|
75
|
-
* The local ID aligned with `baseFinalId`.
|
|
76
|
-
*/
|
|
77
|
-
readonly baseLocalId: LocalCompressedId;
|
|
78
|
-
/**
|
|
79
|
-
* The total number of final IDs reserved for allocation in the cluster.
|
|
80
|
-
* Clusters are reserved in blocks as a performance optimization.
|
|
81
|
-
*/
|
|
82
|
-
capacity: number;
|
|
83
|
-
/**
|
|
84
|
-
* The number of final IDs currently allocated in the cluster.
|
|
85
|
-
*/
|
|
86
|
-
count: number;
|
|
87
|
-
}
|
|
88
|
-
export declare function clustersEqual(a: IdCluster, b: IdCluster): boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Returns the final ID that is aligned with the supplied local ID within a cluster.
|
|
91
|
-
* Includes allocated IDs.
|
|
92
|
-
*/
|
|
93
|
-
export declare function getAlignedFinal(cluster: IdCluster, localWithin: LocalCompressedId): FinalCompressedId | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Returns the local ID that is aligned with the supplied final ID within a cluster.
|
|
96
|
-
* Fails if the supplied ID does not fall within the cluster bounds.
|
|
97
|
-
*/
|
|
98
|
-
export declare function getAlignedLocal(cluster: IdCluster, finalWithin: FinalCompressedId): LocalCompressedId;
|
|
99
|
-
/**
|
|
100
|
-
* Returns the last allocated final ID (i.e. any ID between base final and base final + capacity) within a cluster
|
|
101
|
-
*/
|
|
102
|
-
export declare function lastAllocatedFinal(cluster: IdCluster): FinalCompressedId;
|
|
103
|
-
/**
|
|
104
|
-
* Returns the last allocated final ID (i.e. any ID between base final and base final + count) within a cluster
|
|
105
|
-
*/
|
|
106
|
-
export declare function lastFinalizedFinal(cluster: IdCluster): FinalCompressedId;
|
|
107
|
-
/**
|
|
108
|
-
* Returns the last allocated local ID (i.e. any ID between base local and base local + capacity) within a cluster
|
|
109
|
-
*/
|
|
110
|
-
export declare function lastAllocatedLocal(cluster: IdCluster): LocalCompressedId;
|
|
111
|
-
/**
|
|
112
|
-
* Returns the last allocated local ID (i.e. any ID between base local and base local + count) within a cluster
|
|
113
|
-
*/
|
|
114
|
-
export declare function lastFinalizedLocal(cluster: IdCluster): LocalCompressedId;
|
|
115
|
-
//# sourceMappingURL=sessions.d.ts.map
|
|
@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