Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1016469: Adding missing comments to public methods #1928

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a936500
Adding missing comments to public methods part 1
sfc-gh-ext-simba-jf Oct 17, 2024
bdf5c36
Add missing comments part 2
sfc-gh-ext-simba-jf Oct 17, 2024
221e202
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 17, 2024
6efb936
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 23, 2024
a261619
Adding missing javadocs part 3
sfc-gh-ext-simba-jf Oct 23, 2024
b5800ba
Add missing javadocs part 4
sfc-gh-ext-simba-jf Oct 23, 2024
a91a006
java doc update part 5
sfc-gh-ext-simba-jf Oct 23, 2024
3e0678b
java doc update part 6
sfc-gh-ext-simba-jf Oct 23, 2024
34c6737
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 23, 2024
47632ba
Added more javadocs part 7
sfc-gh-ext-simba-jf Oct 24, 2024
9123e30
java doc update part 8
sfc-gh-ext-simba-jf Oct 24, 2024
d1876df
java doc updates part 9
sfc-gh-ext-simba-jf Oct 24, 2024
d6b6ee8
Merge branch 'SNOW-1016469-Update-Javadocs-With-missing-comments' of …
sfc-gh-ext-simba-jf Oct 24, 2024
ce70f98
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 24, 2024
cd11018
Fix missing javadocs part 10
sfc-gh-ext-simba-jf Oct 24, 2024
72bd1d1
Merge branch 'SNOW-1016469-Update-Javadocs-With-missing-comments' of …
sfc-gh-ext-simba-jf Oct 24, 2024
11135b9
fix missing javadoc comments part 11
sfc-gh-ext-simba-jf Oct 24, 2024
4f61f1b
javadoc update part 12
sfc-gh-ext-simba-jf Oct 24, 2024
f90829f
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 25, 2024
5d0394c
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 28, 2024
49914b0
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 31, 2024
bc15a0d
Code review changes
sfc-gh-ext-simba-jf Oct 31, 2024
c739f57
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 31, 2024
92f5897
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Oct 31, 2024
a88f694
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Nov 4, 2024
8eb9e7c
code review changes
sfc-gh-ext-simba-jf Nov 5, 2024
38900bf
Merge branch 'SNOW-1016469-Update-Javadocs-With-missing-comments' of …
sfc-gh-ext-simba-jf Nov 6, 2024
5d53094
Added more details for certain getters and setters
sfc-gh-ext-simba-jf Nov 6, 2024
eb4969b
Merge branch 'master' into SNOW-1016469-Update-Javadocs-With-missing-…
sfc-gh-ext-simba-jf Nov 6, 2024
7b61fac
triggering jenkins test
sfc-gh-ext-simba-jf Nov 6, 2024
284806e
Merge branch 'SNOW-1016469-Update-Javadocs-With-missing-comments' of …
sfc-gh-ext-simba-jf Nov 6, 2024
5e99b2c
code review changes
sfc-gh-ext-simba-jf Nov 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class SFClientConfigParser {
* @param configFilePath SF_CLIENT_CONFIG_FILE parameter read from connection URL or connection
* properties
* @return SFClientConfig
* @throws IOException if exception encountered when reading config file.
*/
public static SFClientConfig loadSFClientConfig(String configFilePath) throws IOException {
if (configFilePath != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ public interface ChunkDownloader {
* be blocked if the chunk is not ready to be consumed (a.k.a not loaded into memory yet)
*
* @return result chunk with data loaded
* @throws InterruptedException if downloading thread was interrupted
* @throws SnowflakeSQLException if downloader encountered an error
*/
SnowflakeResultChunk getNextChunkToConsume() throws InterruptedException, SnowflakeSQLException;

/**
* Terminate the chunk downloader, release all resources allocated
*
* @return metrics measuring downloader performance
* @throws InterruptedException if error encountered
*/
DownloaderMetrics terminate() throws InterruptedException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void resetSecureStorageManager() {
/**
* Testing purpose. Inject a mock manager.
*
* @param manager
* @param manager SecureStorageManager
*/
void injectSecureStorageManager(SecureStorageManager manager) {
logger.debug("Injecting secure storage manager");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,42 @@
* to a single result set. a.k.a each result set object should have its own formatter info
*/
public interface DataConversionContext {
/** timestamp_ltz formatter */
/**
* @return timestamp_ltz formatter
*/
SnowflakeDateTimeFormat getTimestampLTZFormatter();

/** timestamp_ntz formatter */
/**
* @return timestamp_ntz formatter
*/
SnowflakeDateTimeFormat getTimestampNTZFormatter();

/** timestamp_tz formatter */
/**
* @return timestamp_ntz formatter
*/
SnowflakeDateTimeFormat getTimestampTZFormatter();

/** date formatter */
/**
* @return date formatter
*/
SnowflakeDateTimeFormat getDateFormatter();

/** time formatter */
/**
* @return time formatter
*/
SnowflakeDateTimeFormat getTimeFormatter();

/** binary formatter */
/**
* @return binary formatter
*/
SFBinaryFormat getBinaryFormatter();

/** get scale from Snowflake metadata */
/**
* get scale from Snowflake metadata
*
* @param columnIndex column index
* @return scale value
*/
int getScale(int columnIndex);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/snowflake/client/core/EventUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class EventUtil {
/**
* Junit is not recognizing the system properties for EventTest, so overriding the value here
*
* @param value
* @param value string value
*/
public static void setDumpPathPrefixForTesting(String value) {
DUMP_PATH_PREFIX = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private HeartbeatBackground() {}
* @param session the session will be added
* @param masterTokenValidityInSecs time interval for which client need to check validity of
* master token with server
* @param heartbeatFrequencyInSecs heartbeat frequency in seconds
*/
protected synchronized void addSession(
SFSession session, long masterTokenValidityInSecs, int heartbeatFrequencyInSecs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ public String getUserAgentSuffix() {
return this.userAgentSuffix;
}

/** Be careful of using this! Should only be called when password is later masked. */
/**
* Be careful of using this! Should only be called when password is later masked.
*
* @return proxy password
*/
@SnowflakeJdbcInternalApi
public String getProxyPassword() {
return this.proxyPassword;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/net/snowflake/client/core/HttpUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import org.apache.http.ssl.SSLInitializationException;
import org.apache.http.util.EntityUtils;

/** HttpUtil class */
public class HttpUtil {
private static final SFLogger logger = SFLoggerFactory.getLogger(HttpUtil.class);

Expand Down Expand Up @@ -168,7 +169,7 @@ public static void setProxyForS3(HttpClientSettingsKey key, ClientConfiguration
*
* @param proxyProperties proxy properties
* @param clientConfig the configuration needed by S3 to set the proxy
* @throws SnowflakeSQLException
* @throws SnowflakeSQLException when exception encountered
* @deprecated Use {@link S3HttpUtil#setSessionlessProxyForS3(Properties, ClientConfiguration)}
* instead
*/
Expand All @@ -184,7 +185,7 @@ public static void setSessionlessProxyForS3(
*
* @param proxyProperties proxy properties
* @param opContext the configuration needed by Azure to set the proxy
* @throws SnowflakeSQLException
* @throws SnowflakeSQLException when invalid proxy properties encountered
*/
public static void setSessionlessProxyForAzure(
Properties proxyProperties, OperationContext opContext) throws SnowflakeSQLException {
Expand Down Expand Up @@ -723,6 +724,7 @@ public static String executeGeneralRequest(
* @param includeRetryParameters whether to include retry parameters in retried requests
* @param retryOnHTTP403 whether to retry on HTTP 403 or not
* @param ocspAndProxyKey OCSP mode and proxy settings for httpclient
* @param execTimeData query execution time telemetry data object
* @return response
* @throws SnowflakeSQLException if Snowflake error occurs
* @throws IOException raises if a general IO error occurs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ public class PrivateLinkDetector {
* We can only tell if private link is enabled for certain hosts when the hostname contains the
* word 'privatelink' but we don't have a good way of telling if a private link connection is
* expected for internal stages for example.
*
* @param host host
* @return true if host is considered as privatelink environment
*/
public static boolean isPrivateLink(String host) {
return host.toLowerCase().contains(".privatelink.snowflakecomputing.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ private static QueryContextElement deserializeQueryContextElement(JsonNode node)
* Deserialize the QueryContext cache from a QueryContextDTO object. This function currently is
* only used in QueryContextCacheTest.java where we check that after serialization and
* deserialization, the cache is the same as before.
*
* @param queryContextDTO QueryContextDTO to deserialize.
*/
public void deserializeQueryContextDTO(QueryContextDTO queryContextDTO) {
synchronized (this) {
Expand Down Expand Up @@ -335,6 +337,8 @@ private static QueryContextElement deserializeQueryContextElementDTO(
/**
* Serialize the QueryContext cache to a QueryContextDTO object, which can be serialized to JSON
* automatically later.
*
* @return {@link QueryContextDTO}
*/
public QueryContextDTO serializeQueryContextDTO() {
synchronized (this) {
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/net/snowflake/client/core/QueryStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public String getDescription() {

/**
* @deprecated use {@link net.snowflake.client.jdbc.QueryStatusV2} instead
* @return error message
*/
@Deprecated
public String getErrorMessage() {
Expand All @@ -47,6 +48,7 @@ public String getErrorMessage() {

/**
* @deprecated use {@link net.snowflake.client.jdbc.QueryStatusV2} instead
* @return error code
*/
@Deprecated
public int getErrorCode() {
Expand All @@ -55,6 +57,7 @@ public int getErrorCode() {

/**
* @deprecated use {@link net.snowflake.client.jdbc.QueryStatusV2} instead
* @param message the error message
*/
@Deprecated
public void setErrorMessage(String message) {
Expand All @@ -63,12 +66,19 @@ public void setErrorMessage(String message) {

/**
* @deprecated use {@link net.snowflake.client.jdbc.QueryStatusV2} instead
* @param errorCode the error code
*/
@Deprecated
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}

/**
* Check if query is still running.
*
* @param status QueryStatus
* @return true if query is still running
*/
public static boolean isStillRunning(QueryStatus status) {
switch (status.getValue()) {
case 0: // "RUNNING"
Expand All @@ -83,6 +93,12 @@ public static boolean isStillRunning(QueryStatus status) {
}
}

/**
* Check if query status is an error
*
* @param status QueryStatus
* @return true if query status is an error status
*/
public static boolean isAnError(QueryStatus status) {
switch (status.getValue()) {
case 1: // Aborting
Expand All @@ -97,6 +113,12 @@ public static boolean isAnError(QueryStatus status) {
}
}

/**
* Get the query status from a string description
*
* @param description the status description
* @return QueryStatus
*/
public static QueryStatus getStatusFromString(String description) {
if (description != null) {
for (QueryStatus st : QueryStatus.values()) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/snowflake/client/core/ResultUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ public static Object effectiveParamValue(Map<String, Object> parameters, String
/**
* Helper function building a formatter for a specialized timestamp type. Note that it will be
* based on either the 'param' value if set, or the default format provided.
*
* @param parameters keyed in parameter name and valued in parameter value
* @param id id
* @param param timestamp output format param
* @param defaultFormat default format
* @return {@link SnowflakeDateTimeFormat}
*/
public static SnowflakeDateTimeFormat specializedFormatter(
Map<String, Object> parameters, String id, String param, String defaultFormat) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ public SFArrowResultSet(
*
* @param resultSetSerializable data returned in query response
* @param telemetryClient telemetryClient
* @throws SQLException
* @param sortResult set if results should be sorted
* @throws SQLException if exception encountered
*/
public SFArrowResultSet(
SnowflakeResultSetSerializableV1 resultSetSerializable,
Expand Down
Loading
Loading