Class StreamingClientProvider
- java.lang.Object
-
- com.snowflake.kafka.connector.internal.streaming.StreamingClientProvider
-
public class StreamingClientProvider extends Object
Factory that provides the streaming client(s). There should only be one provider, but it may provide multiple clients if optimizations are disabled - see ENABLE_STREAMING_CLIENT_OPTIMIZATION_CONFIG in theSnowflakeSinkConnectorConfig
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseClient(net.snowflake.ingest.streaming.SnowflakeStreamingIngestClient client)Closes the given clientnet.snowflake.ingest.streaming.SnowflakeStreamingIngestClientgetClient(Map<String,String> connectorConfig)Gets the current client or creates a new one from the given connector config.static StreamingClientProvidergetStreamingClientProviderForTests(net.snowflake.ingest.streaming.SnowflakeStreamingIngestClient parameterEnabledClient, StreamingClientHandler streamingClientHandler)ONLY FOR TESTING - to get a provider with injected propertiesstatic StreamingClientProvidergetStreamingClientProviderInstance()Gets the current streaming provider
-
-
-
Method Detail
-
getStreamingClientProviderInstance
public static StreamingClientProvider getStreamingClientProviderInstance()
Gets the current streaming provider- Returns:
- The streaming client provider
-
getStreamingClientProviderForTests
public static StreamingClientProvider getStreamingClientProviderForTests(net.snowflake.ingest.streaming.SnowflakeStreamingIngestClient parameterEnabledClient, StreamingClientHandler streamingClientHandler)
ONLY FOR TESTING - to get a provider with injected properties
-
getClient
public net.snowflake.ingest.streaming.SnowflakeStreamingIngestClient getClient(Map<String,String> connectorConfig)
Gets the current client or creates a new one from the given connector config. If client optimization is not enabled, it will create a new streaming client and the caller is responsible for closing it- Parameters:
connectorConfig- The connector config- Returns:
- A streaming client
-
closeClient
public void closeClient(net.snowflake.ingest.streaming.SnowflakeStreamingIngestClient client)
Closes the given client- Parameters:
client- The client to be closed
-
-