Class SnowflakeSinkServiceImpl
- java.lang.Object
-
- io.deltastream.flink.connector.snowflake.sink.internal.SnowflakeSinkServiceImpl
-
- All Implemented Interfaces:
SnowflakeSinkService,AutoCloseable
@Internal public class SnowflakeSinkServiceImpl extends Object implements SnowflakeSinkService
This class is the service implementation for managing ingest client and channel for writing Snowflake rows to a db.schema.table in the external service.
-
-
Constructor Summary
Constructors Constructor Description SnowflakeSinkServiceImpl(String appId, int taskId, Properties connectionConfig, SnowflakeWriterConfig writerConfig, SnowflakeChannelConfig channelConfig, org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup)Construct a new sink service to provide APIs to the Snowflake service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()Flush internal data, if applicable.net.snowflake.ingest.streaming.SnowflakeStreamingIngestChannelgetChannel()SnowflakeChannelConfiggetChannelConfig()StringgetChannelName()net.snowflake.ingest.streaming.SnowflakeStreamingIngestClientgetClient()SnowflakeWriterConfiggetWriterConfig()voidinsert(Map<String,Object> row)Insert aMapserialized record to be written.
-
-
-
Constructor Detail
-
SnowflakeSinkServiceImpl
public SnowflakeSinkServiceImpl(String appId, int taskId, Properties connectionConfig, SnowflakeWriterConfig writerConfig, SnowflakeChannelConfig channelConfig, org.apache.flink.metrics.groups.SinkWriterMetricGroup metricGroup)
Construct a new sink service to provide APIs to the Snowflake service.- Parameters:
appId-StringUID for Flink jobtaskId-IntegerFlink subtask IDconnectionConfig-PropertiesSnowflake connection settingswriterConfig-SnowflakeWriterConfigchannelConfig-SnowflakeChannelConfigmetricGroup-SinkWriterMetricGroup
-
-
Method Detail
-
getWriterConfig
public SnowflakeWriterConfig getWriterConfig()
-
getChannelConfig
public SnowflakeChannelConfig getChannelConfig()
-
getClient
public net.snowflake.ingest.streaming.SnowflakeStreamingIngestClient getClient()
-
getChannelName
public String getChannelName()
-
getChannel
public net.snowflake.ingest.streaming.SnowflakeStreamingIngestChannel getChannel()
-
insert
public void insert(Map<String,Object> row) throws IOException
Description copied from interface:SnowflakeSinkServiceInsert aMapserialized record to be written.- Specified by:
insertin interfaceSnowflakeSinkService- Parameters:
row-Mapserialized Snowflake row to insert- Throws:
IOException
-
flush
public void flush()
Description copied from interface:SnowflakeSinkServiceFlush internal data, if applicable.- Specified by:
flushin interfaceSnowflakeSinkService
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-