Skip to main content
Version: 1.18.x

Batch Module

Classes

Batch

Defined in: Batch.ts:15

Constructors

Constructor

> new Batch(bucketName, entryName, httpClient, type): Batch

Defined in: Batch.ts:33

Parameters
bucketName

string

entryName

string

httpClient

HttpClient

type

BatchType

Returns

Batch

Methods

add()

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

Defined in: Batch.ts:55

Add record to batch

Parameters
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(ts, labels): void

Defined in: Batch.ts:82

Add only labels to batch Use for updating labels

Parameters
ts

bigint

timestamp of record as a UNIX timestamp in microseconds

labels

LabelMap

Returns

void


addOnlyTimestamp()

> addOnlyTimestamp(ts): void

Defined in: Batch.ts:95

Add only timestamp to batch Use for removing records

Parameters
ts

bigint

timestamp of record as a UNIX timestamp in microseconds

Returns

void


clear()

> clear(): void

Defined in: Batch.ts:218

Clear batch

Returns

void


items()

> items(): IterableIterator<[bigint, &#123; contentType: string; data: Buffer; labels: LabelMap; &#125;]>

Defined in: Batch.ts:184

Get records in batch sorted by timestamp

Returns

IterableIterator<[bigint, &#123; contentType: string; data: Buffer; labels: LabelMap; &#125;]>


lastAccessTime()

> lastAccessTime(): number

Defined in: Batch.ts:204

Get last access time of batch

Returns

number


recordCount()

> recordCount(): number

Defined in: Batch.ts:211

Get number of records in batch

Returns

number


size()

> size(): bigint

Defined in: Batch.ts:197

Get total size of batch

Returns

bigint


write()

> write(): Promise<Map<bigint, APIError>>

Defined in: Batch.ts:107

Write batch to entry

Returns

Promise<Map<bigint, APIError>>