Class Topic<Value>Internal

Type Parameters

  • Value

Hierarchy (view full)

Constructors

  • Type Parameters

    • Value

    Parameters

    • Optional fields: {
          accumulate?: boolean;
          unique?: boolean;
      }
      • Optional accumulate?: boolean
      • Optional unique?: boolean

    Returns Topic<Value>

Properties

UpdateType: Value | Value[]
ValueType: Value[]
accumulate: boolean
lc_graph_name: string

The name of the channel.

seen: Set<Value>
unique: boolean
values: Value[]

Methods

  • Return a string representation of the channel's current state.

    Returns [Value[], Value[]]

    Throws

    if the channel is empty (never updated yet), or doesn't support checkpoints.

  • Mark the current value of the channel as consumed. By default, no-op. This is called by Pregel before the start of the next step, for all channels that triggered a node. If the channel was updated, return true.

    Returns boolean

  • Return a new identical channel, optionally initialized from a checkpoint. Can be thought of as a "restoration" from a checkpoint which is a "snapshot" of the channel's state.

    Parameters

    Returns this

  • Return the current value of the channel.

    Returns Value[]

    Throws

    if the channel is empty (never updated yet).

  • Update the channel's value with the given sequence of updates. The order of the updates in the sequence is arbitrary. This method is called by Pregel for all channels at the end of each step. If there are no updates, it is called with an empty sequence.

    Raises InvalidUpdateError if the sequence of updates is invalid. Returns True if the channel was updated, False otherwise.

    Parameters

    Returns boolean

    Throws

    if the sequence of updates is invalid.