SqlServerSink Class

public final class SqlServerSink
extends CopySink

A copy activity SQL server sink.

Constructor Summary

Constructor Description
SqlServerSink()

Creates an instance of SqlServerSink class.

Method Summary

Modifier and Type Method and Description
static SqlServerSink fromJson(JsonReader jsonReader)

Reads an instance of SqlServerSink from the JsonReader.

Object preCopyScript()

Get the preCopyScript property: SQL pre-copy script.

Object sqlWriterStoredProcedureName()

Get the sqlWriterStoredProcedureName property: SQL writer stored procedure name.

Object sqlWriterTableType()

Get the sqlWriterTableType property: SQL writer table type.

Object sqlWriterUseTableLock()

Get the sqlWriterUseTableLock property: Whether to use table lock during bulk copy.

Object storedProcedureParameters()

Get the storedProcedureParameters property: SQL stored procedure parameters.

Object storedProcedureTableTypeParameterName()

Get the storedProcedureTableTypeParameterName property: The stored procedure parameter name of the table type.

Object tableOption()

Get the tableOption property: The option to handle sink table, such as autoCreate.

JsonWriter toJson(JsonWriter jsonWriter)
String type()

Get the type property: Copy sink type.

SqlUpsertSettings upsertSettings()

Get the upsertSettings property: SQL upsert settings.

void validate()

Validates the instance.

SqlServerSink withDisableMetricsCollection(Object disableMetricsCollection)

Set the disableMetricsCollection property: If true, disable data store metrics collection.

SqlServerSink withMaxConcurrentConnections(Object maxConcurrentConnections)

Set the maxConcurrentConnections property: The maximum concurrent connection count for the sink data store.

SqlServerSink withPreCopyScript(Object preCopyScript)

Set the preCopyScript property: SQL pre-copy script.

SqlServerSink withSinkRetryCount(Object sinkRetryCount)

Set the sinkRetryCount property: Sink retry count.

SqlServerSink withSinkRetryWait(Object sinkRetryWait)

Set the sinkRetryWait property: Sink retry wait.

SqlServerSink withSqlWriterStoredProcedureName(Object sqlWriterStoredProcedureName)

Set the sqlWriterStoredProcedureName property: SQL writer stored procedure name.

SqlServerSink withSqlWriterTableType(Object sqlWriterTableType)

Set the sqlWriterTableType property: SQL writer table type.

SqlServerSink withSqlWriterUseTableLock(Object sqlWriterUseTableLock)

Set the sqlWriterUseTableLock property: Whether to use table lock during bulk copy.

SqlServerSink withStoredProcedureParameters(Object storedProcedureParameters)

Set the storedProcedureParameters property: SQL stored procedure parameters.

SqlServerSink withStoredProcedureTableTypeParameterName(Object storedProcedureTableTypeParameterName)

Set the storedProcedureTableTypeParameterName property: The stored procedure parameter name of the table type.

SqlServerSink withTableOption(Object tableOption)

Set the tableOption property: The option to handle sink table, such as autoCreate.

SqlServerSink withUpsertSettings(SqlUpsertSettings upsertSettings)

Set the upsertSettings property: SQL upsert settings.

SqlServerSink withWriteBatchSize(Object writeBatchSize)

Set the writeBatchSize property: Write batch size.

SqlServerSink withWriteBatchTimeout(Object writeBatchTimeout)

Set the writeBatchTimeout property: Write batch timeout.

SqlServerSink withWriteBehavior(Object writeBehavior)

Set the writeBehavior property: Write behavior when copying data into sql server.

Object writeBehavior()

Get the writeBehavior property: Write behavior when copying data into sql server.

Methods inherited from CopySink

Methods inherited from java.lang.Object

Constructor Details

SqlServerSink

public SqlServerSink()

Creates an instance of SqlServerSink class.

Method Details

fromJson

public static SqlServerSink fromJson(JsonReader jsonReader)

Reads an instance of SqlServerSink from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of SqlServerSink if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the SqlServerSink.

preCopyScript

public Object preCopyScript()

Get the preCopyScript property: SQL pre-copy script. Type: string (or Expression with resultType string).

Returns:

the preCopyScript value.

sqlWriterStoredProcedureName

public Object sqlWriterStoredProcedureName()

Get the sqlWriterStoredProcedureName property: SQL writer stored procedure name. Type: string (or Expression with resultType string).

Returns:

the sqlWriterStoredProcedureName value.

sqlWriterTableType

public Object sqlWriterTableType()

Get the sqlWriterTableType property: SQL writer table type. Type: string (or Expression with resultType string).

Returns:

the sqlWriterTableType value.

sqlWriterUseTableLock

public Object sqlWriterUseTableLock()

Get the sqlWriterUseTableLock property: Whether to use table lock during bulk copy. Type: boolean (or Expression with resultType boolean).

Returns:

the sqlWriterUseTableLock value.

storedProcedureParameters

public Object storedProcedureParameters()

Get the storedProcedureParameters property: SQL stored procedure parameters.

Returns:

the storedProcedureParameters value.

storedProcedureTableTypeParameterName

public Object storedProcedureTableTypeParameterName()

Get the storedProcedureTableTypeParameterName property: The stored procedure parameter name of the table type. Type: string (or Expression with resultType string).

Returns:

the storedProcedureTableTypeParameterName value.

tableOption

public Object tableOption()

Get the tableOption property: The option to handle sink table, such as autoCreate. For now only 'autoCreate' value is supported. Type: string (or Expression with resultType string).

Returns:

the tableOption value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

SqlServerSink.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public String type()

Get the type property: Copy sink type.

Overrides:

SqlServerSink.type()

Returns:

the type value.

upsertSettings

public SqlUpsertSettings upsertSettings()

Get the upsertSettings property: SQL upsert settings.

Returns:

the upsertSettings value.

validate

public void validate()

Validates the instance.

Overrides:

SqlServerSink.validate()

withDisableMetricsCollection

public SqlServerSink withDisableMetricsCollection(Object disableMetricsCollection)

Set the disableMetricsCollection property: If true, disable data store metrics collection. Default is false. Type: boolean (or Expression with resultType boolean).

Overrides:

SqlServerSink.withDisableMetricsCollection(Object disableMetricsCollection)

Parameters:

disableMetricsCollection

withMaxConcurrentConnections

public SqlServerSink withMaxConcurrentConnections(Object maxConcurrentConnections)

Set the maxConcurrentConnections property: The maximum concurrent connection count for the sink data store. Type: integer (or Expression with resultType integer).

Overrides:

SqlServerSink.withMaxConcurrentConnections(Object maxConcurrentConnections)

Parameters:

maxConcurrentConnections

withPreCopyScript

public SqlServerSink withPreCopyScript(Object preCopyScript)

Set the preCopyScript property: SQL pre-copy script. Type: string (or Expression with resultType string).

Parameters:

preCopyScript - the preCopyScript value to set.

Returns:

the SqlServerSink object itself.

withSinkRetryCount

public SqlServerSink withSinkRetryCount(Object sinkRetryCount)

Set the sinkRetryCount property: Sink retry count. Type: integer (or Expression with resultType integer).

Overrides:

SqlServerSink.withSinkRetryCount(Object sinkRetryCount)

Parameters:

sinkRetryCount

withSinkRetryWait

public SqlServerSink withSinkRetryWait(Object sinkRetryWait)

Set the sinkRetryWait property: Sink retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).

Overrides:

SqlServerSink.withSinkRetryWait(Object sinkRetryWait)

Parameters:

sinkRetryWait

withSqlWriterStoredProcedureName

public SqlServerSink withSqlWriterStoredProcedureName(Object sqlWriterStoredProcedureName)

Set the sqlWriterStoredProcedureName property: SQL writer stored procedure name. Type: string (or Expression with resultType string).

Parameters:

sqlWriterStoredProcedureName - the sqlWriterStoredProcedureName value to set.

Returns:

the SqlServerSink object itself.

withSqlWriterTableType

public SqlServerSink withSqlWriterTableType(Object sqlWriterTableType)

Set the sqlWriterTableType property: SQL writer table type. Type: string (or Expression with resultType string).

Parameters:

sqlWriterTableType - the sqlWriterTableType value to set.

Returns:

the SqlServerSink object itself.

withSqlWriterUseTableLock

public SqlServerSink withSqlWriterUseTableLock(Object sqlWriterUseTableLock)

Set the sqlWriterUseTableLock property: Whether to use table lock during bulk copy. Type: boolean (or Expression with resultType boolean).

Parameters:

sqlWriterUseTableLock - the sqlWriterUseTableLock value to set.

Returns:

the SqlServerSink object itself.

withStoredProcedureParameters

public SqlServerSink withStoredProcedureParameters(Object storedProcedureParameters)

Set the storedProcedureParameters property: SQL stored procedure parameters.

Parameters:

storedProcedureParameters - the storedProcedureParameters value to set.

Returns:

the SqlServerSink object itself.

withStoredProcedureTableTypeParameterName

public SqlServerSink withStoredProcedureTableTypeParameterName(Object storedProcedureTableTypeParameterName)

Set the storedProcedureTableTypeParameterName property: The stored procedure parameter name of the table type. Type: string (or Expression with resultType string).

Parameters:

storedProcedureTableTypeParameterName - the storedProcedureTableTypeParameterName value to set.

Returns:

the SqlServerSink object itself.

withTableOption

public SqlServerSink withTableOption(Object tableOption)

Set the tableOption property: The option to handle sink table, such as autoCreate. For now only 'autoCreate' value is supported. Type: string (or Expression with resultType string).

Parameters:

tableOption - the tableOption value to set.

Returns:

the SqlServerSink object itself.

withUpsertSettings

public SqlServerSink withUpsertSettings(SqlUpsertSettings upsertSettings)

Set the upsertSettings property: SQL upsert settings.

Parameters:

upsertSettings - the upsertSettings value to set.

Returns:

the SqlServerSink object itself.

withWriteBatchSize

public SqlServerSink withWriteBatchSize(Object writeBatchSize)

Set the writeBatchSize property: Write batch size. Type: integer (or Expression with resultType integer), minimum: 0.

Overrides:

SqlServerSink.withWriteBatchSize(Object writeBatchSize)

Parameters:

writeBatchSize

withWriteBatchTimeout

public SqlServerSink withWriteBatchTimeout(Object writeBatchTimeout)

Set the writeBatchTimeout property: Write batch timeout. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).

Overrides:

SqlServerSink.withWriteBatchTimeout(Object writeBatchTimeout)

Parameters:

writeBatchTimeout

withWriteBehavior

public SqlServerSink withWriteBehavior(Object writeBehavior)

Set the writeBehavior property: Write behavior when copying data into sql server. Type: string (or Expression with resultType string).

Parameters:

writeBehavior - the writeBehavior value to set.

Returns:

the SqlServerSink object itself.

writeBehavior

public Object writeBehavior()

Get the writeBehavior property: Write behavior when copying data into sql server. Type: string (or Expression with resultType string).

Returns:

the writeBehavior value.

Applies to