Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConnectionImpl

Hierarchy

Implements

Index

Constructors

constructor

Properties

connection

connection: AntidoteConnection

dataFormat

dataFormat: DataFormat = new MsgpackDataFormat()

The DataFormat to use for decoding and encoding binary values. The default is MsgpackDataFormat.

defaultBucket

defaultBucket: string = "default-bucket"

the default bucket used for newly created keys

Private lastCommitTimestamp

lastCommitTimestamp: ByteBuffer | undefined = undefined

stores the last commit time.

minSnapshotTime

minSnapshotTime: ByteBuffer | undefined = undefined

The minimum snapshot version to use for new transactions. This will be used when starting a new transaction in order to guarantee session guarantees like monotonic reads and read-your-writes

monotonicSnapshots

monotonicSnapshots: boolean = false

Option, which determines if snapshots should be monotonic. If set to true, this will update minSnapshotTime whenever lastCommitTimestamp is updated

Methods

binaryToJs

  • binaryToJs(byteBuffer: ByteBuffer): any

childUpdate

  • childUpdate(key: ApbBoundObject, operation: ApbUpdateOperation): ApbUpdateOp

close

  • close(): void

completeTransaction

counter

fatCounter

flag_dw

flag_ew

getBucket

  • getBucket(): string

getLastCommitTimestamp

  • getLastCommitTimestamp(): ByteBuffer | undefined

gmap

jsToBinary

  • jsToBinary(obj: any): ByteBuffer

multiValueRegister

readBatch

readObjectsBatch

  • readObjectsBatch<T>(objects: object): Promise<object>
  • Reads several objects at once. The objects are stored in an object. Returns a new object with the read values stored under the same field in the object.

        let objA = connection.counter("batch-object-read counter a")
        let objB = connection.register<string>("batch-object-read register b")
    
        let vals = await connection.readObjectsBatch({
            a: objA,
            b: objB
        });
        // could return: {a: 1, b: "hi"}
    

    Hint: To read a single object, use the read method on that object.

    Type parameters

    • T

    Parameters

    • objects: object

    Returns Promise<object>

readResponseToValue

  • readResponseToValue(type: CRDT_type, response: ApbReadObjectResp): any

register

rrmap

set

Private setLastCommitTimestamp

  • setLastCommitTimestamp(lastCommitTimestamp: ByteBuffer | undefined): void
  • Parameters

    • lastCommitTimestamp: ByteBuffer | undefined

    Returns void

setTimeout

  • setTimeout(ms: number): void

set_removeWins

  • set_removeWins<T>(key: string): CrdtSet<T>

startTransaction

Private startTransactionPb

  • startTransactionPb(): ApbStartTransaction
  • creates a startTransaction message with the last timestamp and default transaction properties

    Returns ApbStartTransaction

update

  • update(updates: ApbUpdateOp[] | ApbUpdateOp): Promise<CommitResponse>

Generated using TypeDoc