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

PropertyModifiersTypeDescription
clientIdnumber
localRefsoptionalLocalReferenceCollection
localRemovedSeqoptionalnumber
localSeqoptionalnumber
propertiesoptionalPropertySet
propertyManageroptionalPropertiesManager
segmentGroupsSegmentGroupCollection
seqoptionalnumber
trackingCollectionTrackingGroupCollection
typestring

Methods

MethodReturn TypeDescription
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

ParameterTypeDescription
segmentGroupSegmentGroup
opArgsIMergeTreeDeltaOpArgs
mergeTreeMergeTree

Returns

Return type: boolean

addProperties

Signature

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

Parameters

ParameterModifiersTypeDescription
newPropsPropertySet
opoptionalICombiningOp
seqoptionalnumber
collabWindowoptionalCollaborationWindow

Returns

Return type: PropertySet | undefined

append

Signature

append(segment: ISegment): void;

Parameters

ParameterTypeDescription
segmentISegment

canAppend

Signature

canAppend(segment: ISegment): boolean;

Parameters

ParameterTypeDescription
segmentISegment

Returns

Return type: boolean

clone

Signature

clone(): ISegment;

Returns

Return type: ISegment

splitAt

Signature

splitAt(pos: number): ISegment | undefined;

Parameters

ParameterTypeDescription
posnumber

Returns

Return type: ISegment | undefined

toJSONObject

Signature

toJSONObject(): any;

Returns

Return type: any