Skip to main content
Version: 1.18.x

Record Batch Module

Classes​

RecordBatch​

Defined in: RecordBatch.ts:34

Batch of records to write them in one request (batch protocol v2).

Constructors​

Constructor​

> new RecordBatch(bucketName, httpClient, type): RecordBatch

Defined in: RecordBatch.ts:42

Parameters​
bucketName​

string

httpClient​

HttpClient

type​

RecordBatchType

Returns​

RecordBatch

Methods​

add()​

> add(entry, ts, data, contentType?, labels?): void

Defined in: RecordBatch.ts:63

Add record to batch with entry name.

Parameters​
entry​

string

name of entry

ts​

bigint

timestamp of record as a UNIX timestamp in microseconds

data​

any

{Buffer | string} data to write

contentType?​

string

default: application/octet-stream

labels?​

LabelMap

default: {}

Returns​

void


addOnlyLabels()​

> addOnlyLabels(entry, ts, labels): void

Defined in: RecordBatch.ts:97

Add labels to batch for update.

Parameters​
entry​

string

name of entry

ts​

bigint

timestamp of record as a UNIX timestamp in microseconds

labels​

LabelMap

labels to update

Returns​

void


addOnlyTimestamp()​

> addOnlyTimestamp(entry, ts): void

Defined in: RecordBatch.ts:119

Add timestamps to batch for removal.

Parameters​
entry​

string

name of entry

ts​

bigint

timestamp of record as a UNIX timestamp in microseconds

Returns​

void


clear()​

> clear(): void

Defined in: RecordBatch.ts:256

Clear batch

Returns​

void


items()​

> items(): [[string, bigint], RecordBatchItem][]

Defined in: RecordBatch.ts:212

Get records in batch sorted by entry name and timestamp.

Returns​

[[string, bigint], RecordBatchItem][]


lastAccessTime()​

> lastAccessTime(): number

Defined in: RecordBatch.ts:242

Get last access time of batch

Returns​

number


recordCount()​

> recordCount(): number

Defined in: RecordBatch.ts:249

Get number of records in batch

Returns​

number


send()​

> send(): Promise<Map<string, Map<bigint, APIError>>>

Defined in: RecordBatch.ts:140

Send batch request (Multi-entry API).

Returns​

Promise<Map<string, Map<bigint, APIError>>>


size()​

> size(): bigint

Defined in: RecordBatch.ts:235

Get total size of batch

Returns​

bigint

Enumerations​

RecordBatchType​

Defined in: RecordBatch.ts:25

Enumeration Members​

REMOVE​

> REMOVE: 2

Defined in: RecordBatch.ts:28


UPDATE​

> UPDATE: 1

Defined in: RecordBatch.ts:27


WRITE​

> WRITE: 0

Defined in: RecordBatch.ts:26