Skip to content

Commit

Permalink
Fix javadocs.
Browse files Browse the repository at this point in the history
  • Loading branch information
oyeliseiev-ua committed Jan 9, 2024
1 parent b90b134 commit 604bd62
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 32 deletions.
11 changes: 10 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ jobs:
SINGLESTORE_PASSWORD: << parameters.singlestore_password >>
TEST_ENVIRON: CIRCLE_CI
JAVA_HOME: /usr/lib/jvm/java-<< parameters.java_version >>-openjdk-amd64
JAVA_VERSION: << parameters.java_version >>
steps:
- setup_environment:
java_version: << parameters.java_version >>
Expand All @@ -115,7 +116,15 @@ jobs:
paths:
- ~/.m2
key: singlestore-jdbc-client-{{ checksum "pom.xml" }}
- run: mvn test
- run:
name: Run tests
command: |
echo "Use JDK ${JAVA_VERSION}"
if [ "${JAVA_VERSION}" = "8" ]; then
mvn compile -P java8
else
mvn compile
fi
- store_test_results: # uploads the test metadata from the `target/surefire-reports` directory so that it can show up in the CircleCI dashboard.
# Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: target/surefire-reports
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/singlestore/jdbc/BlobImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public InputStream getBinaryStream(final long pos, final long length) throws SQL
* @param pattern the byte array for which to search
* @param start the position at which to begin searching; the first position is 1
* @return the position at which the pattern appears, else -1
* @throws java.sql.SQLException if an error occurs
*/
public long position(final byte[] pattern, final long start) throws SQLException {
if (pattern.length == 0) {
Expand Down Expand Up @@ -184,6 +185,7 @@ public long position(final byte[] pattern, final long start) throws SQLException
* @param start the position in the <code>BLOB</code> value at which to begin searching; the first
* position is 1
* @return the position at which the pattern begins, else -1
* @throws java.sql.SQLException if an error occurs
*/
public long position(final Blob pattern, final long start) throws SQLException {
byte[] blobBytes = pattern.getBytes(1, (int) pattern.length());
Expand All @@ -203,6 +205,7 @@ public long position(final Blob pattern, final long start) throws SQLException {
* @param bytes the array of bytes to be written to the <code>BLOB</code> value that this <code>
* Blob</code> object represents
* @return the number of bytes written
* @throws java.sql.SQLException if an error occurs
* @see #getBytes
*/
public int setBytes(final long pos, final byte[] bytes) throws SQLException {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/singlestore/jdbc/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -1151,9 +1151,8 @@ public String sessionVariables() {
}

/**
* Must tinyint be considered as Bit
* Must tinyint be considered as Bit (TINYINT is always has reserved length = 4)
*
* @apiNote TINYINT is always has reserved length = 4
* @return true if tinyint must be considered as Bit
*/
public boolean tinyInt1isBit() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/singlestore/jdbc/DatabaseMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public Version getVersion() throws java.sql.SQLException {
* This function is to return the version of S2
*
* @return S2 version object
* @throws java.sql.SQLException
* @throws java.sql.SQLException if an error occurs
*/
public Version getSingleStoreVersion() throws java.sql.SQLException {
if (this.singleStoreVersion == null) {
Expand All @@ -156,7 +156,7 @@ public Version getSingleStoreVersion() throws java.sql.SQLException {
* This function is to return the version of MySQL
*
* @return MySQL Version Object
* @throws java.sql.SQLException
* @throws java.sql.SQLException if an error occurs
*/
private Version getMySQLVersion() throws java.sql.SQLException {
if (this.version == null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/singlestore/jdbc/ParameterMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public int getScale(int idx) throws SQLException {
/**
* Retrieves the designated parameter's SQL type.
*
* @param param the first parameter is 1, the second is 2, ...
* @param idx the first parameter is 1, the second is 2, ...
* @return SQL type from <code>java.sql.Types</code>
* @throws SQLException because not supported
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/singlestore/jdbc/Statement.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public void close() throws SQLException {
* Abort current command result if streaming. result-set will be incomplete and closed, but ensure
* connection state
*/
public void abort() throws SQLException {
public void abort() {
lock.lock();
try {
if (!closed) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/singlestore/jdbc/client/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ public interface Context {
*/
void addStateFlag(int state);

/** Indicate the number of connection on this server */
/**
* Indicate the number of connection on this server.
*
* @param threadsConnected number of threads
*/
void setTreadsConnected(long threadsConnected);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
import java.sql.Types;
import java.util.Calendar;

/**
* Column metadata definition
*
* @implNote S2 always returns length 4 for TINYINT
*/
/** Column metadata definition (S2 always returns length 4 for TINYINT) */
public class SignedTinyIntColumn extends ColumnDefinitionPacket implements ColumnDecoder {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private void reconnectIfNeeded() {

/**
* Reconnect connection, trying to continue transparently if possible. Different cases. * replica
* fails => reconnect to replica or to master if no replica available
* fails - reconnect to replica or to master if no replica available
*
* <p>if reconnect succeed on replica / use master, no problem, continuing without interruption //
* if reconnect primary, then replay transaction / throw exception if was in transaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ public void run() {
}
}
if (streamStmt != null) {
try {
streamStmt.abort();
} catch (SQLException e) {
// eat
}
streamStmt.abort();
}
closeSocket();
}
Expand Down Expand Up @@ -848,8 +844,10 @@ public Completion readPacket(ClientMessage message) throws SQLException {
* @param fetchSize default fetch size
* @param resultSetConcurrency concurrency
* @param resultSetType type
* @param maxRows max rows
* @param closeOnCompletion must resultset close statement on completion
* @throws SQLException if any exception
* @return completion result
*/
public Completion readPacket(
com.singlestore.jdbc.Statement stmt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ChangeDbPacket(String database) {
/**
* COM_INIT_DB packet
*
* <p>int<1> 0x02 : COM_INIT_DB Header string<NUL> schema name
* <p>int[1] 0x02 : COM_INIT_DB Header string[NUL] schema name
*/
@Override
public int encode(Writer writer, Context context) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ClosePreparePacket(int statementId) {
this.statementId = statementId;
}

/** COM_STMT_CLOSE packet. int<1> 0x19 COM_STMT_CLOSE header int<4> Statement id */
/** COM_STMT_CLOSE packet. int[1] 0x19 COM_STMT_CLOSE header int[4] Statement id */
@Override
public int encode(Writer writer, Context context) throws IOException {
assert statementId != 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public void ensureReplayable(Context context) throws IOException, SQLException {
/**
* COM_STMT_EXECUTE packet
*
* <p>int<1> 0x17 : COM_STMT_EXECUTE header int<4> statement id int<1> flags: int<4> Iteration
* count (always 1) if (param_count > 0) byte<(param_count + 7)/8> null bitmap byte<1>: send type
* to server (0 / 1) if (send type to server) for each parameter : byte<1>: field type byte<1>:
* parameter flag for each parameter (i.e param_count times) byte<n> binary parameter value
* <p>int[1] 0x17 : COM_STMT_EXECUTE header int[4] statement id int[1] flags: int[4] Iteration
* count (always 1) if (param_count ] 0) byte[(param_count + 7)/8] null bitmap byte[1]: send type
* to server (0 / 1) if (send type to server) for each parameter : byte[1]: field type byte[1]:
* parameter flag for each parameter (i.e param_count times) byte[n] binary parameter value
*/
@Override
public int encode(Writer writer, Context context, Prepare newPrepareResult)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public LongDataPacket(int statementId, Parameter parameter, int index) {
/**
* COM_STMT_SEND_LONG_DATA packet
*
* <p>int<1> 0x18 COM_STMT_SEND_LONG_DATA header int<4> statement id int<2> parameter number
* byte<EOF> data
* <p>int[1] 0x18 COM_STMT_SEND_LONG_DATA header int[4] statement id int[2] parameter number
* byte[EOF] data
*/
@Override
public int encode(Writer writer, Context context) throws IOException, SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public final class PingPacket implements ClientMessage {
/**
* COM_PING packet
*
* <p>int<1> 0x0e : COM_PING Header
* <p>int[1] 0x0e : COM_PING Header
*/
@Override
public int encode(Writer writer, Context context) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PreparePacket(String sql) {
/**
* COM_STMT_PREPARE packet
*
* <p>int<1> 0x16 COM_STMT_PREPARE header string<EOF> SQL Statement
* <p>int[1] 0x16 COM_STMT_PREPARE header string[EOF] SQL Statement
*/
@Override
public int encode(Writer writer, Context context) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public int batchUpdateLength() {
/**
* COM_QUERY packet
*
* <p>int<1> 0x03 : COM_QUERY header string<EOF> SQL statement
* <p>int[1] 0x03 : COM_QUERY header string[EOF] SQL statement
*/
@Override
public int encode(Writer writer, Context context) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public final class QuitPacket implements ClientMessage {
/**
* COM_QUIT packet
*
* <p>int<1> 0x01 : COM_QUIT Header
* <p>int[1] 0x01 : COM_QUIT Header
*/
@Override
public int encode(Writer writer, Context context) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public final class ResetPacket implements ClientMessage {
/**
* COM_RESET_CONNECTION packet
*
* <p>int<1> 0x1f : COM_RESET_CONNECTION Header
* <p>int[1] 0x1f : COM_RESET_CONNECTION Header
*/
@Override
public int encode(Writer writer, Context context) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public interface GssapiAuth {
* @param in socket reader
* @param servicePrincipalName SPN
* @param mechanisms mechanisms
* @param jaasApplicationName application name
* @throws IOException if any socket error occurs
* @throws SQLException for any other type of errors
*/
Expand Down

0 comments on commit 604bd62

Please sign in to comment.