public final class RequestBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CLIENT_NAME |
static String |
DEFAULT_HOST_SUFFIX |
static String |
DEFAULT_VERSION |
static String |
JAVA_USER_AGENT |
static String |
OS_INFO_USER_AGENT_FORMAT |
| Constructor and Description |
|---|
RequestBuilder(String accountName,
String userName,
KeyPair keyPair)
RequestBuilder - general usage constructor
|
RequestBuilder(String accountName,
String userName,
KeyPair keyPair,
String schemeName,
String hostName,
int portNum)
Constructor to use if not intended to use userAgentSuffix.
|
RequestBuilder(String accountName,
String userName,
KeyPair keyPair,
String schemeName,
String hostName,
int portNum,
String userAgentSuffix)
RequestBuilder - this constructor is for testing purposes only
|
RequestBuilder(String accountName,
String userName,
String hostName,
KeyPair keyPair,
String userAgentSuffix)
RequestBuilder constructor which uses default schemes, host and port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeResources()
Closes the resources being used by RequestBuilder object.
|
org.apache.http.client.methods.HttpGet |
generateHistoryRangeRequest(UUID requestId,
String pipe,
String startTimeInclusive,
String endTimeExclusive)
generateHistoryRangeRequest - given a requestId and a pipe, get history for all ingests between
time ranges start-end
|
org.apache.http.client.methods.HttpGet |
generateHistoryRequest(UUID requestId,
String pipe,
Integer recentSeconds,
String beginMark)
generateHistoryRequest - given a requestId and a pipe, make a history request
|
org.apache.http.client.methods.HttpPost |
generateInsertRequest(UUID requestId,
String pipe,
List<StagedFileWrapper> files,
boolean showSkippedFiles)
generateInsertRequest - given a table, stage and list of files, make a request for the insert
endpoint
|
public static final String DEFAULT_HOST_SUFFIX
public static final String CLIENT_NAME
public static final String DEFAULT_VERSION
public static final String JAVA_USER_AGENT
public static final String OS_INFO_USER_AGENT_FORMAT
public RequestBuilder(String accountName, String userName, KeyPair keyPair)
accountName - - the name of the Snowflake account to which we're connectinguserName - - the username of the entity loading fileskeyPair - - the Public/Private key pair we'll use to authenticatepublic RequestBuilder(String accountName, String userName, String hostName, KeyPair keyPair, String userAgentSuffix)
accountName - - the name of the Snowflake account to which we're connectinguserName - - the username of the entity loading fileskeyPair - - the Public/Private key pair we'll use to authenticatepublic RequestBuilder(String accountName, String userName, KeyPair keyPair, String schemeName, String hostName, int portNum)
accountName - - the account name to which we're connectinguserName - - for whom are we connecting?keyPair - - our auth credentialsschemeName - - are we HTTP or HTTPS?hostName - - the host for this snowflake instanceportNum - - the port numberpublic RequestBuilder(String accountName, String userName, KeyPair keyPair, String schemeName, String hostName, int portNum, String userAgentSuffix)
accountName - - the account name to which we're connectinguserName - - for whom are we connecting?keyPair - - our auth credentialsschemeName - - are we HTTP or HTTPS?hostName - - the host for this snowflake instanceportNum - - the port numberuserAgentSuffix - - The suffix part of HTTP Header User-Agentpublic org.apache.http.client.methods.HttpPost generateInsertRequest(UUID requestId, String pipe, List<StagedFileWrapper> files, boolean showSkippedFiles) throws URISyntaxException
requestId - a UUID we will use to label this requestpipe - a fully qualified pipe namefiles - a list of filesshowSkippedFiles - a boolean which returns skipped files when set to trueURISyntaxException - if the URI components provided are improperpublic org.apache.http.client.methods.HttpGet generateHistoryRequest(UUID requestId, String pipe, Integer recentSeconds, String beginMark) throws URISyntaxException
requestId - a UUID we will use to label this requestpipe - a fully qualified pipe namerecentSeconds - history only for items in the recentSeconds windowbeginMark - mark from which history should be fetchedURISyntaxException - - If the URI components provided are improperpublic org.apache.http.client.methods.HttpGet generateHistoryRangeRequest(UUID requestId, String pipe, String startTimeInclusive, String endTimeExclusive) throws URISyntaxException
requestId - a UUID we will use to label this requestpipe - a fully qualified pipe namestartTimeInclusive - Start time inclusive of scan range, in ISO-8601 format. Missing
millisecond part in string will lead to a zero milliseconds. This is a required query
parameter, and a 400 will be returned if this query parameter is missingendTimeExclusive - End time exclusive of scan range. If this query parameter is missing or
user provided value is later than current millis, then current millis is used.URISyntaxExceptionpublic void closeResources()
SecurityManager is one such
resource which uses a threadpool which needs to be shutdown once SimpleIngestManager is done
interacting with Snowpipe Service (Rest APIs)ExceptionCopyright © 2021. All rights reserved.