Class SnowflakeStreamingIngestClientInternal<T>
- java.lang.Object
-
- net.snowflake.ingest.streaming.internal.SnowflakeStreamingIngestClientInternal<T>
-
- Type Parameters:
T- type of column data (ParquetChunkData)
- All Implemented Interfaces:
AutoCloseable,SnowflakeStreamingIngestClient
public class SnowflakeStreamingIngestClientInternal<T> extends Object implements SnowflakeStreamingIngestClient
The first version of implementation for SnowflakeStreamingIngestClient. The client internally manages a few things:- the channel cache, which contains all the channels that belong to this account
- the flush service, which schedules and coordinates the flush to Snowflake tables
-
-
Constructor Summary
Constructors Constructor Description SnowflakeStreamingIngestClientInternal(String name, SnowflakeURL accountURL, Properties prop, Map<String,Object> parameterOverrides)Default Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the client, which will flush first and then release all the resourcesMap<String,String>getLatestCommittedOffsetTokens(List<SnowflakeStreamingIngestChannel> channels)Return the latest committed/persisted offset token for all channelsStringgetName()Get the client namevoidinjectRequestBuilder(RequestBuilder requestBuilder)booleanisClosed()Check whether the client is closed or not, if you want to make sure all data are committed before closing, please callAutoCloseable.close()before closing the entire clientnet.snowflake.ingest.streaming.internal.SnowflakeStreamingIngestChannelInternal<?>openChannel(OpenChannelRequest request)Open a channel against a Snowflake tablevoidsetRefreshToken(String refreshToken)Set refresh token, this method is for refresh token renewal without requiring to restart client.
-
-
-
Constructor Detail
-
SnowflakeStreamingIngestClientInternal
public SnowflakeStreamingIngestClientInternal(String name, SnowflakeURL accountURL, Properties prop, Map<String,Object> parameterOverrides)
Default Constructor- Parameters:
name- the name of the clientaccountURL- Snowflake account urlprop- connection propertiesparameterOverrides- map of parameters to override for this client
-
-
Method Detail
-
injectRequestBuilder
public void injectRequestBuilder(RequestBuilder requestBuilder)
-
getName
public String getName()
Get the client name- Specified by:
getNamein interfaceSnowflakeStreamingIngestClient- Returns:
- the client name
-
isClosed
public boolean isClosed()
Description copied from interface:SnowflakeStreamingIngestClientCheck whether the client is closed or not, if you want to make sure all data are committed before closing, please callAutoCloseable.close()before closing the entire client- Specified by:
isClosedin interfaceSnowflakeStreamingIngestClient- Returns:
- a boolean to indicate whether the client is closed or not
-
openChannel
public net.snowflake.ingest.streaming.internal.SnowflakeStreamingIngestChannelInternal<?> openChannel(OpenChannelRequest request)
Open a channel against a Snowflake table- Specified by:
openChannelin interfaceSnowflakeStreamingIngestClient- Parameters:
request- the open channel request- Returns:
- a SnowflakeStreamingIngestChannel object
-
getLatestCommittedOffsetTokens
public Map<String,String> getLatestCommittedOffsetTokens(List<SnowflakeStreamingIngestChannel> channels)
Return the latest committed/persisted offset token for all channels- Specified by:
getLatestCommittedOffsetTokensin interfaceSnowflakeStreamingIngestClient- Returns:
- map of channel to the latest persisted offset token
-
close
public void close() throws ExceptionClose the client, which will flush first and then release all the resources- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
setRefreshToken
public void setRefreshToken(String refreshToken)
Set refresh token, this method is for refresh token renewal without requiring to restart client. This method only works when the authorization type is OAuth- Specified by:
setRefreshTokenin interfaceSnowflakeStreamingIngestClient- Parameters:
refreshToken- the new refresh token
-
-