Skip to main content
Version: v1

ISegment Interface

A segment representing a portion of the merge tree.

Signature

export interface ISegment extends IMergeNodeCommon, Partial<IRemovalInfo>

Extends: IMergeNodeCommon, Partial<IRemovalInfo

Properties

Property Modifiers Type Description
clientId number
localRefs optional LocalReferenceCollection
localRemovedSeq optional number
localSeq optional number
properties optional PropertySet
propertyManager optional PropertiesManager
segmentGroups SegmentGroupCollection
seq optional number
trackingCollection TrackingGroupCollection
type string

Methods

Method Return Type Description
ack(segmentGroup, opArgs, mergeTree) boolean

Acks the current segment against the segment group, op, and merge tree.

Throws error if the segment state doesn't match segment group or op. E.g. Segment group not first is pending queue. Inserted segment does not have unassigned sequence number.

Returns true if the op modifies the segment, otherwise false. The only current false case is overlapping remove, where a segment is removed by a previously sequenced operation before the current operation is acked.

addProperties(newProps, op, seq, collabWindow) PropertySet | undefined
append(segment) void
canAppend(segment) boolean
clone() ISegment
splitAt(pos) ISegment | undefined
toJSONObject() any

Property Details

clientId

Signature

clientId: number;

Type: number

localRefs

Signature

localRefs?: LocalReferenceCollection;

Type: LocalReferenceCollection

localRemovedSeq

Signature

localRemovedSeq?: number;

Type: number

localSeq

Signature

localSeq?: number;

Type: number

properties

Signature

properties?: PropertySet;

Type: PropertySet

propertyManager

Signature

propertyManager?: PropertiesManager;

Type: PropertiesManager

segmentGroups

Signature

readonly segmentGroups: SegmentGroupCollection;

Type: SegmentGroupCollection

seq

Signature

seq?: number;

Type: number

trackingCollection

Signature

readonly trackingCollection: TrackingGroupCollection;

Type: TrackingGroupCollection

type

Signature

readonly type: string;

Type: string

Method Details

ack

Acks the current segment against the segment group, op, and merge tree.

Throws error if the segment state doesn't match segment group or op. E.g. Segment group not first is pending queue. Inserted segment does not have unassigned sequence number.

Returns true if the op modifies the segment, otherwise false. The only current false case is overlapping remove, where a segment is removed by a previously sequenced operation before the current operation is acked.

Signature

ack(segmentGroup: SegmentGroup, opArgs: IMergeTreeDeltaOpArgs, mergeTree: MergeTree): boolean;

Parameters

Parameter Type Description
segmentGroup SegmentGroup
opArgs IMergeTreeDeltaOpArgs
mergeTree MergeTree

Returns

Return type: boolean

addProperties

Signature

addProperties(newProps: PropertySet, op?: ICombiningOp, seq?: number, collabWindow?: CollaborationWindow): PropertySet | undefined;

Parameters

Parameter Modifiers Type Description
newProps PropertySet
op optional ICombiningOp
seq optional number
collabWindow optional CollaborationWindow

Returns

Return type: PropertySet | undefined

append

Signature

append(segment: ISegment): void;

Parameters

Parameter Type Description
segment ISegment

canAppend

Signature

canAppend(segment: ISegment): boolean;

Parameters

Parameter Type Description
segment ISegment

Returns

Return type: boolean

clone

Signature

clone(): ISegment;

Returns

Return type: ISegment

splitAt

Signature

splitAt(pos: number): ISegment | undefined;

Parameters

Parameter Type Description
pos number

Returns

Return type: ISegment | undefined

toJSONObject

Signature

toJSONObject(): any;

Returns

Return type: any