@fluidframework/merge-tree 0.57.1 → 0.58.0-55561
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.d.ts +0 -1
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js.map +1 -1
- package/dist/client.d.ts +0 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +8 -29
- package/dist/client.js.map +1 -1
- package/dist/collections.d.ts +0 -3
- package/dist/collections.d.ts.map +1 -1
- package/dist/collections.js +6 -22
- package/dist/collections.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/mergeTree.d.ts +8 -26
- package/dist/mergeTree.d.ts.map +1 -1
- package/dist/mergeTree.js +16 -277
- package/dist/mergeTree.js.map +1 -1
- package/dist/ops.d.ts +0 -6
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +1 -8
- package/dist/ops.js.map +1 -1
- package/dist/partialLengths.d.ts.map +1 -1
- package/dist/partialLengths.js +0 -9
- package/dist/partialLengths.js.map +1 -1
- package/dist/properties.d.ts.map +1 -1
- package/dist/properties.js +2 -15
- package/dist/properties.js.map +1 -1
- package/dist/snapshotlegacy.d.ts.map +1 -1
- package/dist/snapshotlegacy.js +3 -6
- package/dist/snapshotlegacy.js.map +1 -1
- package/dist/textSegment.d.ts.map +1 -1
- package/dist/textSegment.js +0 -14
- package/dist/textSegment.js.map +1 -1
- package/lib/base.d.ts +0 -1
- package/lib/base.d.ts.map +1 -1
- package/lib/base.js.map +1 -1
- package/lib/client.d.ts +0 -2
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +5 -26
- package/lib/client.js.map +1 -1
- package/lib/collections.d.ts +0 -3
- package/lib/collections.d.ts.map +1 -1
- package/lib/collections.js +6 -22
- package/lib/collections.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/mergeTree.d.ts +8 -26
- package/lib/mergeTree.d.ts.map +1 -1
- package/lib/mergeTree.js +15 -274
- package/lib/mergeTree.js.map +1 -1
- package/lib/ops.d.ts +0 -6
- package/lib/ops.d.ts.map +1 -1
- package/lib/ops.js +0 -7
- package/lib/ops.js.map +1 -1
- package/lib/partialLengths.d.ts.map +1 -1
- package/lib/partialLengths.js +0 -9
- package/lib/partialLengths.js.map +1 -1
- package/lib/properties.d.ts.map +1 -1
- package/lib/properties.js +2 -15
- package/lib/properties.js.map +1 -1
- package/lib/snapshotlegacy.d.ts.map +1 -1
- package/lib/snapshotlegacy.js +3 -6
- package/lib/snapshotlegacy.js.map +1 -1
- package/lib/textSegment.d.ts.map +1 -1
- package/lib/textSegment.js +1 -15
- package/lib/textSegment.js.map +1 -1
- package/package.json +10 -10
- package/src/base.ts +0 -1
- package/src/client.ts +5 -29
- package/src/collections.ts +7 -24
- package/src/index.ts +0 -1
- package/src/mergeTree.ts +31 -306
- package/src/ops.ts +0 -7
- package/src/partialLengths.ts +0 -10
- package/src/properties.ts +7 -15
- package/src/snapshotlegacy.ts +4 -6
- package/src/textSegment.ts +2 -17
- package/dist/text.d.ts +0 -8
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js +0 -78
- package/dist/text.js.map +0 -1
- package/lib/text.d.ts +0 -8
- package/lib/text.d.ts.map +0 -1
- package/lib/text.js +0 -73
- package/lib/text.js.map +0 -1
- package/src/text.ts +0 -83
package/dist/mergeTree.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
exports.MergeTree = exports.glc = exports.clientSeqComparer = exports.internedSpaces = exports.elapsedMicroseconds = exports.clock = exports.compareStrings = exports.compareNumbers = exports.CollaborationWindow = exports.IncrementalMapState = exports.IncrementalExecOp = exports.Marker = exports.refHasRangeLabel = exports.refHasTileLabel = exports.refGetRangeLabels = exports.refGetTileLabels = exports.reservedMarkerSimpleTypeKey = exports.reservedMarkerIdKey = exports.reservedRangeLabelsKey = exports.reservedTileLabelsKey = exports.BaseSegment = exports.MergeBlock = exports.MaxNodesInBlock = exports.ordinalToArray = exports.MergeNode = void 0;
|
|
6
|
+
/* eslint-disable max-lines */
|
|
8
7
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
9
8
|
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
10
|
-
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.MergeTree = exports.glc = exports.clientSeqComparer = exports.internedSpaces = exports.compareStrings = exports.compareNumbers = exports.CollaborationWindow = exports.IncrementalMapState = exports.IncrementalExecOp = exports.Marker = exports.refHasRangeLabel = exports.refHasTileLabel = exports.refGetRangeLabels = exports.refGetTileLabels = exports.reservedMarkerSimpleTypeKey = exports.reservedMarkerIdKey = exports.reservedRangeLabelsKey = exports.reservedTileLabelsKey = exports.BaseSegment = exports.MergeBlock = exports.MaxNodesInBlock = exports.ordinalToArray = exports.MergeNode = void 0;
|
|
11
11
|
/* eslint-disable no-bitwise */
|
|
12
12
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
13
13
|
const collections_1 = require("./collections");
|
|
@@ -30,7 +30,6 @@ class MergeNode {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
exports.MergeNode = MergeNode;
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
34
33
|
function addTile(tile, tiles) {
|
|
35
34
|
const tileLabels = tile.getTileLabels();
|
|
36
35
|
if (tileLabels) {
|
|
@@ -39,7 +38,6 @@ function addTile(tile, tiles) {
|
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
43
41
|
function addTileIfNotPresent(tile, tiles) {
|
|
44
42
|
const tileLabels = tile.getTileLabels();
|
|
45
43
|
if (tileLabels) {
|
|
@@ -51,7 +49,7 @@ function addTileIfNotPresent(tile, tiles) {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
function applyStackDelta(currentStackMap, deltaStackMap) {
|
|
54
|
-
// eslint-disable-next-line guard-for-in
|
|
52
|
+
// eslint-disable-next-line guard-for-in
|
|
55
53
|
for (const label in deltaStackMap) {
|
|
56
54
|
const deltaStack = deltaStackMap[label];
|
|
57
55
|
if (!deltaStack.empty()) {
|
|
@@ -158,7 +156,6 @@ exports.ordinalToArray = ordinalToArray;
|
|
|
158
156
|
// `MaxNodesInBlock`. (i.e., `MaxNodesInBlock` contains 1 extra slot for temporary storage to
|
|
159
157
|
// facilitate splits.)
|
|
160
158
|
exports.MaxNodesInBlock = 8;
|
|
161
|
-
const traceOrdinals = false;
|
|
162
159
|
class MergeBlock extends MergeNode {
|
|
163
160
|
constructor(childCount) {
|
|
164
161
|
super();
|
|
@@ -185,16 +182,9 @@ class MergeBlock extends MergeNode {
|
|
|
185
182
|
localOrdinal = prevOrdCode + ordinalWidth;
|
|
186
183
|
}
|
|
187
184
|
child.ordinal = this.ordinal + String.fromCharCode(localOrdinal);
|
|
188
|
-
if (traceOrdinals) {
|
|
189
|
-
// eslint-disable-next-line max-len
|
|
190
|
-
console.log(`so: prnt chld prev ${ordinalToArray(this.ordinal)} ${ordinalToArray(child.ordinal)} ${(index > 0) ? ordinalToArray(this.children[index - 1].ordinal) : "NA"}`);
|
|
191
|
-
}
|
|
192
185
|
common_utils_1.assert(child.ordinal.length === (this.ordinal.length + 1), 0x041 /* "Unexpected child ordinal length!" */);
|
|
193
186
|
if (index > 0) {
|
|
194
187
|
common_utils_1.assert(child.ordinal > this.children[index - 1].ordinal, 0x042);
|
|
195
|
-
// eslint-disable-next-line max-len
|
|
196
|
-
// console.log(`${ordinalToArray(this.ordinal)} ${ordinalToArray(child.ordinal)} ${ordinalToArray(this.children[index - 1].ordinal)}`);
|
|
197
|
-
// console.log(`ord width ${ordinalWidth}`);
|
|
198
188
|
}
|
|
199
189
|
}
|
|
200
190
|
assignChild(child, index, updateOrdinal = true) {
|
|
@@ -222,7 +212,7 @@ class HierMergeBlock extends MergeBlock {
|
|
|
222
212
|
}
|
|
223
213
|
hierToString(indentCount) {
|
|
224
214
|
let strbuf = "";
|
|
225
|
-
// eslint-disable-next-line guard-for-in
|
|
215
|
+
// eslint-disable-next-line guard-for-in
|
|
226
216
|
for (const key in this.rangeStacks) {
|
|
227
217
|
const stack = this.rangeStacks[key];
|
|
228
218
|
strbuf += internedSpaces(indentCount);
|
|
@@ -295,7 +285,6 @@ class BaseSegment extends MergeNode {
|
|
|
295
285
|
this.localSeq = undefined;
|
|
296
286
|
return true;
|
|
297
287
|
case 1 /* REMOVE */:
|
|
298
|
-
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
299
288
|
const removalInfo = this;
|
|
300
289
|
common_utils_1.assert(!!removalInfo, 0x046 /* "On remove ack, missing removal info!" */);
|
|
301
290
|
common_utils_1.assert(!!removalInfo.removedSeq, 0x047 /* "On remove ack, missing removed sequence number!" */);
|
|
@@ -304,11 +293,6 @@ class BaseSegment extends MergeNode {
|
|
|
304
293
|
removalInfo.removedSeq = opArgs.sequencedMessage.sequenceNumber;
|
|
305
294
|
return true;
|
|
306
295
|
}
|
|
307
|
-
if (MergeTree.diagOverlappingRemove) {
|
|
308
|
-
console.log(`grump @seq ${opArgs.sequencedMessage.sequenceNumber} ` +
|
|
309
|
-
`cli ${glc(mergeTree, mergeTree.collabWindow.clientId)} ` +
|
|
310
|
-
`from ${removalInfo.removedSeq} text ${mergeTree.toString()}`);
|
|
311
|
-
}
|
|
312
296
|
return false;
|
|
313
297
|
default:
|
|
314
298
|
throw new Error(`${opArgs.op.type} is in unrecognized operation type`);
|
|
@@ -513,7 +497,6 @@ class Marker extends BaseSegment {
|
|
|
513
497
|
// Avoid circular reference when stringifying makers containing handles.
|
|
514
498
|
// (Substitute a debug string instead.)
|
|
515
499
|
const handle = !!value && value.IFluidHandle;
|
|
516
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
517
500
|
return handle
|
|
518
501
|
? `#Handle(${handle.routeContext.path}/${handle.path})`
|
|
519
502
|
: value;
|
|
@@ -575,14 +558,6 @@ const compareNumbers = (a, b) => a - b;
|
|
|
575
558
|
exports.compareNumbers = compareNumbers;
|
|
576
559
|
const compareStrings = (a, b) => a.localeCompare(b);
|
|
577
560
|
exports.compareStrings = compareStrings;
|
|
578
|
-
function clock() {
|
|
579
|
-
return common_utils_1.Trace.start();
|
|
580
|
-
}
|
|
581
|
-
exports.clock = clock;
|
|
582
|
-
function elapsedMicroseconds(trace) {
|
|
583
|
-
return trace.trace().duration * 1000;
|
|
584
|
-
}
|
|
585
|
-
exports.elapsedMicroseconds = elapsedMicroseconds;
|
|
586
561
|
const indentStrings = ["", " ", " "];
|
|
587
562
|
function internedSpaces(n) {
|
|
588
563
|
if (indentStrings[n] === undefined) {
|
|
@@ -690,10 +665,6 @@ class MergeTree {
|
|
|
690
665
|
// TODO: make and use interface describing options
|
|
691
666
|
constructor(options) {
|
|
692
667
|
this.options = options;
|
|
693
|
-
this.windowTime = 0;
|
|
694
|
-
this.packTime = 0;
|
|
695
|
-
this.ordTime = 0;
|
|
696
|
-
this.maxOrdTime = 0;
|
|
697
668
|
this.blockUpdateActions = MergeTree.initBlockUpdateActions;
|
|
698
669
|
this.collabWindow = new CollaborationWindow();
|
|
699
670
|
// TODO: add remove on segment remove
|
|
@@ -777,7 +748,6 @@ class MergeTree {
|
|
|
777
748
|
// This code assumes that a later call to `startCollaboration()` will initialize partial lengths.
|
|
778
749
|
common_utils_1.assert(!this.collabWindow.collaborating, 0x049 /* "Trying to reload from segments while collaborating!" */);
|
|
779
750
|
const maxChildren = exports.MaxNodesInBlock - 1;
|
|
780
|
-
const measureReloadTime = false;
|
|
781
751
|
// Starting with the leaf segments, recursively builds the B-Tree layer by layer from the bottom up.
|
|
782
752
|
const buildMergeBlock = (nodes) => {
|
|
783
753
|
const blockCount = Math.ceil(nodes.length / maxChildren); // Compute # blocks require for this level of B-Tree
|
|
@@ -801,15 +771,10 @@ class MergeTree {
|
|
|
801
771
|
// snapshot header. The bulk of the segments in long documents are inserted via `insertSegments()`.
|
|
802
772
|
this.blockUpdate(block);
|
|
803
773
|
}
|
|
804
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
805
774
|
return blocks.length === 1 // If there is only one block at this layer...
|
|
806
775
|
? blocks[0] // ...then we're done. Return the root.
|
|
807
776
|
: buildMergeBlock(blocks); // ...otherwise recursively build the next layer above blocks.
|
|
808
777
|
};
|
|
809
|
-
let clockStart;
|
|
810
|
-
if (measureReloadTime) {
|
|
811
|
-
clockStart = clock();
|
|
812
|
-
}
|
|
813
778
|
if (segments.length > 0) {
|
|
814
779
|
this.root = buildMergeBlock(segments);
|
|
815
780
|
this.nodeUpdateOrdinals(this.root);
|
|
@@ -817,9 +782,6 @@ class MergeTree {
|
|
|
817
782
|
else {
|
|
818
783
|
this.root = this.makeBlock(0);
|
|
819
784
|
}
|
|
820
|
-
if (clockStart) {
|
|
821
|
-
console.log(`reload time ${elapsedMicroseconds(clockStart)}`);
|
|
822
|
-
}
|
|
823
785
|
}
|
|
824
786
|
/* eslint-enable max-len */
|
|
825
787
|
// For now assume min starts at zero
|
|
@@ -830,15 +792,7 @@ class MergeTree {
|
|
|
830
792
|
this.collabWindow.currentSeq = currentSeq;
|
|
831
793
|
this.segmentsToScour = new collections_1.Heap([], LRUSegmentComparer);
|
|
832
794
|
this.pendingSegments = collections_1.ListMakeHead();
|
|
833
|
-
const measureFullCollab = false;
|
|
834
|
-
let clockStart;
|
|
835
|
-
if (measureFullCollab) {
|
|
836
|
-
clockStart = clock();
|
|
837
|
-
}
|
|
838
795
|
this.nodeUpdateLengthNewStructure(this.root, true);
|
|
839
|
-
if (clockStart) {
|
|
840
|
-
console.log(`update partial lengths at start ${elapsedMicroseconds(clockStart)}`);
|
|
841
|
-
}
|
|
842
796
|
}
|
|
843
797
|
addToLRUSet(segment, seq) {
|
|
844
798
|
// If the parent node has not yet been marked for scour (i.e., needsScour is not false or undefined),
|
|
@@ -868,10 +822,6 @@ class MergeTree {
|
|
|
868
822
|
holdNodes.push(segment);
|
|
869
823
|
}
|
|
870
824
|
else {
|
|
871
|
-
if (MergeTree.traceZRemove) {
|
|
872
|
-
// eslint-disable-next-line @typescript-eslint/dot-notation, max-len
|
|
873
|
-
console.log(`${this.getLongClientId(this.collabWindow.clientId)}: Zremove ${segment["text"]}; cli ${this.getLongClientId(segment.clientId)}`);
|
|
874
|
-
}
|
|
875
825
|
// Notify maintenance event observers that the segment is being unlinked from the MergeTree
|
|
876
826
|
if (this.mergeTreeMaintenanceCallback) {
|
|
877
827
|
this.mergeTreeMaintenanceCallback({
|
|
@@ -891,10 +841,6 @@ class MergeTree {
|
|
|
891
841
|
&& prevSegment.trackingCollection.matches(segment.trackingCollection)
|
|
892
842
|
&& this.localNetLength(segment) > 0;
|
|
893
843
|
if (canAppend) {
|
|
894
|
-
if (MergeTree.traceAppend) {
|
|
895
|
-
// eslint-disable-next-line @typescript-eslint/dot-notation, max-len
|
|
896
|
-
console.log(`${this.getLongClientId(this.collabWindow.clientId)}: append ${prevSegment["text"]} + ${segment["text"]}; cli ${this.getLongClientId(prevSegment.clientId)} + cli ${this.getLongClientId(segment.clientId)}`);
|
|
897
|
-
}
|
|
898
844
|
prevSegment.append(segment);
|
|
899
845
|
if (this.mergeTreeMaintenanceCallback) {
|
|
900
846
|
this.mergeTreeMaintenanceCallback({
|
|
@@ -970,9 +916,6 @@ class MergeTree {
|
|
|
970
916
|
packedBlocks[nodeIndex] = packedBlock;
|
|
971
917
|
this.nodeUpdateLengthNewStructure(packedBlock);
|
|
972
918
|
}
|
|
973
|
-
if (readCount !== totalNodeCount) {
|
|
974
|
-
console.log(`total count ${totalNodeCount} readCount ${readCount}`);
|
|
975
|
-
}
|
|
976
919
|
parent.children = packedBlocks;
|
|
977
920
|
for (let j = 0; j < childCount; j++) {
|
|
978
921
|
parent.assignChild(packedBlocks[j], j, false);
|
|
@@ -990,10 +933,6 @@ class MergeTree {
|
|
|
990
933
|
if (!this.collabWindow.collaborating) {
|
|
991
934
|
return;
|
|
992
935
|
}
|
|
993
|
-
let clockStart;
|
|
994
|
-
if (MergeTree.options.measureWindowTime) {
|
|
995
|
-
clockStart = clock();
|
|
996
|
-
}
|
|
997
936
|
for (let i = 0; i < zamboniSegmentsMaxCount; i++) {
|
|
998
937
|
let segmentToScour = this.segmentsToScour.peek();
|
|
999
938
|
if (!segmentToScour || segmentToScour.maxSeq > this.collabWindow.minSeq) {
|
|
@@ -1004,7 +943,6 @@ class MergeTree {
|
|
|
1004
943
|
if (segmentToScour.segment.parent && segmentToScour.segment.parent.needsScour !== false) {
|
|
1005
944
|
const block = segmentToScour.segment.parent;
|
|
1006
945
|
const childrenCopy = [];
|
|
1007
|
-
// console.log(`scouring from ${segmentToScour.segment.seq}`);
|
|
1008
946
|
this.scourNode(block, childrenCopy);
|
|
1009
947
|
// This will avoid the cost of re-scouring nodes
|
|
1010
948
|
// that have recently been scoured
|
|
@@ -1017,15 +955,7 @@ class MergeTree {
|
|
|
1017
955
|
block.assignChild(childrenCopy[j], j, false);
|
|
1018
956
|
}
|
|
1019
957
|
if (this.underflow(block) && block.parent) {
|
|
1020
|
-
// nodeUpdatePathLengths(node, UnassignedSequenceNumber, -1, true);
|
|
1021
|
-
let packClockStart;
|
|
1022
|
-
if (MergeTree.options.measureWindowTime) {
|
|
1023
|
-
packClockStart = clock();
|
|
1024
|
-
}
|
|
1025
958
|
this.packParent(block.parent);
|
|
1026
|
-
if (MergeTree.options.measureWindowTime) {
|
|
1027
|
-
this.packTime += elapsedMicroseconds(packClockStart);
|
|
1028
|
-
}
|
|
1029
959
|
}
|
|
1030
960
|
else {
|
|
1031
961
|
this.nodeUpdateOrdinals(block);
|
|
@@ -1034,9 +964,6 @@ class MergeTree {
|
|
|
1034
964
|
}
|
|
1035
965
|
}
|
|
1036
966
|
}
|
|
1037
|
-
if (MergeTree.options.measureWindowTime) {
|
|
1038
|
-
this.windowTime += elapsedMicroseconds(clockStart);
|
|
1039
|
-
}
|
|
1040
967
|
}
|
|
1041
968
|
getCollabWindow() {
|
|
1042
969
|
return this.collabWindow;
|
|
@@ -1085,56 +1012,8 @@ class MergeTree {
|
|
|
1085
1012
|
return stats;
|
|
1086
1013
|
};
|
|
1087
1014
|
const rootStats = nodeGetStats(this.root);
|
|
1088
|
-
if (MergeTree.options.measureWindowTime) {
|
|
1089
|
-
rootStats.windowTime = this.windowTime;
|
|
1090
|
-
rootStats.packTime = this.packTime;
|
|
1091
|
-
rootStats.ordTime = this.ordTime;
|
|
1092
|
-
rootStats.maxOrdTime = this.maxOrdTime;
|
|
1093
|
-
}
|
|
1094
1015
|
return rootStats;
|
|
1095
1016
|
}
|
|
1096
|
-
findHistorialPosition(pos, fromSeq, toSeq, clientId) {
|
|
1097
|
-
return this.findHistorialPositionFromClient(pos, fromSeq, toSeq, clientId);
|
|
1098
|
-
}
|
|
1099
|
-
findHistorialPositionFromClient(pos, fromSeq, toSeq, clientId) {
|
|
1100
|
-
common_utils_1.assert(fromSeq < toSeq, 0x04a /* "Invalid range for historical position search!" */);
|
|
1101
|
-
if (pos < this.getLength(fromSeq, clientId)) {
|
|
1102
|
-
common_utils_1.assert(toSeq <= this.collabWindow.currentSeq, 0x04b /* "Out-of-bounds end sequence number for historical position search!" */);
|
|
1103
|
-
const segoff = this.getContainingSegment(pos, fromSeq, clientId);
|
|
1104
|
-
common_utils_1.assert(segoff.segment !== undefined, 0x04c /* "Containing segment for historical position search is undefined!" */);
|
|
1105
|
-
const toPos = this.getPosition(segoff.segment, toSeq, clientId);
|
|
1106
|
-
const ret = toPos + segoff.offset;
|
|
1107
|
-
common_utils_1.assert(ret !== undefined, 0x04d /* "Return value for historical position search is undefined!" */);
|
|
1108
|
-
return ret;
|
|
1109
|
-
}
|
|
1110
|
-
else {
|
|
1111
|
-
return pos;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
findHistorialRangeFromClient(rangeStart, rangeEnd, fromSeq, toSeq, clientId) {
|
|
1115
|
-
const ranges = [];
|
|
1116
|
-
const recordRange = (segment, pos, refSeq, clientId, segStart, segEnd) => {
|
|
1117
|
-
var _a;
|
|
1118
|
-
let _segStart = segStart;
|
|
1119
|
-
let _segEnd = segEnd;
|
|
1120
|
-
if (((_a = this.nodeLength(segment, toSeq, clientId)) !== null && _a !== void 0 ? _a : 0) > 0) {
|
|
1121
|
-
const position = this.getPosition(segment, toSeq, clientId);
|
|
1122
|
-
if (_segStart < 0) {
|
|
1123
|
-
_segStart = 0;
|
|
1124
|
-
}
|
|
1125
|
-
if (_segEnd > segment.cachedLength) {
|
|
1126
|
-
_segEnd = segment.cachedLength;
|
|
1127
|
-
}
|
|
1128
|
-
ranges.push({ start: position + _segStart, end: position + _segEnd });
|
|
1129
|
-
}
|
|
1130
|
-
return true;
|
|
1131
|
-
};
|
|
1132
|
-
this.mapRange({ leaf: recordRange }, fromSeq, clientId, undefined, rangeStart, rangeEnd);
|
|
1133
|
-
return ranges;
|
|
1134
|
-
}
|
|
1135
|
-
findHistorialRange(rangeStart, rangeEnd, fromSeq, toSeq, clientId) {
|
|
1136
|
-
return this.findHistorialRangeFromClient(rangeStart, rangeEnd, fromSeq, toSeq, clientId);
|
|
1137
|
-
}
|
|
1138
1017
|
getLength(refSeq, clientId) {
|
|
1139
1018
|
return this.blockLength(this.root, refSeq, clientId);
|
|
1140
1019
|
}
|
|
@@ -1404,15 +1283,12 @@ class MergeTree {
|
|
|
1404
1283
|
* Assign sequence number to existing segment; update partial lengths to reflect the change
|
|
1405
1284
|
* @param seq - sequence number given by server to pending segment
|
|
1406
1285
|
*/
|
|
1407
|
-
ackPendingSegment(opArgs
|
|
1286
|
+
ackPendingSegment(opArgs) {
|
|
1408
1287
|
const seq = opArgs.sequencedMessage.sequenceNumber;
|
|
1409
1288
|
const pendingSegmentGroup = this.pendingSegments.dequeue();
|
|
1410
1289
|
const nodesToUpdate = [];
|
|
1411
1290
|
let overwrite = false;
|
|
1412
1291
|
if (pendingSegmentGroup !== undefined) {
|
|
1413
|
-
if (verboseOps) {
|
|
1414
|
-
console.log(`segment group has ${pendingSegmentGroup.segments.length} segments`);
|
|
1415
|
-
}
|
|
1416
1292
|
const deltaSegments = [];
|
|
1417
1293
|
pendingSegmentGroup.segments.map((pendingSegment) => {
|
|
1418
1294
|
overwrite = !pendingSegment.ack(pendingSegmentGroup, opArgs, this) || overwrite;
|
|
@@ -1486,12 +1362,7 @@ class MergeTree {
|
|
|
1486
1362
|
return pos;
|
|
1487
1363
|
}
|
|
1488
1364
|
insertSegments(pos, segments, refSeq, clientId, seq, opArgs) {
|
|
1489
|
-
// const tt = MergeTree.traceTraversal;
|
|
1490
|
-
// MergeTree.traceTraversal = true;
|
|
1491
1365
|
this.ensureIntervalBoundary(pos, refSeq, clientId);
|
|
1492
|
-
if (MergeTree.traceOrdinals) {
|
|
1493
|
-
this.ordinalIntegrity();
|
|
1494
|
-
}
|
|
1495
1366
|
const localSeq = seq === constants_1.UnassignedSequenceNumber ? ++this.collabWindow.localSeq : undefined;
|
|
1496
1367
|
this.blockInsert(pos, refSeq, clientId, seq, localSeq, segments);
|
|
1497
1368
|
// opArgs == undefined => loading snapshot or test code
|
|
@@ -1501,10 +1372,6 @@ class MergeTree {
|
|
|
1501
1372
|
deltaSegments: segments.map((segment) => ({ segment })),
|
|
1502
1373
|
});
|
|
1503
1374
|
}
|
|
1504
|
-
// MergeTree.traceTraversal = tt;
|
|
1505
|
-
if (MergeTree.traceOrdinals) {
|
|
1506
|
-
this.ordinalIntegrity();
|
|
1507
|
-
}
|
|
1508
1375
|
if (this.collabWindow.collaborating && MergeTree.options.zamboniSegments &&
|
|
1509
1376
|
(seq !== constants_1.UnassignedSequenceNumber)) {
|
|
1510
1377
|
this.zamboniSegments();
|
|
@@ -1614,12 +1481,21 @@ class MergeTree {
|
|
|
1614
1481
|
/**
|
|
1615
1482
|
* Resolves a remote client's position against the local sequence
|
|
1616
1483
|
* and returns the remote client's position relative to the local
|
|
1617
|
-
* sequence
|
|
1484
|
+
* sequence. The client ref seq must be above the minimum sequence number
|
|
1485
|
+
* or the return value will be undefined.
|
|
1486
|
+
* Generally this method is used in conjunction with signals which provide
|
|
1487
|
+
* point in time values for the below parameters, and is useful for things
|
|
1488
|
+
* like displaying user position. It should not be used with persisted values
|
|
1489
|
+
* as persisted values will quickly become invalid as the remoteClientRefSeq
|
|
1490
|
+
* moves below the minimum sequence number
|
|
1618
1491
|
* @param remoteClientPosition - The remote client's position to resolve
|
|
1619
1492
|
* @param remoteClientRefSeq - The reference sequence number of the remote client
|
|
1620
1493
|
* @param remoteClientId - The client id of the remote client
|
|
1621
1494
|
*/
|
|
1622
1495
|
resolveRemoteClientPosition(remoteClientPosition, remoteClientRefSeq, remoteClientId) {
|
|
1496
|
+
if (remoteClientRefSeq < this.collabWindow.minSeq) {
|
|
1497
|
+
return undefined;
|
|
1498
|
+
}
|
|
1623
1499
|
const segmentInfo = this.getContainingSegment(remoteClientPosition, remoteClientRefSeq, remoteClientId);
|
|
1624
1500
|
const segwindow = this.getCollabWindow();
|
|
1625
1501
|
if (segmentInfo && segmentInfo.segment) {
|
|
@@ -1645,10 +1521,6 @@ class MergeTree {
|
|
|
1645
1521
|
let segIsLocal = false;
|
|
1646
1522
|
const checkSegmentIsLocal = (segment, pos, refSeq, clientId) => {
|
|
1647
1523
|
if (segment.seq === constants_1.UnassignedSequenceNumber) {
|
|
1648
|
-
if (MergeTree.diagInsertTie) {
|
|
1649
|
-
// eslint-disable-next-line max-len
|
|
1650
|
-
console.log(`@cli ${glc(this, this.collabWindow.clientId)}: promoting continue due to seq ${segment.seq} text ${segment.toString()} ref ${refSeq}`);
|
|
1651
|
-
}
|
|
1652
1524
|
segIsLocal = true;
|
|
1653
1525
|
}
|
|
1654
1526
|
// Only need to look at first segment that follows finished node
|
|
@@ -1657,10 +1529,6 @@ class MergeTree {
|
|
|
1657
1529
|
const continueFrom = (node) => {
|
|
1658
1530
|
segIsLocal = false;
|
|
1659
1531
|
this.rightExcursion(node, checkSegmentIsLocal);
|
|
1660
|
-
if (MergeTree.diagInsertTie && segIsLocal) {
|
|
1661
|
-
// eslint-disable-next-line max-len
|
|
1662
|
-
console.log(`@cli ${glc(this, this.collabWindow.clientId)}: attempting continue with seq ${seq} ref ${refSeq} `);
|
|
1663
|
-
}
|
|
1664
1532
|
return segIsLocal;
|
|
1665
1533
|
};
|
|
1666
1534
|
let segmentGroup;
|
|
@@ -1816,7 +1684,6 @@ class MergeTree {
|
|
|
1816
1684
|
let child;
|
|
1817
1685
|
let newNode;
|
|
1818
1686
|
let fromSplit;
|
|
1819
|
-
let found = false;
|
|
1820
1687
|
for (childIndex = 0; childIndex < block.childCount; childIndex++) {
|
|
1821
1688
|
child = children[childIndex];
|
|
1822
1689
|
const len = this.nodeLength(child, refSeq, clientId);
|
|
@@ -1825,23 +1692,8 @@ class MergeTree {
|
|
|
1825
1692
|
// will be removed, so should just be skipped for now
|
|
1826
1693
|
continue;
|
|
1827
1694
|
}
|
|
1828
|
-
if (MergeTree.traceTraversal) {
|
|
1829
|
-
let segInfo;
|
|
1830
|
-
if ((!child.isLeaf()) && this.collabWindow.collaborating) {
|
|
1831
|
-
segInfo = `minLength: ${child.partialLengths.minLength}`;
|
|
1832
|
-
}
|
|
1833
|
-
else {
|
|
1834
|
-
const segment = child;
|
|
1835
|
-
segInfo = `cli: ${glc(this, segment.clientId)} seq: ${segment.seq} text: ${segment.toString()}`;
|
|
1836
|
-
if (segment.removedSeq !== undefined) {
|
|
1837
|
-
segInfo += ` rcli: ${glc(this, segment.removedClientId)} rseq: ${segment.removedSeq}`;
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
console.log(`@tcli: ${glc(this, this.collabWindow.clientId)} len: ${len} pos: ${_pos} ${segInfo}`);
|
|
1841
|
-
}
|
|
1842
1695
|
if ((_pos < len) || ((_pos === len) && this.breakTie(_pos, child, seq))) {
|
|
1843
1696
|
// Found entry containing pos
|
|
1844
|
-
found = true;
|
|
1845
1697
|
if (!child.isLeaf()) {
|
|
1846
1698
|
const childBlock = child;
|
|
1847
1699
|
// Internal node
|
|
@@ -1856,10 +1708,6 @@ class MergeTree {
|
|
|
1856
1708
|
return undefined;
|
|
1857
1709
|
}
|
|
1858
1710
|
else if (splitNode === MergeTree.theUnfinishedNode) {
|
|
1859
|
-
if (MergeTree.traceTraversal) {
|
|
1860
|
-
// eslint-disable-next-line max-len
|
|
1861
|
-
console.log(`@cli ${glc(this, this.collabWindow.clientId)} unfinished bus pos ${_pos} len ${len}`);
|
|
1862
|
-
}
|
|
1863
1711
|
_pos -= len; // Act as if shifted segment
|
|
1864
1712
|
continue;
|
|
1865
1713
|
}
|
|
@@ -1870,15 +1718,9 @@ class MergeTree {
|
|
|
1870
1718
|
}
|
|
1871
1719
|
}
|
|
1872
1720
|
else {
|
|
1873
|
-
if (MergeTree.traceTraversal) {
|
|
1874
|
-
console.log(`@tcli: ${glc(this, this.collabWindow.clientId)}: leaf action`);
|
|
1875
|
-
}
|
|
1876
1721
|
const segment = child;
|
|
1877
1722
|
const segmentChanges = context.leaf(segment, _pos, context);
|
|
1878
1723
|
if (segmentChanges.replaceCurrent) {
|
|
1879
|
-
if (MergeTree.traceOrdinals) {
|
|
1880
|
-
console.log(`assign from leaf with block ord ${ordinalToArray(block.ordinal)}`);
|
|
1881
|
-
}
|
|
1882
1724
|
block.assignChild(segmentChanges.replaceCurrent, childIndex, false);
|
|
1883
1725
|
segmentChanges.replaceCurrent.ordinal = child.ordinal;
|
|
1884
1726
|
}
|
|
@@ -1900,12 +1742,6 @@ class MergeTree {
|
|
|
1900
1742
|
_pos -= len;
|
|
1901
1743
|
}
|
|
1902
1744
|
}
|
|
1903
|
-
if (MergeTree.traceTraversal) {
|
|
1904
|
-
if ((!found) && (_pos > 0)) {
|
|
1905
|
-
// eslint-disable-next-line max-len
|
|
1906
|
-
console.log(`inserting walk fell through pos ${_pos} len: ${this.blockLength(this.root, refSeq, clientId)}`);
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
1745
|
if (!newNode) {
|
|
1910
1746
|
if (_pos === 0) {
|
|
1911
1747
|
if ((seq !== constants_1.UnassignedSequenceNumber) && context.continuePredicate &&
|
|
@@ -1913,9 +1749,6 @@ class MergeTree {
|
|
|
1913
1749
|
return MergeTree.theUnfinishedNode;
|
|
1914
1750
|
}
|
|
1915
1751
|
else {
|
|
1916
|
-
if (MergeTree.traceTraversal) {
|
|
1917
|
-
console.log(`@tcli: ${glc(this, this.collabWindow.clientId)}: leaf action pos 0`);
|
|
1918
|
-
}
|
|
1919
1752
|
const segmentChanges = context.leaf(undefined, _pos, context);
|
|
1920
1753
|
newNode = segmentChanges.next;
|
|
1921
1754
|
// Assert segmentChanges.replaceCurrent === undefined
|
|
@@ -1932,9 +1765,6 @@ class MergeTree {
|
|
|
1932
1765
|
block.setOrdinal(newNode, childIndex);
|
|
1933
1766
|
if (block.childCount < exports.MaxNodesInBlock) {
|
|
1934
1767
|
if (fromSplit) {
|
|
1935
|
-
if (MergeTree.traceOrdinals) {
|
|
1936
|
-
console.log(`split ord ${ordinalToArray(fromSplit.ordinal)}`);
|
|
1937
|
-
}
|
|
1938
1768
|
this.nodeUpdateOrdinals(fromSplit);
|
|
1939
1769
|
}
|
|
1940
1770
|
if (context.structureChange) {
|
|
@@ -1968,43 +1798,7 @@ class MergeTree {
|
|
|
1968
1798
|
this.nodeUpdateLengthNewStructure(newNode);
|
|
1969
1799
|
return newNode;
|
|
1970
1800
|
}
|
|
1971
|
-
ordinalIntegrity() {
|
|
1972
|
-
console.log("chk ordnls");
|
|
1973
|
-
this.nodeOrdinalIntegrity(this.root);
|
|
1974
|
-
}
|
|
1975
|
-
nodeOrdinalIntegrity(block) {
|
|
1976
|
-
const olen = block.ordinal.length;
|
|
1977
|
-
for (let i = 0; i < block.childCount; i++) {
|
|
1978
|
-
const child = block.children[i];
|
|
1979
|
-
if (child.ordinal) {
|
|
1980
|
-
if (olen !== (child.ordinal.length - 1)) {
|
|
1981
|
-
console.log("node integrity issue");
|
|
1982
|
-
}
|
|
1983
|
-
if (i > 0) {
|
|
1984
|
-
if (child.ordinal <= block.children[i - 1].ordinal) {
|
|
1985
|
-
console.log("node sib integrity issue");
|
|
1986
|
-
// eslint-disable-next-line max-len
|
|
1987
|
-
console.log(`??: prnt chld prev ${ordinalToArray(block.ordinal)} ${ordinalToArray(child.ordinal)} ${(i > 0) ? ordinalToArray(block.children[i - 1].ordinal) : "NA"}`);
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
if (!child.isLeaf()) {
|
|
1991
|
-
this.nodeOrdinalIntegrity(child);
|
|
1992
|
-
}
|
|
1993
|
-
}
|
|
1994
|
-
else {
|
|
1995
|
-
console.log(`node child ordinal not set ${i}`);
|
|
1996
|
-
console.log(`??: prnt ${ordinalToArray(block.ordinal)}`);
|
|
1997
|
-
}
|
|
1998
|
-
}
|
|
1999
|
-
}
|
|
2000
1801
|
nodeUpdateOrdinals(block) {
|
|
2001
|
-
if (MergeTree.traceOrdinals) {
|
|
2002
|
-
console.log(`update ordinals for children of node with ordinal ${ordinalToArray(block.ordinal)}`);
|
|
2003
|
-
}
|
|
2004
|
-
let clockStart;
|
|
2005
|
-
if (MergeTree.options.measureOrdinalTime) {
|
|
2006
|
-
clockStart = clock();
|
|
2007
|
-
}
|
|
2008
1802
|
for (let i = 0; i < block.childCount; i++) {
|
|
2009
1803
|
const child = block.children[i];
|
|
2010
1804
|
block.setOrdinal(child, i);
|
|
@@ -2012,21 +1806,11 @@ class MergeTree {
|
|
|
2012
1806
|
this.nodeUpdateOrdinals(child);
|
|
2013
1807
|
}
|
|
2014
1808
|
}
|
|
2015
|
-
if (clockStart) {
|
|
2016
|
-
const elapsed = elapsedMicroseconds(clockStart);
|
|
2017
|
-
if (elapsed > this.maxOrdTime) {
|
|
2018
|
-
this.maxOrdTime = elapsed;
|
|
2019
|
-
}
|
|
2020
|
-
this.ordTime += elapsed;
|
|
2021
|
-
}
|
|
2022
1809
|
}
|
|
2023
1810
|
addOverlappingClient(removalInfo, clientId) {
|
|
2024
1811
|
if (!removalInfo.removedClientOverlap) {
|
|
2025
1812
|
removalInfo.removedClientOverlap = [];
|
|
2026
1813
|
}
|
|
2027
|
-
if (MergeTree.diagOverlappingRemove) {
|
|
2028
|
-
console.log(`added cli ${glc(this, clientId)} to rseq: ${removalInfo.removedSeq}`);
|
|
2029
|
-
}
|
|
2030
1814
|
removalInfo.removedClientOverlap.push(clientId);
|
|
2031
1815
|
}
|
|
2032
1816
|
/**
|
|
@@ -2086,10 +1870,6 @@ class MergeTree {
|
|
|
2086
1870
|
const markRemoved = (segment, pos, start, end) => {
|
|
2087
1871
|
const removalInfo = segment;
|
|
2088
1872
|
if (removalInfo.removedSeq !== undefined) {
|
|
2089
|
-
if (MergeTree.diagOverlappingRemove) {
|
|
2090
|
-
// eslint-disable-next-line max-len
|
|
2091
|
-
console.log(`yump @seq ${seq} cli ${glc(this, this.collabWindow.clientId)}: overlaps deleted segment ${removalInfo.removedSeq} text '${segment.toString()}'`);
|
|
2092
|
-
}
|
|
2093
1873
|
_overwrite = true;
|
|
2094
1874
|
if (removalInfo.removedSeq === constants_1.UnassignedSequenceNumber) {
|
|
2095
1875
|
// replace because comes later
|
|
@@ -2124,7 +1904,6 @@ class MergeTree {
|
|
|
2124
1904
|
this.addToLRUSet(segment, seq);
|
|
2125
1905
|
}
|
|
2126
1906
|
}
|
|
2127
|
-
// console.log(`saved local removed seg with text: ${textSegment.text}`);
|
|
2128
1907
|
}
|
|
2129
1908
|
return true;
|
|
2130
1909
|
};
|
|
@@ -2137,7 +1916,6 @@ class MergeTree {
|
|
|
2137
1916
|
}
|
|
2138
1917
|
return true;
|
|
2139
1918
|
};
|
|
2140
|
-
// MergeTree.traceTraversal = true;
|
|
2141
1919
|
this.mapRange({ leaf: markRemoved, post: afterMarkRemoved }, refSeq, clientId, undefined, start, end);
|
|
2142
1920
|
if (savedLocalRefs.length > 0) {
|
|
2143
1921
|
const length = this.getLength(refSeq, clientId);
|
|
@@ -2183,7 +1961,6 @@ class MergeTree {
|
|
|
2183
1961
|
this.zamboniSegments();
|
|
2184
1962
|
}
|
|
2185
1963
|
}
|
|
2186
|
-
// MergeTree.traceTraversal = false;
|
|
2187
1964
|
}
|
|
2188
1965
|
nodeUpdateLengthNewStructure(node, recur = false) {
|
|
2189
1966
|
this.blockUpdate(node);
|
|
@@ -2333,22 +2110,12 @@ class MergeTree {
|
|
|
2333
2110
|
if ((state.op === IncrementalExecOp.Go) && (state.childIndex < state.block.childCount)) {
|
|
2334
2111
|
const child = state.block.children[state.childIndex];
|
|
2335
2112
|
const len = (_a = this.nodeLength(child, state.refSeq, state.clientId)) !== null && _a !== void 0 ? _a : 0;
|
|
2336
|
-
if (MergeTree.traceIncrTraversal) {
|
|
2337
|
-
if (child.isLeaf()) {
|
|
2338
|
-
// eslint-disable-next-line @typescript-eslint/dot-notation, max-len
|
|
2339
|
-
console.log(`considering (r ${state.refSeq} c ${glc(this, state.clientId)}) seg with text ${child["text"]} len ${len} seq ${child.seq} rseq ${child.removedSeq} cli ${glc(this, child.clientId)}`);
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
2113
|
if ((len > 0) && (state.start < len) && (state.end > 0)) {
|
|
2343
2114
|
if (!child.isLeaf()) {
|
|
2344
2115
|
const childState = new IncrementalMapState(child, state.actions, state.pos, state.refSeq, state.clientId, state.context, state.start, state.end, 0);
|
|
2345
2116
|
stateStack.push(childState);
|
|
2346
2117
|
}
|
|
2347
2118
|
else {
|
|
2348
|
-
if (MergeTree.traceIncrTraversal) {
|
|
2349
|
-
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
2350
|
-
console.log(`action on seg with text ${child["text"]}`);
|
|
2351
|
-
}
|
|
2352
2119
|
state.actions.leaf(child, state);
|
|
2353
2120
|
}
|
|
2354
2121
|
}
|
|
@@ -2390,21 +2157,6 @@ class MergeTree {
|
|
|
2390
2157
|
for (let childIndex = 0; childIndex < node.childCount; childIndex++) {
|
|
2391
2158
|
const child = children[childIndex];
|
|
2392
2159
|
const len = (_a = this.nodeLength(child, refSeq, clientId)) !== null && _a !== void 0 ? _a : 0;
|
|
2393
|
-
if (MergeTree.traceTraversal) {
|
|
2394
|
-
let segInfo;
|
|
2395
|
-
if ((!child.isLeaf()) && this.collabWindow.collaborating) {
|
|
2396
|
-
segInfo = `minLength: ${child.partialLengths.minLength}`;
|
|
2397
|
-
}
|
|
2398
|
-
else {
|
|
2399
|
-
const segment = child;
|
|
2400
|
-
segInfo = `cli: ${glc(this, segment.clientId)} seq: ${segment.seq} text: '${segment.toString()}'`;
|
|
2401
|
-
if (segment.removedSeq !== undefined) {
|
|
2402
|
-
segInfo += ` rcli: ${glc(this, segment.removedClientId)} rseq: ${segment.removedSeq}`;
|
|
2403
|
-
}
|
|
2404
|
-
}
|
|
2405
|
-
// eslint-disable-next-line max-len
|
|
2406
|
-
console.log(`@tcli ${glc(this, this.collabWindow.clientId)}: map len: ${len} start: ${_start} end: ${_end} ${segInfo}`);
|
|
2407
|
-
}
|
|
2408
2160
|
if (go && (_end > 0) && (len > 0) && (_start < len)) {
|
|
2409
2161
|
// Found entry containing pos
|
|
2410
2162
|
if (!child.isLeaf()) {
|
|
@@ -2413,9 +2165,6 @@ class MergeTree {
|
|
|
2413
2165
|
}
|
|
2414
2166
|
}
|
|
2415
2167
|
else {
|
|
2416
|
-
if (MergeTree.traceTraversal) {
|
|
2417
|
-
console.log(`@tcli ${glc(this, this.collabWindow.clientId)}: map leaf action`);
|
|
2418
|
-
}
|
|
2419
2168
|
if (actions.leaf) {
|
|
2420
2169
|
go = actions.leaf(child, _pos, refSeq, clientId, _start, _end, accum);
|
|
2421
2170
|
}
|
|
@@ -2478,18 +2227,8 @@ MergeTree.zamboniSegmentsMaxCount = 2;
|
|
|
2478
2227
|
MergeTree.options = {
|
|
2479
2228
|
incrementalUpdate: true,
|
|
2480
2229
|
insertAfterRemovedSegs: true,
|
|
2481
|
-
measureOrdinalTime: true,
|
|
2482
|
-
measureWindowTime: true,
|
|
2483
2230
|
zamboniSegments: true,
|
|
2484
2231
|
};
|
|
2485
|
-
MergeTree.traceAppend = false;
|
|
2486
|
-
MergeTree.traceZRemove = false;
|
|
2487
|
-
MergeTree.traceOrdinals = false;
|
|
2488
|
-
MergeTree.traceGatherText = false;
|
|
2489
|
-
MergeTree.diagInsertTie = false;
|
|
2490
|
-
MergeTree.diagOverlappingRemove = false;
|
|
2491
|
-
MergeTree.traceTraversal = false;
|
|
2492
|
-
MergeTree.traceIncrTraversal = false;
|
|
2493
2232
|
MergeTree.theUnfinishedNode = { childCount: -1 };
|
|
2494
2233
|
// WARNING:
|
|
2495
2234
|
// Setting blockUpdateMarkers to false will result in eventual consistency issues
|