Fluent Handler API

Handler API is used to configure handler. Handler is the entity in masking process that reads and writes data from a data source.

When you import data source in Designer it automatically creates entity maskings in Toolbox that contains an activity called Handling strategy. It has an input called Handler and this is where we configure handler.

There are 5 groups of settings that must be specified in order they are documented. You can skip a setting group if you don't need it. Each configuration must contain one writer strategy setting, that is either bulk or SQL setting.

Table of contents
Reader settings
Segments settings
Insert settings
Bulk settings
SQL settings

Reader settings

Specifies reader configuration. To start configuring write .WithReader().

Setting Description Data type
Timeout Read command timeout Number (seconds)
TransactionIsolationLevel Read transaction isolation level System.Data.IsolationLevel
Join Select statement to join as related data Select statement, join criteria

Examples

Customer.Handle.WithReader().Timeout(1000).WithBulk()

Customer.Handle.WithReader().Join("Select City, CustomerID from dbo.Address", "{table}.CustomerID={related}.CustomerID").WithBulk()

Segments settings

Specifies segments or partitions to split table and process in parallel. To start configuring write .WithSegments().

Setting Description Data type
BySegments Array of range conditions Array of strings
ByPartitions Sets ranges defined by range-partitioned tables -

Examples

Customer.Handle.WithSegments().BySegments("{table}.ID<=100","{table}.ID>100 and {table}.ID<=200","{table}.ID>200 and {table}.ID<=300").WithBulk()

Customer.Handle.WithSegments().BySegments("{table}.Region in ('CA')","{table}.Region in ('NY')").WithBulk()

Customer.Handle.WithSegments().ByPartitions().WithBulk()

Insert settings

Specifies synthetic data generation. To start configuring write .WithInsert().

Setting Description Data type
NewItemsCount Number of empty items to insert Number
NewItems Collection of new items to insert IEnumerable<tablerecord>

Example

Customer.Handle.WithInsert().NewItemsCount(1000).WithBulk()

Bulk settings

Specifies writer strategy to use bulk operations. To start configuring write .WithBulk().

Setting Description Data type
BatchSize Determines the batch size used for reading/writing. Default is 200000. Number (records per batch)
Timeout Sets the timeout (in seconds) allowed before an error is thrown. Default is 5400. Number (seconds)
KeepIdentity If true, 'identity' fields will retain their values. Default is null. Boolean
TableLock If true, only one table can be merged at a time. Default is null. Boolean
HandlerNaming Provide additional unique strings to use when generating handler names. String (salt)

Example

Customer.Handle.WithBulk().Timeout(600).TableLock(true)

SQL settings

Specifies writer strategy to use sql insert/updated operations. To start configuring write .WithSQL().

Setting Description Data type
BatchSize Determines the batch size used for reading/writing. Default is 50. Number (records per batch)
KeepIdentity If true, 'identity' fields will retain their values. Default is null. Boolean
NumberOfWriters Number of writers to use in parallel Number

Example

Customer.Handle.WithSQL().Timeout(1000)