This represents a transaction on a given Stream.

Hierarchy

  • Transaction

Properties

abort: (() => Promise<void>)

Type declaration

    • (): Promise<void>
    • Abort the Transaction. Drops the transaction, causing all events written to it to be deleted.

      Returns Promise<void>

commit: (() => Promise<void>)

Type declaration

    • (): Promise<void>
    • Commit the Transaction. This Causes all messages previously written to the transaction to go into the stream contiguously. This operation will either fully succeed making all events consumable or fully fail such that none of them are. There may be some time delay before readers see the events after this call has returned.

      Returns Promise<void>

commit_timestamp: ((timestamp: number) => Promise<void>)

Type declaration

    • (timestamp: number): Promise<void>
    • Commit the Transaction and the associated timestamp. This Causes all messages previously written to the transaction to go into the stream contiguously. This operation will either fully succeed making all events consumable or fully fail such that none of them are. There may be some time delay before readers see the events after this call has returned.

      Parameters

      • timestamp: number

      Returns Promise<void>

get_txn_id: (() => BigInt)

Type declaration

    • (): BigInt
    • Return the transaction id in unsigned integer 128 format.

      Returns BigInt

is_open: (() => Promise<boolean>)

Type declaration

    • (): Promise<boolean>
    • Check if the transaction is an OPEN state.

      Returns Promise<boolean>

toString: (() => string)

Type declaration

    • (): string
    • Returns the string representation of the transaction including its id and scoped stream.

      Returns string

write_event: ((event: string, routing_key?: string) => Promise<void>)

Type declaration

    • (event: string, routing_key?: string): Promise<void>
    • Write an event into the Pravega Stream. The event of type string is converted into bytes with UTF-8 encoding.

      Parameters

      • event: string
      • Optional routing_key: string

      Returns Promise<void>

write_event_bytes: ((buf: Uint8Array, routing_key?: string) => Promise<void>)

Type declaration

    • (buf: Uint8Array, routing_key?: string): Promise<void>
    • Write a byte array into the Pravega Stream. This is similar to write_event(...) api except that the the event to be written is a byte array.

      Parameters

      • buf: Uint8Array
      • Optional routing_key: string

      Returns Promise<void>

Generated using TypeDoc