From 7163cfdea86e104ebdf2814c482e32c954727eae Mon Sep 17 00:00:00 2001 From: Lorna Barber Date: Wed, 22 Jun 2022 10:02:05 -0700 Subject: [PATCH] more logs --- .../client/core/SFArrowResultSet.java | 2 +- .../client/core/SFJsonResultSet.java | 20 ++--- .../client/jdbc/SnowflakeConnectionV1.java | 4 +- .../client/jdbc/SnowflakeStatementV1.java | 76 +++++++++---------- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/main/java/net/snowflake/client/core/SFArrowResultSet.java b/src/main/java/net/snowflake/client/core/SFArrowResultSet.java index 89008010d..3af88c9b6 100644 --- a/src/main/java/net/snowflake/client/core/SFArrowResultSet.java +++ b/src/main/java/net/snowflake/client/core/SFArrowResultSet.java @@ -260,7 +260,7 @@ private boolean fetchNextRowUnsorted() throws SnowflakeSQLException { try { currentChunkIterator.getChunk().freeData(); if (chunkCount > 0) { - logger.debug("End of chunks"); + logger.debug("End of chunks", false); DownloaderMetrics metrics = chunkDownloader.terminate(); logChunkDownloaderMetrics(metrics); } diff --git a/src/main/java/net/snowflake/client/core/SFJsonResultSet.java b/src/main/java/net/snowflake/client/core/SFJsonResultSet.java index e35b5182a..a19b2a38b 100644 --- a/src/main/java/net/snowflake/client/core/SFJsonResultSet.java +++ b/src/main/java/net/snowflake/client/core/SFJsonResultSet.java @@ -304,7 +304,7 @@ public short getShort(int columnIndex) throws SFException { @Override public int getInt(int columnIndex) throws SFException { - logger.debug("public int getInt(int columnIndex)"); + logger.debug("public int getInt(int columnIndex)", false); // Column index starts from 1, not 0. Object obj = getObjectInternal(columnIndex); @@ -331,7 +331,7 @@ public int getInt(int columnIndex) throws SFException { @Override public long getLong(int columnIndex) throws SFException { - logger.debug("public long getLong(int columnIndex)"); + logger.debug("public long getLong(int columnIndex)", false); // Column index starts from 1, not 0. Object obj = getObjectInternal(columnIndex); @@ -369,7 +369,7 @@ public long getLong(int columnIndex) throws SFException { @Override public BigDecimal getBigDecimal(int columnIndex) throws SFException { - logger.debug("public BigDecimal getBigDecimal(int columnIndex)"); + logger.debug("public BigDecimal getBigDecimal(int columnIndex)", false); // Column index starts from 1, not 0. Object obj = getObjectInternal(columnIndex); @@ -395,7 +395,7 @@ public BigDecimal getBigDecimal(int columnIndex) throws SFException { @Override public BigDecimal getBigDecimal(int columnIndex, int scale) throws SFException { - logger.debug("public BigDecimal getBigDecimal(int columnIndex)"); + logger.debug("public BigDecimal getBigDecimal(int columnIndex)", false); Object obj = getObjectInternal(columnIndex); @@ -425,7 +425,7 @@ private TimeZone adjustTimezoneForTimestampTZ(int columnIndex) throws SFExceptio } private SFTimestamp getSFTimestamp(int columnIndex) throws SFException { - logger.debug("public Timestamp getTimestamp(int columnIndex)"); + logger.debug("public Timestamp getTimestamp(int columnIndex)", false); Object obj = getObjectInternal(columnIndex); @@ -444,7 +444,7 @@ private SFTimestamp getSFTimestamp(int columnIndex) throws SFException { @Override public Time getTime(int columnIndex) throws SFException { - logger.debug("public Time getTime(int columnIndex)"); + logger.debug("public Time getTime(int columnIndex)", false); int columnType = resultSetMetaData.getColumnType(columnIndex); if (Types.TIME == columnType) { @@ -552,7 +552,7 @@ else if (resultSetSerializable.getTreatNTZAsUTC() @Override public float getFloat(int columnIndex) throws SFException { - logger.debug("public float getFloat(int columnIndex)"); + logger.debug("public float getFloat(int columnIndex)", false); // Column index starts from 1, not 0. Object obj = getObjectInternal(columnIndex); @@ -594,7 +594,7 @@ public float getFloat(int columnIndex) throws SFException { @Override public double getDouble(int columnIndex) throws SFException { - logger.debug("public double getDouble(int columnIndex)"); + logger.debug("public double getDouble(int columnIndex)", false); // Column index starts from 1, not 0. Object obj = getObjectInternal(columnIndex); @@ -636,7 +636,7 @@ public double getDouble(int columnIndex) throws SFException { @Override public byte[] getBytes(int columnIndex) throws SFException { - logger.debug("public byte[] getBytes(int columnIndex)"); + logger.debug("public byte[] getBytes(int columnIndex)", false); // Column index starts from 1, not 0. Object obj = getObjectInternal(columnIndex); @@ -694,7 +694,7 @@ public Date getDate(int columnIndex) throws SFException { @Override public Date getDate(int columnIndex, TimeZone tz) throws SFException { - logger.debug("public Date getDate(int columnIndex)"); + logger.debug("public Date getDate(int columnIndex)", false); // Column index starts from 1, not 0. Object obj = getObjectInternal(columnIndex); diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java index f838e18dd..23f384259 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java @@ -195,7 +195,7 @@ public String[] getChildQueryIds(String queryID) throws SQLException { */ @Override public void close() throws SQLException { - logger.debug(" public void close()"); + logger.debug(" public void close()", false); if (isClosed) { // No exception is raised even if the connection is closed. @@ -360,7 +360,7 @@ public void setReadOnly(boolean readOnly) throws SQLException { logger.debug("void setReadOnly(boolean readOnly)", false); raiseSQLExceptionIfConnectionIsClosed(); if (readOnly) { - logger.debug("setReadOnly not supported."); + logger.debug("setReadOnly not supported.", false); } } diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java index e92975cc5..46e2ddb84 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeStatementV1.java @@ -513,56 +513,56 @@ public long executeLargeUpdate(String sql, String[] columnNames) throws SQLExcep @Override public Connection getConnection() throws SQLException { - logger.debug("getConnection()"); + logger.debug("getConnection()", false); raiseSQLExceptionIfStatementIsClosed(); return connection; } @Override public int getFetchDirection() throws SQLException { - logger.debug("getFetchDirection()"); + logger.debug("getFetchDirection()", false); raiseSQLExceptionIfStatementIsClosed(); return ResultSet.FETCH_FORWARD; } @Override public int getFetchSize() throws SQLException { - logger.debug("getFetchSize()"); + logger.debug("getFetchSize()", false); raiseSQLExceptionIfStatementIsClosed(); return fetchSize; } @Override public ResultSet getGeneratedKeys() throws SQLException { - logger.debug("getGeneratedKeys()"); + logger.debug("getGeneratedKeys()", false); raiseSQLExceptionIfStatementIsClosed(); return new SnowflakeResultSetV1.EmptyResultSet(); } @Override public int getMaxFieldSize() throws SQLException { - logger.debug("getMaxFieldSize()"); + logger.debug("getMaxFieldSize()", false); raiseSQLExceptionIfStatementIsClosed(); return maxFieldSize; } @Override public int getMaxRows() throws SQLException { - logger.debug("getMaxRows()"); + logger.debug("getMaxRows()", false); raiseSQLExceptionIfStatementIsClosed(); return maxRows; } @Override public boolean getMoreResults() throws SQLException { - logger.debug("getMoreResults()"); + logger.debug("getMoreResults()", false); return getMoreResults(Statement.CLOSE_CURRENT_RESULT); } @Override public boolean getMoreResults(int current) throws SQLException { - logger.debug("getMoreResults(int current)"); + logger.debug("getMoreResults(int current)", false); raiseSQLExceptionIfStatementIsClosed(); // clean up the current result set, if it exists @@ -604,48 +604,48 @@ public boolean getMoreResults(int current) throws SQLException { @Override public int getQueryTimeout() throws SQLException { - logger.debug("getQueryTimeout()"); + logger.debug("getQueryTimeout()", false); raiseSQLExceptionIfStatementIsClosed(); return this.queryTimeout; } @Override public ResultSet getResultSet() throws SQLException { - logger.debug("getResultSet()"); + logger.debug("getResultSet()", false); raiseSQLExceptionIfStatementIsClosed(); return resultSet; } @Override public int getResultSetConcurrency() throws SQLException { - logger.debug("getResultSetConcurrency()"); + logger.debug("getResultSetConcurrency()", false); raiseSQLExceptionIfStatementIsClosed(); return resultSetConcurrency; } @Override public int getResultSetHoldability() throws SQLException { - logger.debug("getResultSetHoldability()"); + logger.debug("getResultSetHoldability()", false); raiseSQLExceptionIfStatementIsClosed(); return resultSetHoldability; } @Override public int getResultSetType() throws SQLException { - logger.debug("getResultSetType()"); + logger.debug("getResultSetType()", false); raiseSQLExceptionIfStatementIsClosed(); return this.resultSetType; } @Override public int getUpdateCount() throws SQLException { - logger.debug("getUpdateCount()"); + logger.debug("getUpdateCount()", false); return (int) getUpdateCountIfDML(); } @Override public long getLargeUpdateCount() throws SQLException { - logger.debug("getLargeUpdateCount()"); + logger.debug("getLargeUpdateCount()", false); return getUpdateCountIfDML(); } @@ -659,34 +659,34 @@ private long getUpdateCountIfDML() throws SQLException { @Override public SQLWarning getWarnings() throws SQLException { - logger.debug("getWarnings()"); + logger.debug("getWarnings()", false); raiseSQLExceptionIfStatementIsClosed(); return sqlWarnings; } @Override public boolean isClosed() throws SQLException { - logger.debug("isClosed()"); + logger.debug("isClosed()", false); return isClosed; // no exception } @Override public boolean isPoolable() throws SQLException { - logger.debug("isPoolable()"); + logger.debug("isPoolable()", false); raiseSQLExceptionIfStatementIsClosed(); return poolable; } @Override public void setCursorName(String name) throws SQLException { - logger.debug("setCursorName(String name)"); + logger.debug("setCursorName(String name)", false); throw new SnowflakeLoggedFeatureNotSupportedException(connection.getSFBaseSession()); } @Override public void setEscapeProcessing(boolean enable) throws SQLException { - logger.debug("setEscapeProcessing(boolean enable)"); + logger.debug("setEscapeProcessing(boolean enable)", false); // NOTE: We could raise an exception here, because not implemented // but it may break the existing applications. For now returning nothnig. // we should revisit. @@ -695,7 +695,7 @@ public void setEscapeProcessing(boolean enable) throws SQLException { @Override public void setFetchDirection(int direction) throws SQLException { - logger.debug("setFetchDirection(int direction)"); + logger.debug("setFetchDirection(int direction)", false); raiseSQLExceptionIfStatementIsClosed(); if (direction != ResultSet.FETCH_FORWARD) { throw new SnowflakeLoggedFeatureNotSupportedException(connection.getSFBaseSession()); @@ -711,14 +711,14 @@ public void setFetchSize(int rows) throws SQLException { @Override public void setMaxFieldSize(int max) throws SQLException { - logger.debug("setMaxFieldSize(int max)"); + logger.debug("setMaxFieldSize(int max)", false); throw new SnowflakeLoggedFeatureNotSupportedException(connection.getSFBaseSession()); } @Override public void setMaxRows(int max) throws SQLException { - logger.debug("setMaxRows(int max)"); + logger.debug("setMaxRows(int max)", false); raiseSQLExceptionIfStatementIsClosed(); @@ -735,7 +735,7 @@ public void setMaxRows(int max) throws SQLException { @Override public void setPoolable(boolean poolable) throws SQLException { - logger.debug("setPoolable(boolean poolable)"); + logger.debug("setPoolable(boolean poolable)", false); raiseSQLExceptionIfStatementIsClosed(); if (poolable) { @@ -752,7 +752,7 @@ public void setPoolable(boolean poolable) throws SQLException { * @throws SQLException if any SQL error occurs. */ public void setParameter(String name, Object value) throws SQLException { - logger.debug("setParameter"); + logger.debug("setParameter", false); try { if (this.sfBaseStatement != null) { @@ -765,7 +765,7 @@ public void setParameter(String name, Object value) throws SQLException { @Override public void setQueryTimeout(int seconds) throws SQLException { - logger.debug("setQueryTimeout(int seconds)"); + logger.debug("setQueryTimeout(int seconds)", false); raiseSQLExceptionIfStatementIsClosed(); this.queryTimeout = seconds; @@ -781,7 +781,7 @@ public void setQueryTimeout(int seconds) throws SQLException { @Override public boolean isWrapperFor(Class iface) throws SQLException { - logger.debug("isWrapperFor(Class iface)"); + logger.debug("isWrapperFor(Class iface)", false); return iface.isInstance(this); } @@ -789,7 +789,7 @@ public boolean isWrapperFor(Class iface) throws SQLException { @SuppressWarnings("unchecked") @Override public T unwrap(Class iface) throws SQLException { - logger.debug("unwrap(Class iface)"); + logger.debug("unwrap(Class iface)", false); if (!iface.isInstance(this)) { throw new SQLException( @@ -800,13 +800,13 @@ public T unwrap(Class iface) throws SQLException { @Override public void closeOnCompletion() throws SQLException { - logger.debug("closeOnCompletion()"); + logger.debug("closeOnCompletion()", false); throw new SnowflakeLoggedFeatureNotSupportedException(connection.getSFBaseSession()); } @Override public boolean isCloseOnCompletion() throws SQLException { - logger.debug("isCloseOnCompletion()"); + logger.debug("isCloseOnCompletion()", false); throw new SnowflakeLoggedFeatureNotSupportedException(connection.getSFBaseSession()); } @@ -816,7 +816,7 @@ public void close() throws SQLException { } public void close(boolean removeClosedStatementFromConnection) throws SQLException { - logger.debug("close()"); + logger.debug("close()", false); // No exception is raised even if the statement is closed. if (resultSet != null) { @@ -845,7 +845,7 @@ public void close(boolean removeClosedStatementFromConnection) throws SQLExcepti @Override public void cancel() throws SQLException { - logger.debug("cancel()"); + logger.debug("cancel()", false); raiseSQLExceptionIfStatementIsClosed(); try { @@ -857,14 +857,14 @@ public void cancel() throws SQLException { @Override public void clearWarnings() throws SQLException { - logger.debug("clearWarnings()"); + logger.debug("clearWarnings()", false); raiseSQLExceptionIfStatementIsClosed(); sqlWarnings = null; } @Override public void addBatch(String sql) throws SQLException { - logger.debug("addBatch(String sql)"); + logger.debug("addBatch(String sql)", false); raiseSQLExceptionIfStatementIsClosed(); @@ -873,7 +873,7 @@ public void addBatch(String sql) throws SQLException { @Override public void clearBatch() throws SQLException { - logger.debug("clearBatch()"); + logger.debug("clearBatch()", false); raiseSQLExceptionIfStatementIsClosed(); @@ -881,7 +881,7 @@ public void clearBatch() throws SQLException { } private void executeSetProperty(final String sql) { - logger.debug("setting property"); + logger.debug("setting property", false); // tokenize the sql String[] tokens = sql.split("\\s+"); @@ -1196,7 +1196,7 @@ public void setQueryTimeout(int seconds) throws SQLException {} @Override public boolean isWrapperFor(Class iface) throws SQLException { - logger.debug("isWrapperFor(Class iface)"); + logger.debug("isWrapperFor(Class iface)", false); return iface.isInstance(this); } @@ -1204,7 +1204,7 @@ public boolean isWrapperFor(Class iface) throws SQLException { @SuppressWarnings("unchecked") @Override public T unwrap(Class iface) throws SQLException { - logger.debug("unwrap(Class iface)"); + logger.debug("unwrap(Class iface)", false); if (!iface.isInstance(this)) { throw new SQLException(