Class 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 the SnowflakeSinkConnectorConfig
    • 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