Skip to main content

Sink - SinkBuilder

Sink.SinkBuilder

Create a SinkBuilder to build a data

Sink.

Methods on the SinkBuilder enable you to emit stream data to external systems. If the

Stream is a BlobType, specialised operations can be applied to perform an ftp put of the Stream.

Quality of data can be observed using assert and warn by providing expression based conditions and messages to the whole

Stream.

A corresponding

Template can be created using .toTemplate().

Param

the name of the

Sink to create

Remarks

See

Transform Data for a related learning module.

Example

 // get a predefined blob stream
const file = Stream("File", BlobType);
// get a predefined uri stream
const uri = Stream("uri", StringType)
// put the contents of the file at the uri
const sink = new SinkBuilder("Ftp")
.from(file)
.input({ name: "uri", stream: uri })
.assert({
predicate: uri => NotEqual(uri, ''),
message: "Uri is empty"
})
.ftp({
uri: (inputs) => inputs.uri,
})
.toTemplate();

Sink

constructor

new SinkBuilder(name, module?):

SinkBuilder

Create a SinkBuilder to build a data

Sink.

Methods on the SinkBuilder enable you to emit stream data to external systems. If the

Stream is a BlobType, specialised operations can be applied to perform an ftp put of the Stream.

Quality of data can be observed using assert and warn by providing expression based conditions and messages to the whole

Stream.

A corresponding

Template can be created using .toTemplate().

Parameters

NameTypeDescription
namestringthe name of the Sink to create
module?ModulePath | ModuleBuilder-

Returns

SinkBuilder

Remarks

See

Transform Data for a related learning module.

Example

 // get a predefined blob stream
const file = Stream("File", BlobType);
// get a predefined uri stream
const uri = Stream("uri", StringType)
// put the contents of the file at the uri
const sink = new SinkBuilder("Ftp")
.from(file)
.input({ name: "uri", stream: uri })
.assert({
predicate: uri => NotEqual(uri, ''),
message: "Uri is empty"
})
.ftp({
uri: (inputs) => inputs.uri,
})
.toTemplate();

Sink

```typescript // get a predefined blob stream const file = Stream("File", BlobType);

const sink = new SinkBuilder("Ftp") .from(file) .toTemplate(); ```

from

from(stream):

BlobSinkBuilder

Define the

Stream to construct the Sink from.

Type parameters

NameType
Textends BlobType

Parameters

NameTypeDescription
streamStreamthe input Stream for the Sink

Returns

BlobSinkBuilder

a new

SinkBuilder