id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
52,500 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.unquoteIdentifier | @Deprecated
public static String unquoteIdentifier(String string) {
if (string != null && string.startsWith("`") && string.endsWith("`") && string.length() >= 2) {
return string.substring(1, string.length() - 1).replace("``", "`");
}
return string;
} | java | @Deprecated
public static String unquoteIdentifier(String string) {
if (string != null && string.startsWith("`") && string.endsWith("`") && string.length() >= 2) {
return string.substring(1, string.length() - 1).replace("``", "`");
}
return string;
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"unquoteIdentifier",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"!=",
"null",
"&&",
"string",
".",
"startsWith",
"(",
"\"`\"",
")",
"&&",
"string",
".",
"endsWith",
"(",
"\"`\"",
")",
"&&",
"s... | UnQuote string.
@param string value
@return unquote string
@deprecated since 1.3.0 | [
"UnQuote",
"string",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L189-L195 |
52,501 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.clientPrepareStatement | public ClientSidePreparedStatement clientPrepareStatement(final String sql)
throws SQLException {
return new ClientSidePreparedStatement(this,
sql,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
Statement.RETURN_GENERATED_KEYS);
} | java | public ClientSidePreparedStatement clientPrepareStatement(final String sql)
throws SQLException {
return new ClientSidePreparedStatement(this,
sql,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
Statement.RETURN_GENERATED_KEYS);
} | [
"public",
"ClientSidePreparedStatement",
"clientPrepareStatement",
"(",
"final",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"ClientSidePreparedStatement",
"(",
"this",
",",
"sql",
",",
"ResultSet",
".",
"TYPE_FORWARD_ONLY",
",",
"ResultSet",
... | Create a new client prepared statement.
@param sql the query.
@return a client prepared statement.
@throws SQLException if there is a problem preparing the statement. | [
"Create",
"a",
"new",
"client",
"prepared",
"statement",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L277-L284 |
52,502 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.serverPrepareStatement | public ServerSidePreparedStatement serverPrepareStatement(final String sql)
throws SQLException {
return new ServerSidePreparedStatement(this,
sql,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
Statement.RETURN_GENERATED_KEYS);
} | java | public ServerSidePreparedStatement serverPrepareStatement(final String sql)
throws SQLException {
return new ServerSidePreparedStatement(this,
sql,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
Statement.RETURN_GENERATED_KEYS);
} | [
"public",
"ServerSidePreparedStatement",
"serverPrepareStatement",
"(",
"final",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"ServerSidePreparedStatement",
"(",
"this",
",",
"sql",
",",
"ResultSet",
".",
"TYPE_FORWARD_ONLY",
",",
"ResultSet",
... | Create a new server prepared statement.
@param sql the query.
@return a server prepared statement.
@throws SQLException if there is a problem preparing the statement. | [
"Create",
"a",
"new",
"server",
"prepared",
"statement",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L293-L300 |
52,503 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.prepareStatement | public PreparedStatement prepareStatement(final String sql) throws SQLException {
return internalPrepareStatement(sql,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
Statement.NO_GENERATED_KEYS);
} | java | public PreparedStatement prepareStatement(final String sql) throws SQLException {
return internalPrepareStatement(sql,
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
Statement.NO_GENERATED_KEYS);
} | [
"public",
"PreparedStatement",
"prepareStatement",
"(",
"final",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"return",
"internalPrepareStatement",
"(",
"sql",
",",
"ResultSet",
".",
"TYPE_FORWARD_ONLY",
",",
"ResultSet",
".",
"CONCUR_READ_ONLY",
",",
"Stateme... | creates a new prepared statement.
@param sql the query.
@return a prepared statement.
@throws SQLException if there is a problem preparing the statement. | [
"creates",
"a",
"new",
"prepared",
"statement",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L309-L314 |
52,504 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.internalPrepareStatement | private PreparedStatement internalPrepareStatement(final String sql,
final int resultSetScrollType,
final int resultSetConcurrency,
final int autoGeneratedKeys)
throws SQLException {
if (sql != null) {
String sqlQuery = Utils.nativeSql(sql, protocol.noBackslashEscapes());
if (... | java | private PreparedStatement internalPrepareStatement(final String sql,
final int resultSetScrollType,
final int resultSetConcurrency,
final int autoGeneratedKeys)
throws SQLException {
if (sql != null) {
String sqlQuery = Utils.nativeSql(sql, protocol.noBackslashEscapes());
if (... | [
"private",
"PreparedStatement",
"internalPrepareStatement",
"(",
"final",
"String",
"sql",
",",
"final",
"int",
"resultSetScrollType",
",",
"final",
"int",
"resultSetConcurrency",
",",
"final",
"int",
"autoGeneratedKeys",
")",
"throws",
"SQLException",
"{",
"if",
"(",... | Send ServerPrepareStatement or ClientPrepareStatement depending on SQL query and options If
server side and PREPARE can be delayed, a facade will be return, to have a fallback on client
prepareStatement.
@param sql sql query
@param resultSetScrollType one of the following <code>ResultSet</code> const... | [
"Send",
"ServerPrepareStatement",
"or",
"ClientPrepareStatement",
"depending",
"on",
"SQL",
"query",
"and",
"options",
"If",
"server",
"side",
"and",
"PREPARE",
"can",
"be",
"delayed",
"a",
"facade",
"will",
"be",
"return",
"to",
"have",
"a",
"fallback",
"on",
... | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L516-L550 |
52,505 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.commit | public void commit() throws SQLException {
lock.lock();
try {
if (protocol.inTransaction()) {
try (Statement st = createStatement()) {
st.execute("COMMIT");
}
}
} finally {
lock.unlock();
}
} | java | public void commit() throws SQLException {
lock.lock();
try {
if (protocol.inTransaction()) {
try (Statement st = createStatement()) {
st.execute("COMMIT");
}
}
} finally {
lock.unlock();
}
} | [
"public",
"void",
"commit",
"(",
")",
"throws",
"SQLException",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"protocol",
".",
"inTransaction",
"(",
")",
")",
"{",
"try",
"(",
"Statement",
"st",
"=",
"createStatement",
"(",
")",
")"... | Sends commit to the server.
@throws SQLException if there is an error commiting. | [
"Sends",
"commit",
"to",
"the",
"server",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L749-L760 |
52,506 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.setReadOnly | public void setReadOnly(final boolean readOnly) throws SQLException {
try {
logger.debug("conn={}({}) - set read-only to value {} {}",
protocol.getServerThreadId(),
protocol.isMasterConnection() ? "M" : "S",
readOnly);
stateFlag |= ConnectionState.STATE_READ_ONLY;
pro... | java | public void setReadOnly(final boolean readOnly) throws SQLException {
try {
logger.debug("conn={}({}) - set read-only to value {} {}",
protocol.getServerThreadId(),
protocol.isMasterConnection() ? "M" : "S",
readOnly);
stateFlag |= ConnectionState.STATE_READ_ONLY;
pro... | [
"public",
"void",
"setReadOnly",
"(",
"final",
"boolean",
"readOnly",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"logger",
".",
"debug",
"(",
"\"conn={}({}) - set read-only to value {} {}\"",
",",
"protocol",
".",
"getServerThreadId",
"(",
")",
",",
"protocol",... | Sets whether this connection is read only.
@param readOnly true if it should be read only.
@throws SQLException if there is a problem | [
"Sets",
"whether",
"this",
"connection",
"is",
"read",
"only",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L851-L862 |
52,507 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.getClientInfo | public Properties getClientInfo() throws SQLException {
checkConnection();
Properties properties = new Properties();
try (Statement statement = createStatement()) {
try (ResultSet rs = statement
.executeQuery("SELECT @ApplicationName, @ClientUser, @ClientHostname")) {
if (rs.next()) ... | java | public Properties getClientInfo() throws SQLException {
checkConnection();
Properties properties = new Properties();
try (Statement statement = createStatement()) {
try (ResultSet rs = statement
.executeQuery("SELECT @ApplicationName, @ClientUser, @ClientHostname")) {
if (rs.next()) ... | [
"public",
"Properties",
"getClientInfo",
"(",
")",
"throws",
"SQLException",
"{",
"checkConnection",
"(",
")",
";",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"(",
"Statement",
"statement",
"=",
"createStatement",
"(",
")",
")"... | Returns a list containing the name and current value of each client info property supported by
the driver. The value of a client info property may be null if the property has not been set
and does not have a default value.
@return A <code>Properties</code> object that contains the name and current value of each of
th... | [
"Returns",
"a",
"list",
"containing",
"the",
"name",
"and",
"current",
"value",
"of",
"each",
"client",
"info",
"property",
"supported",
"by",
"the",
"driver",
".",
"The",
"value",
"of",
"a",
"client",
"info",
"property",
"may",
"be",
"null",
"if",
"the",
... | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L1432-L1456 |
52,508 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.setNetworkTimeout | public void setNetworkTimeout(Executor executor, final int milliseconds) throws SQLException {
if (this.isClosed()) {
throw ExceptionMapper
.getSqlException("Connection.setNetworkTimeout cannot be called on a closed connection");
}
if (milliseconds < 0) {
throw ExceptionMapper
... | java | public void setNetworkTimeout(Executor executor, final int milliseconds) throws SQLException {
if (this.isClosed()) {
throw ExceptionMapper
.getSqlException("Connection.setNetworkTimeout cannot be called on a closed connection");
}
if (milliseconds < 0) {
throw ExceptionMapper
... | [
"public",
"void",
"setNetworkTimeout",
"(",
"Executor",
"executor",
",",
"final",
"int",
"milliseconds",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"this",
".",
"isClosed",
"(",
")",
")",
"{",
"throw",
"ExceptionMapper",
".",
"getSqlException",
"(",
"\"Con... | Change network timeout.
@param executor executor (can be null)
@param milliseconds network timeout in milliseconds.
@throws SQLException if security manager doesn't permit it. | [
"Change",
"network",
"timeout",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L1700-L1720 |
52,509 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbConnection.java | MariaDbConnection.reset | public void reset() throws SQLException {
boolean useComReset = options.useResetConnection
&& ((protocol.isServerMariaDb() && protocol.versionGreaterOrEqual(10, 2, 4))
|| (!protocol.isServerMariaDb() && protocol.versionGreaterOrEqual(5, 7, 3)));
if (useComReset) {
protocol.reset();
}
... | java | public void reset() throws SQLException {
boolean useComReset = options.useResetConnection
&& ((protocol.isServerMariaDb() && protocol.versionGreaterOrEqual(10, 2, 4))
|| (!protocol.isServerMariaDb() && protocol.versionGreaterOrEqual(5, 7, 3)));
if (useComReset) {
protocol.reset();
}
... | [
"public",
"void",
"reset",
"(",
")",
"throws",
"SQLException",
"{",
"boolean",
"useComReset",
"=",
"options",
".",
"useResetConnection",
"&&",
"(",
"(",
"protocol",
".",
"isServerMariaDb",
"(",
")",
"&&",
"protocol",
".",
"versionGreaterOrEqual",
"(",
"10",
",... | Reset connection set has it was after creating a "fresh" new connection.
defaultTransactionIsolation must have been initialized.
<p>BUT : - session variable state are reset only if option useResetConnection is set and - if
using the option "useServerPrepStmts", PREPARE statement are still prepared</p>
@throws SQLExce... | [
"Reset",
"connection",
"set",
"has",
"it",
"was",
"after",
"creating",
"a",
"fresh",
"new",
"connection",
".",
"defaultTransactionIsolation",
"must",
"have",
"been",
"initialized",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbConnection.java#L1744-L1786 |
52,510 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/dao/ColumnNameMap.java | ColumnNameMap.getIndex | public int getIndex(String name) throws SQLException {
if (name == null) {
throw new SQLException("Column name cannot be null");
}
String lowerName = name.toLowerCase(Locale.ROOT);
// The specs in JDBC 4.0 specify that ResultSet.findColumn and
// ResultSet.getXXX(String name) should use column... | java | public int getIndex(String name) throws SQLException {
if (name == null) {
throw new SQLException("Column name cannot be null");
}
String lowerName = name.toLowerCase(Locale.ROOT);
// The specs in JDBC 4.0 specify that ResultSet.findColumn and
// ResultSet.getXXX(String name) should use column... | [
"public",
"int",
"getIndex",
"(",
"String",
"name",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"SQLException",
"(",
"\"Column name cannot be null\"",
")",
";",
"}",
"String",
"lowerName",
"=",
"name",
".",
... | Get column index by name.
@param name column name
@return index.
@throws SQLException if no column info exists, or column is unknown | [
"Get",
"column",
"index",
"by",
"name",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/ColumnNameMap.java#L80-L137 |
52,511 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/ColumnInformation.java | ColumnInformation.getPrecision | public long getPrecision() {
switch (type) {
case OLDDECIMAL:
case DECIMAL:
//DECIMAL and OLDDECIMAL are "exact" fixed-point number.
//so :
// - if can be signed, 1 byte is saved for sign
// - if decimal > 0, one byte more for dot
if (isSigned()) {
retu... | java | public long getPrecision() {
switch (type) {
case OLDDECIMAL:
case DECIMAL:
//DECIMAL and OLDDECIMAL are "exact" fixed-point number.
//so :
// - if can be signed, 1 byte is saved for sign
// - if decimal > 0, one byte more for dot
if (isSigned()) {
retu... | [
"public",
"long",
"getPrecision",
"(",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"OLDDECIMAL",
":",
"case",
"DECIMAL",
":",
"//DECIMAL and OLDDECIMAL are \"exact\" fixed-point number.",
"//so :",
"// - if can be signed, 1 byte is saved for sign",
"// - if decimal > ... | Return metadata precision.
@return precision | [
"Return",
"metadata",
"precision",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/ColumnInformation.java#L271-L287 |
52,512 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/ColumnInformation.java | ColumnInformation.getDisplaySize | public int getDisplaySize() {
int vtype = type.getSqlType();
if (vtype == Types.VARCHAR || vtype == Types.CHAR) {
int maxWidth = maxCharlen[charsetNumber & 0xff];
if (maxWidth == 0) {
maxWidth = 1;
}
return (int) length / maxWidth;
}
return (int) length;
} | java | public int getDisplaySize() {
int vtype = type.getSqlType();
if (vtype == Types.VARCHAR || vtype == Types.CHAR) {
int maxWidth = maxCharlen[charsetNumber & 0xff];
if (maxWidth == 0) {
maxWidth = 1;
}
return (int) length / maxWidth;
}
return (int) length;
} | [
"public",
"int",
"getDisplaySize",
"(",
")",
"{",
"int",
"vtype",
"=",
"type",
".",
"getSqlType",
"(",
")",
";",
"if",
"(",
"vtype",
"==",
"Types",
".",
"VARCHAR",
"||",
"vtype",
"==",
"Types",
".",
"CHAR",
")",
"{",
"int",
"maxWidth",
"=",
"maxCharl... | Get column size.
@return size | [
"Get",
"column",
"size",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/ColumnInformation.java#L294-L306 |
52,513 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java | Results.addStats | public void addStats(long updateCount, long insertId, boolean moreResultAvailable) {
if (cmdInformation == null) {
if (batch) {
cmdInformation = new CmdInformationBatch(expectedSize, autoIncrement);
} else if (moreResultAvailable) {
cmdInformation = new CmdInformationMultiple(expectedSiz... | java | public void addStats(long updateCount, long insertId, boolean moreResultAvailable) {
if (cmdInformation == null) {
if (batch) {
cmdInformation = new CmdInformationBatch(expectedSize, autoIncrement);
} else if (moreResultAvailable) {
cmdInformation = new CmdInformationMultiple(expectedSiz... | [
"public",
"void",
"addStats",
"(",
"long",
"updateCount",
",",
"long",
"insertId",
",",
"boolean",
"moreResultAvailable",
")",
"{",
"if",
"(",
"cmdInformation",
"==",
"null",
")",
"{",
"if",
"(",
"batch",
")",
"{",
"cmdInformation",
"=",
"new",
"CmdInformati... | Add execution statistics.
@param updateCount number of updated rows
@param insertId primary key
@param moreResultAvailable is there additional packet | [
"Add",
"execution",
"statistics",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java#L174-L186 |
52,514 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java | Results.addStatsError | public void addStatsError(boolean moreResultAvailable) {
if (cmdInformation == null) {
if (batch) {
cmdInformation = new CmdInformationBatch(expectedSize, autoIncrement);
} else if (moreResultAvailable) {
cmdInformation = new CmdInformationMultiple(expectedSize, autoIncrement);
} e... | java | public void addStatsError(boolean moreResultAvailable) {
if (cmdInformation == null) {
if (batch) {
cmdInformation = new CmdInformationBatch(expectedSize, autoIncrement);
} else if (moreResultAvailable) {
cmdInformation = new CmdInformationMultiple(expectedSize, autoIncrement);
} e... | [
"public",
"void",
"addStatsError",
"(",
"boolean",
"moreResultAvailable",
")",
"{",
"if",
"(",
"cmdInformation",
"==",
"null",
")",
"{",
"if",
"(",
"batch",
")",
"{",
"cmdInformation",
"=",
"new",
"CmdInformationBatch",
"(",
"expectedSize",
",",
"autoIncrement",... | Indicate that result is an Error, to set appropriate results.
@param moreResultAvailable indicate if other results (ResultSet or updateCount) are available. | [
"Indicate",
"that",
"result",
"is",
"an",
"Error",
"to",
"set",
"appropriate",
"results",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java#L193-L205 |
52,515 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java | Results.addResultSet | public void addResultSet(SelectResultSet resultSet, boolean moreResultAvailable) {
if (resultSet.isCallableResult()) {
callableResultSet = resultSet;
return;
}
if (executionResults == null) {
executionResults = new ArrayDeque<>();
}
executionResults.add(resultSet);
if (cmdInfor... | java | public void addResultSet(SelectResultSet resultSet, boolean moreResultAvailable) {
if (resultSet.isCallableResult()) {
callableResultSet = resultSet;
return;
}
if (executionResults == null) {
executionResults = new ArrayDeque<>();
}
executionResults.add(resultSet);
if (cmdInfor... | [
"public",
"void",
"addResultSet",
"(",
"SelectResultSet",
"resultSet",
",",
"boolean",
"moreResultAvailable",
")",
"{",
"if",
"(",
"resultSet",
".",
"isCallableResult",
"(",
")",
")",
"{",
"callableResultSet",
"=",
"resultSet",
";",
"return",
";",
"}",
"if",
"... | Add resultSet to results.
@param resultSet new resultSet.
@param moreResultAvailable indicate if other results (ResultSet or updateCount) are available. | [
"Add",
"resultSet",
"to",
"results",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java#L217-L237 |
52,516 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java | Results.isFullyLoaded | public boolean isFullyLoaded(Protocol protocol) {
if (fetchSize == 0 || resultSet == null) {
return true;
}
return resultSet.isFullyLoaded()
&& executionResults.isEmpty()
&& !protocol.hasMoreResults();
} | java | public boolean isFullyLoaded(Protocol protocol) {
if (fetchSize == 0 || resultSet == null) {
return true;
}
return resultSet.isFullyLoaded()
&& executionResults.isEmpty()
&& !protocol.hasMoreResults();
} | [
"public",
"boolean",
"isFullyLoaded",
"(",
"Protocol",
"protocol",
")",
"{",
"if",
"(",
"fetchSize",
"==",
"0",
"||",
"resultSet",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"resultSet",
".",
"isFullyLoaded",
"(",
")",
"&&",
"executionRe... | Indicate if result contain result-set that is still streaming from server.
@param protocol current protocol
@return true if streaming is finished | [
"Indicate",
"if",
"result",
"contain",
"result",
"-",
"set",
"that",
"is",
"still",
"streaming",
"from",
"server",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java#L332-L339 |
52,517 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java | Results.getMoreResults | public boolean getMoreResults(final int current, Protocol protocol) throws SQLException {
if (fetchSize != 0 && resultSet != null) {
protocol.getLock().lock();
try {
//load current resultSet
if (current == Statement.CLOSE_CURRENT_RESULT && resultSet != null) {
resultSet.close(... | java | public boolean getMoreResults(final int current, Protocol protocol) throws SQLException {
if (fetchSize != 0 && resultSet != null) {
protocol.getLock().lock();
try {
//load current resultSet
if (current == Statement.CLOSE_CURRENT_RESULT && resultSet != null) {
resultSet.close(... | [
"public",
"boolean",
"getMoreResults",
"(",
"final",
"int",
"current",
",",
"Protocol",
"protocol",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"fetchSize",
"!=",
"0",
"&&",
"resultSet",
"!=",
"null",
")",
"{",
"protocol",
".",
"getLock",
"(",
")",
".",... | Position to next resultSet.
@param current one of the following <code>Statement</code> constants indicating what should
happen to current
<code>ResultSet</code> objects obtained using the method
<code>getResultSet</code>:
<code>Statement.CLOSE_CURRENT_RESULT</code>, <code>Statement.KEEP_CURRENT_RESULT</code>,
or <cod... | [
"Position",
"to",
"next",
"resultSet",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/Results.java#L354-L399 |
52,518 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbPoolDataSource.java | MariaDbPoolDataSource.getDatabaseName | public String getDatabaseName() {
if (database != null) {
return database;
}
return (urlParser != null && urlParser.getDatabase() != null) ? urlParser.getDatabase() : "";
} | java | public String getDatabaseName() {
if (database != null) {
return database;
}
return (urlParser != null && urlParser.getDatabase() != null) ? urlParser.getDatabase() : "";
} | [
"public",
"String",
"getDatabaseName",
"(",
")",
"{",
"if",
"(",
"database",
"!=",
"null",
")",
"{",
"return",
"database",
";",
"}",
"return",
"(",
"urlParser",
"!=",
"null",
"&&",
"urlParser",
".",
"getDatabase",
"(",
")",
"!=",
"null",
")",
"?",
"url... | Gets the name of the database.
@return the name of the database for this data source | [
"Gets",
"the",
"name",
"of",
"the",
"database",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbPoolDataSource.java#L94-L99 |
52,519 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbPoolDataSource.java | MariaDbPoolDataSource.getUser | public String getUser() {
if (user != null) {
return user;
}
return urlParser != null ? urlParser.getUsername() : null;
} | java | public String getUser() {
if (user != null) {
return user;
}
return urlParser != null ? urlParser.getUsername() : null;
} | [
"public",
"String",
"getUser",
"(",
")",
"{",
"if",
"(",
"user",
"!=",
"null",
")",
"{",
"return",
"user",
";",
"}",
"return",
"urlParser",
"!=",
"null",
"?",
"urlParser",
".",
"getUsername",
"(",
")",
":",
"null",
";",
"}"
] | Gets the username.
@return the username to use when connecting to the database | [
"Gets",
"the",
"username",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbPoolDataSource.java#L123-L128 |
52,520 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbPoolDataSource.java | MariaDbPoolDataSource.getPort | public int getPort() {
if (port != null && port != 0) {
return port;
}
return urlParser != null ? urlParser.getHostAddresses().get(0).port : 3306;
} | java | public int getPort() {
if (port != null && port != 0) {
return port;
}
return urlParser != null ? urlParser.getHostAddresses().get(0).port : 3306;
} | [
"public",
"int",
"getPort",
"(",
")",
"{",
"if",
"(",
"port",
"!=",
"null",
"&&",
"port",
"!=",
"0",
")",
"{",
"return",
"port",
";",
"}",
"return",
"urlParser",
"!=",
"null",
"?",
"urlParser",
".",
"getHostAddresses",
"(",
")",
".",
"get",
"(",
"0... | Returns the port number.
@return the port number | [
"Returns",
"the",
"port",
"number",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbPoolDataSource.java#L157-L162 |
52,521 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbPoolDataSource.java | MariaDbPoolDataSource.getServerName | public String getServerName() {
if (hostname != null) {
return hostname;
}
boolean hasHost = urlParser != null && this.urlParser.getHostAddresses().get(0).host != null;
return (hasHost) ? this.urlParser.getHostAddresses().get(0).host : "localhost";
} | java | public String getServerName() {
if (hostname != null) {
return hostname;
}
boolean hasHost = urlParser != null && this.urlParser.getHostAddresses().get(0).host != null;
return (hasHost) ? this.urlParser.getHostAddresses().get(0).host : "localhost";
} | [
"public",
"String",
"getServerName",
"(",
")",
"{",
"if",
"(",
"hostname",
"!=",
"null",
")",
"{",
"return",
"hostname",
";",
"}",
"boolean",
"hasHost",
"=",
"urlParser",
"!=",
"null",
"&&",
"this",
".",
"urlParser",
".",
"getHostAddresses",
"(",
")",
".... | Returns the name of the database server.
@return the name of the database server | [
"Returns",
"the",
"name",
"of",
"the",
"database",
"server",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbPoolDataSource.java#L214-L220 |
52,522 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/SendChangeDbPacket.java | SendChangeDbPacket.send | public static void send(final PacketOutputStream pos, final String database) throws IOException {
pos.startPacket(0);
pos.write(Packet.COM_INIT_DB);
pos.write(database.getBytes("UTF-8"));
pos.flush();
} | java | public static void send(final PacketOutputStream pos, final String database) throws IOException {
pos.startPacket(0);
pos.write(Packet.COM_INIT_DB);
pos.write(database.getBytes("UTF-8"));
pos.flush();
} | [
"public",
"static",
"void",
"send",
"(",
"final",
"PacketOutputStream",
"pos",
",",
"final",
"String",
"database",
")",
"throws",
"IOException",
"{",
"pos",
".",
"startPacket",
"(",
"0",
")",
";",
"pos",
".",
"write",
"(",
"Packet",
".",
"COM_INIT_DB",
")"... | Send a COM_INIT_DB request to specify the default schema for the connection.
@param pos Write outputStream
@param database database name
@throws IOException if connection problem occur | [
"Send",
"a",
"COM_INIT_DB",
"request",
"to",
"specify",
"the",
"default",
"schema",
"for",
"the",
"connection",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/SendChangeDbPacket.java#L69-L74 |
52,523 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/GssUtility.java | GssUtility.getAuthenticationMethod | public static GssapiAuth getAuthenticationMethod() {
try {
//Waffle-jna has jna as dependency, so if not available on classpath, just use standard authentication
if (Platform.isWindows()) {
try {
Class.forName("waffle.windows.auth.impl.WindowsAuthProviderImpl");
return new Wi... | java | public static GssapiAuth getAuthenticationMethod() {
try {
//Waffle-jna has jna as dependency, so if not available on classpath, just use standard authentication
if (Platform.isWindows()) {
try {
Class.forName("waffle.windows.auth.impl.WindowsAuthProviderImpl");
return new Wi... | [
"public",
"static",
"GssapiAuth",
"getAuthenticationMethod",
"(",
")",
"{",
"try",
"{",
"//Waffle-jna has jna as dependency, so if not available on classpath, just use standard authentication",
"if",
"(",
"Platform",
".",
"isWindows",
"(",
")",
")",
"{",
"try",
"{",
"Class"... | Get authentication method according to classpath. Windows native authentication is using
Waffle-jna.
@return authentication method | [
"Get",
"authentication",
"method",
"according",
"to",
"classpath",
".",
"Windows",
"native",
"authentication",
"is",
"using",
"Waffle",
"-",
"jna",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/gssapi/GssUtility.java#L13-L28 |
52,524 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/parameters/StreamParameter.java | StreamParameter.writeTo | public void writeTo(final PacketOutputStream pos) throws IOException {
pos.write(BINARY_INTRODUCER);
if (length == Long.MAX_VALUE) {
pos.write(is, true, noBackslashEscapes);
} else {
pos.write(is, length, true, noBackslashEscapes);
}
pos.write(QUOTE);
} | java | public void writeTo(final PacketOutputStream pos) throws IOException {
pos.write(BINARY_INTRODUCER);
if (length == Long.MAX_VALUE) {
pos.write(is, true, noBackslashEscapes);
} else {
pos.write(is, length, true, noBackslashEscapes);
}
pos.write(QUOTE);
} | [
"public",
"void",
"writeTo",
"(",
"final",
"PacketOutputStream",
"pos",
")",
"throws",
"IOException",
"{",
"pos",
".",
"write",
"(",
"BINARY_INTRODUCER",
")",
";",
"if",
"(",
"length",
"==",
"Long",
".",
"MAX_VALUE",
")",
"{",
"pos",
".",
"write",
"(",
"... | Write stream in text format.
@param pos database outputStream
@throws IOException if any error occur when reader stream | [
"Write",
"stream",
"in",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/parameters/StreamParameter.java#L89-L98 |
52,525 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/parameters/ByteArrayParameter.java | ByteArrayParameter.writeTo | public void writeTo(final PacketOutputStream pos) throws IOException {
pos.write(BINARY_INTRODUCER);
pos.writeBytesEscaped(bytes, bytes.length, noBackslashEscapes);
pos.write(QUOTE);
} | java | public void writeTo(final PacketOutputStream pos) throws IOException {
pos.write(BINARY_INTRODUCER);
pos.writeBytesEscaped(bytes, bytes.length, noBackslashEscapes);
pos.write(QUOTE);
} | [
"public",
"void",
"writeTo",
"(",
"final",
"PacketOutputStream",
"pos",
")",
"throws",
"IOException",
"{",
"pos",
".",
"write",
"(",
"BINARY_INTRODUCER",
")",
";",
"pos",
".",
"writeBytesEscaped",
"(",
"bytes",
",",
"bytes",
".",
"length",
",",
"noBackslashEsc... | Write data to socket in text format.
@param pos socket output stream
@throws IOException if socket error occur | [
"Write",
"data",
"to",
"socket",
"in",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/parameters/ByteArrayParameter.java#L76-L80 |
52,526 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/logging/LoggerFactory.java | LoggerFactory.init | @SuppressWarnings("unchecked")
public static void init(boolean mustLog) {
if ((hasToLog == null || hasToLog != mustLog) && mustLog) {
synchronized (LoggerFactory.class) {
if (hasToLog == null || hasToLog != mustLog) {
try {
Class.forName("org.slf4j.LoggerFactory");
... | java | @SuppressWarnings("unchecked")
public static void init(boolean mustLog) {
if ((hasToLog == null || hasToLog != mustLog) && mustLog) {
synchronized (LoggerFactory.class) {
if (hasToLog == null || hasToLog != mustLog) {
try {
Class.forName("org.slf4j.LoggerFactory");
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"init",
"(",
"boolean",
"mustLog",
")",
"{",
"if",
"(",
"(",
"hasToLog",
"==",
"null",
"||",
"hasToLog",
"!=",
"mustLog",
")",
"&&",
"mustLog",
")",
"{",
"synchronized",
"(",
... | Initialize factory.
@param mustLog indicate if must initiate Slf4j log | [
"Initialize",
"factory",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/logging/LoggerFactory.java#L65-L81 |
52,527 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/logging/LoggerFactory.java | LoggerFactory.getLogger | public static Logger getLogger(Class<?> clazz) {
if (hasToLog != null && hasToLog) {
return new Slf4JLogger(org.slf4j.LoggerFactory.getLogger(clazz));
} else {
return NO_LOGGER;
}
} | java | public static Logger getLogger(Class<?> clazz) {
if (hasToLog != null && hasToLog) {
return new Slf4JLogger(org.slf4j.LoggerFactory.getLogger(clazz));
} else {
return NO_LOGGER;
}
} | [
"public",
"static",
"Logger",
"getLogger",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"if",
"(",
"hasToLog",
"!=",
"null",
"&&",
"hasToLog",
")",
"{",
"return",
"new",
"Slf4JLogger",
"(",
"org",
".",
"slf4j",
".",
"LoggerFactory",
".",
"getLogger",
... | Initialize logger.
@param clazz initiator class
@return logger | [
"Initialize",
"logger",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/logging/LoggerFactory.java#L89-L95 |
52,528 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.standardSocket | public static Socket standardSocket(UrlParser urlParser, String host) throws IOException {
SocketFactory socketFactory;
String socketFactoryName = urlParser.getOptions().socketFactory;
if (socketFactoryName != null) {
try {
@SuppressWarnings("unchecked")
Class<? extends SocketFactory> ... | java | public static Socket standardSocket(UrlParser urlParser, String host) throws IOException {
SocketFactory socketFactory;
String socketFactoryName = urlParser.getOptions().socketFactory;
if (socketFactoryName != null) {
try {
@SuppressWarnings("unchecked")
Class<? extends SocketFactory> ... | [
"public",
"static",
"Socket",
"standardSocket",
"(",
"UrlParser",
"urlParser",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"SocketFactory",
"socketFactory",
";",
"String",
"socketFactoryName",
"=",
"urlParser",
".",
"getOptions",
"(",
")",
".",
"sock... | Use standard socket implementation.
@param urlParser url parser
@param host host to connect
@return socket
@throws IOException in case of error establishing socket. | [
"Use",
"standard",
"socket",
"implementation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L119-L140 |
52,529 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.escapeString | public static String escapeString(String value, boolean noBackslashEscapes) {
if (!value.contains("'")) {
if (noBackslashEscapes) {
return value;
}
if (!value.contains("\\")) {
return value;
}
}
String escaped = value.replace("'", "''");
if (noBackslashEscapes) {
... | java | public static String escapeString(String value, boolean noBackslashEscapes) {
if (!value.contains("'")) {
if (noBackslashEscapes) {
return value;
}
if (!value.contains("\\")) {
return value;
}
}
String escaped = value.replace("'", "''");
if (noBackslashEscapes) {
... | [
"public",
"static",
"String",
"escapeString",
"(",
"String",
"value",
",",
"boolean",
"noBackslashEscapes",
")",
"{",
"if",
"(",
"!",
"value",
".",
"contains",
"(",
"\"'\"",
")",
")",
"{",
"if",
"(",
"noBackslashEscapes",
")",
"{",
"return",
"value",
";",
... | Escape String.
@param value value to escape
@param noBackslashEscapes must backslash be escaped
@return escaped string. | [
"Escape",
"String",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L149-L163 |
52,530 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.encryptPassword | public static byte[] encryptPassword(final String password, final byte[] seed,
String passwordCharacterEncoding)
throws NoSuchAlgorithmException, UnsupportedEncodingException {
if (password == null || password.isEmpty()) {
return new byte[0];
}
final MessageDigest messageDigest = Message... | java | public static byte[] encryptPassword(final String password, final byte[] seed,
String passwordCharacterEncoding)
throws NoSuchAlgorithmException, UnsupportedEncodingException {
if (password == null || password.isEmpty()) {
return new byte[0];
}
final MessageDigest messageDigest = Message... | [
"public",
"static",
"byte",
"[",
"]",
"encryptPassword",
"(",
"final",
"String",
"password",
",",
"final",
"byte",
"[",
"]",
"seed",
",",
"String",
"passwordCharacterEncoding",
")",
"throws",
"NoSuchAlgorithmException",
",",
"UnsupportedEncodingException",
"{",
"if"... | Encrypts a password.
<p>protocol for authentication is like this: 1. Server sends a random array of bytes (the
seed) 2. client makes a sha1 digest of the password 3. client hashes the output of 2 4. client
digests the seed 5. client updates the digest with the output from 3 6. an xor of the output of
5 and 2 is sent t... | [
"Encrypts",
"a",
"password",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L181-L212 |
52,531 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.copyWithLength | public static byte[] copyWithLength(byte[] orig, int length) {
// No need to initialize with zero bytes, because the bytes are already initialized with that
byte[] result = new byte[length];
int howMuchToCopy = length < orig.length ? length : orig.length;
System.arraycopy(orig, 0, result, 0, howMuchToCo... | java | public static byte[] copyWithLength(byte[] orig, int length) {
// No need to initialize with zero bytes, because the bytes are already initialized with that
byte[] result = new byte[length];
int howMuchToCopy = length < orig.length ? length : orig.length;
System.arraycopy(orig, 0, result, 0, howMuchToCo... | [
"public",
"static",
"byte",
"[",
"]",
"copyWithLength",
"(",
"byte",
"[",
"]",
"orig",
",",
"int",
"length",
")",
"{",
"// No need to initialize with zero bytes, because the bytes are already initialized with that",
"byte",
"[",
"]",
"result",
"=",
"new",
"byte",
"[",... | Copies the original byte array content to a new byte array. The resulting byte array is always
"length" size. If length is smaller than the original byte array, the resulting byte array is
truncated. If length is bigger than the original byte array, the resulting byte array is filled
with zero bytes.
@param orig the... | [
"Copies",
"the",
"original",
"byte",
"array",
"content",
"to",
"a",
"new",
"byte",
"array",
".",
"The",
"resulting",
"byte",
"array",
"is",
"always",
"length",
"size",
".",
"If",
"length",
"is",
"smaller",
"than",
"the",
"original",
"byte",
"array",
"the",... | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L224-L230 |
52,532 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.copyRange | public static byte[] copyRange(byte[] orig, int from, int to) {
int length = to - from;
byte[] result = new byte[length];
int howMuchToCopy = orig.length - from < length ? orig.length - from : length;
System.arraycopy(orig, from, result, 0, howMuchToCopy);
return result;
} | java | public static byte[] copyRange(byte[] orig, int from, int to) {
int length = to - from;
byte[] result = new byte[length];
int howMuchToCopy = orig.length - from < length ? orig.length - from : length;
System.arraycopy(orig, from, result, 0, howMuchToCopy);
return result;
} | [
"public",
"static",
"byte",
"[",
"]",
"copyRange",
"(",
"byte",
"[",
"]",
"orig",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"int",
"length",
"=",
"to",
"-",
"from",
";",
"byte",
"[",
"]",
"result",
"=",
"new",
"byte",
"[",
"length",
"]",
... | Copies from original byte array to a new byte array. The resulting byte array is always
"to-from" size.
@param orig the original byte array
@param from index of first byte in original byte array which will be copied
@param to index of last byte in original byte array which will be copied. This can be outside
of the ... | [
"Copies",
"from",
"original",
"byte",
"array",
"to",
"a",
"new",
"byte",
"array",
".",
"The",
"resulting",
"byte",
"array",
"is",
"always",
"to",
"-",
"from",
"size",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L242-L248 |
52,533 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.retrieveProxy | public static Protocol retrieveProxy(final UrlParser urlParser, final GlobalStateInfo globalInfo)
throws SQLException {
final ReentrantLock lock = new ReentrantLock();
Protocol protocol;
switch (urlParser.getHaMode()) {
case AURORA:
return getProxyLoggingIfNeeded(urlParser, (Protocol) Pr... | java | public static Protocol retrieveProxy(final UrlParser urlParser, final GlobalStateInfo globalInfo)
throws SQLException {
final ReentrantLock lock = new ReentrantLock();
Protocol protocol;
switch (urlParser.getHaMode()) {
case AURORA:
return getProxyLoggingIfNeeded(urlParser, (Protocol) Pr... | [
"public",
"static",
"Protocol",
"retrieveProxy",
"(",
"final",
"UrlParser",
"urlParser",
",",
"final",
"GlobalStateInfo",
"globalInfo",
")",
"throws",
"SQLException",
"{",
"final",
"ReentrantLock",
"lock",
"=",
"new",
"ReentrantLock",
"(",
")",
";",
"Protocol",
"p... | Retrieve protocol corresponding to the failover options. if no failover option, protocol will
not be proxied. if a failover option is precised, protocol will be proxied so that any
connection error will be handle directly.
@param urlParser urlParser corresponding to connection url string.
@param globalInfo global var... | [
"Retrieve",
"protocol",
"corresponding",
"to",
"the",
"failover",
"options",
".",
"if",
"no",
"failover",
"option",
"protocol",
"will",
"not",
"be",
"proxied",
".",
"if",
"a",
"failover",
"option",
"is",
"precised",
"protocol",
"will",
"be",
"proxied",
"so",
... | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L535-L563 |
52,534 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.createSocket | public static Socket createSocket(UrlParser urlParser, String host) throws IOException {
return socketHandler.apply(urlParser, host);
} | java | public static Socket createSocket(UrlParser urlParser, String host) throws IOException {
return socketHandler.apply(urlParser, host);
} | [
"public",
"static",
"Socket",
"createSocket",
"(",
"UrlParser",
"urlParser",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"return",
"socketHandler",
".",
"apply",
"(",
"urlParser",
",",
"host",
")",
";",
"}"
] | Create socket accordingly to options.
@param urlParser urlParser
@param host hostName ( mandatory only for named pipe)
@return a nex socket
@throws IOException if connection error occur | [
"Create",
"socket",
"accordingly",
"to",
"options",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L602-L604 |
52,535 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.parseSessionVariables | public static String parseSessionVariables(String sessionVariable) {
StringBuilder out = new StringBuilder();
StringBuilder sb = new StringBuilder();
Parse state = Parse.Normal;
boolean iskey = true;
boolean singleQuotes = true;
boolean first = true;
String key = null;
char[] chars = se... | java | public static String parseSessionVariables(String sessionVariable) {
StringBuilder out = new StringBuilder();
StringBuilder sb = new StringBuilder();
Parse state = Parse.Normal;
boolean iskey = true;
boolean singleQuotes = true;
boolean first = true;
String key = null;
char[] chars = se... | [
"public",
"static",
"String",
"parseSessionVariables",
"(",
"String",
"sessionVariable",
")",
"{",
"StringBuilder",
"out",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Parse",
"state",
"=",
"Pa... | Parse the option "sessionVariable" to ensure having no injection. semi-column not in string
will be replaced by comma.
@param sessionVariable option value
@return parsed String | [
"Parse",
"the",
"option",
"sessionVariable",
"to",
"ensure",
"having",
"no",
"injection",
".",
"semi",
"-",
"column",
"not",
"in",
"string",
"will",
"be",
"replaced",
"by",
"comma",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L769-L869 |
52,536 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/Utils.java | Utils.transactionFromString | public static int transactionFromString(String txIsolation) throws SQLException {
switch (txIsolation) { //tx_isolation
case "READ-UNCOMMITTED":
return Connection.TRANSACTION_READ_UNCOMMITTED;
case "READ-COMMITTED":
return Connection.TRANSACTION_READ_COMMITTED;
case "REPEATABLE-R... | java | public static int transactionFromString(String txIsolation) throws SQLException {
switch (txIsolation) { //tx_isolation
case "READ-UNCOMMITTED":
return Connection.TRANSACTION_READ_UNCOMMITTED;
case "READ-COMMITTED":
return Connection.TRANSACTION_READ_COMMITTED;
case "REPEATABLE-R... | [
"public",
"static",
"int",
"transactionFromString",
"(",
"String",
"txIsolation",
")",
"throws",
"SQLException",
"{",
"switch",
"(",
"txIsolation",
")",
"{",
"//tx_isolation",
"case",
"\"READ-UNCOMMITTED\"",
":",
"return",
"Connection",
".",
"TRANSACTION_READ_UNCOMMITTE... | Traduce a String value of transaction isolation to corresponding java value.
@param txIsolation String value
@return java corresponding value (Connection.TRANSACTION_READ_UNCOMMITTED,
Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ or
Connection.TRANSACTION_SERIALIZABLE)
@throws SQLExcept... | [
"Traduce",
"a",
"String",
"value",
"of",
"transaction",
"isolation",
"to",
"corresponding",
"java",
"value",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/Utils.java#L889-L906 |
52,537 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbProcedureStatement.java | MariaDbProcedureStatement.validAllParameters | private void validAllParameters() throws SQLException {
setInputOutputParameterMap();
//Set value for OUT parameters
for (int index = 0; index < params.size(); index++) {
if (!params.get(index).isInput()) {
super.setParameter(index + 1, new NullParameter());
}
}
validParameters(... | java | private void validAllParameters() throws SQLException {
setInputOutputParameterMap();
//Set value for OUT parameters
for (int index = 0; index < params.size(); index++) {
if (!params.get(index).isInput()) {
super.setParameter(index + 1, new NullParameter());
}
}
validParameters(... | [
"private",
"void",
"validAllParameters",
"(",
")",
"throws",
"SQLException",
"{",
"setInputOutputParameterMap",
"(",
")",
";",
"//Set value for OUT parameters",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"params",
".",
"size",
"(",
")",
";",
"ind... | Valid that all parameters are set.
@throws SQLException if set parameters is not right | [
"Valid",
"that",
"all",
"parameters",
"are",
"set",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbProcedureStatement.java#L173-L183 |
52,538 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/Utils.java | Utils.equal | public static int equal(int b, int c) {
int result = 0;
int xor = b ^ c;
for (int i = 0; i < 8; i++) {
result |= xor >> i;
}
return (result ^ 0x01) & 0x01;
} | java | public static int equal(int b, int c) {
int result = 0;
int xor = b ^ c;
for (int i = 0; i < 8; i++) {
result |= xor >> i;
}
return (result ^ 0x01) & 0x01;
} | [
"public",
"static",
"int",
"equal",
"(",
"int",
"b",
",",
"int",
"c",
")",
"{",
"int",
"result",
"=",
"0",
";",
"int",
"xor",
"=",
"b",
"^",
"c",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"8",
";",
"i",
"++",
")",
"{",
"result... | Constant-time byte comparison.
@param b a byte
@param c a byte
@return 1 if b and c are equal, 0 otherwise. | [
"Constant",
"-",
"time",
"byte",
"comparison",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/Utils.java#L26-L33 |
52,539 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/Utils.java | Utils.bytesToHex | public static String bytesToHex(byte[] raw) {
if (raw == null) {
return null;
}
final StringBuilder hex = new StringBuilder(2 * raw.length);
for (final byte b : raw) {
hex.append(Character.forDigit((b & 0xF0) >> 4, 16))
.append(Character.forDigit((b & 0x0F), 16));
}
return ... | java | public static String bytesToHex(byte[] raw) {
if (raw == null) {
return null;
}
final StringBuilder hex = new StringBuilder(2 * raw.length);
for (final byte b : raw) {
hex.append(Character.forDigit((b & 0xF0) >> 4, 16))
.append(Character.forDigit((b & 0x0F), 16));
}
return ... | [
"public",
"static",
"String",
"bytesToHex",
"(",
"byte",
"[",
"]",
"raw",
")",
"{",
"if",
"(",
"raw",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"StringBuilder",
"hex",
"=",
"new",
"StringBuilder",
"(",
"2",
"*",
"raw",
".",
"length... | Converts bytes to a hex string.
@param raw the byte[] to be converted.
@return the hex representation as a string. | [
"Converts",
"bytes",
"to",
"a",
"hex",
"string",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/Utils.java#L94-L104 |
52,540 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java | AuroraListener.findClusterHostAddress | private HostAddress findClusterHostAddress(UrlParser urlParser) throws SQLException {
List<HostAddress> hostAddresses = urlParser.getHostAddresses();
Matcher matcher;
for (HostAddress hostAddress : hostAddresses) {
matcher = auroraDnsPattern.matcher(hostAddress.host);
if (matcher.find()) {
... | java | private HostAddress findClusterHostAddress(UrlParser urlParser) throws SQLException {
List<HostAddress> hostAddresses = urlParser.getHostAddresses();
Matcher matcher;
for (HostAddress hostAddress : hostAddresses) {
matcher = auroraDnsPattern.matcher(hostAddress.host);
if (matcher.find()) {
... | [
"private",
"HostAddress",
"findClusterHostAddress",
"(",
"UrlParser",
"urlParser",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"HostAddress",
">",
"hostAddresses",
"=",
"urlParser",
".",
"getHostAddresses",
"(",
")",
";",
"Matcher",
"matcher",
";",
"for",
"("... | Retrieves the cluster host address from the UrlParser instance.
@param urlParser object that holds the connection information
@return cluster host address | [
"Retrieves",
"the",
"cluster",
"host",
"address",
"from",
"the",
"UrlParser",
"instance",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java#L105-L137 |
52,541 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java | AuroraListener.retrieveAllEndpointsAndSet | public void retrieveAllEndpointsAndSet(Protocol protocol) throws SQLException {
// For a given cluster, same port for all endpoints and same end host address
if (clusterDnsSuffix != null) {
List<String> endpoints = getCurrentEndpointIdentifiers(protocol);
setUrlParserFromEndpoints(endpoints, protoco... | java | public void retrieveAllEndpointsAndSet(Protocol protocol) throws SQLException {
// For a given cluster, same port for all endpoints and same end host address
if (clusterDnsSuffix != null) {
List<String> endpoints = getCurrentEndpointIdentifiers(protocol);
setUrlParserFromEndpoints(endpoints, protoco... | [
"public",
"void",
"retrieveAllEndpointsAndSet",
"(",
"Protocol",
"protocol",
")",
"throws",
"SQLException",
"{",
"// For a given cluster, same port for all endpoints and same end host address",
"if",
"(",
"clusterDnsSuffix",
"!=",
"null",
")",
"{",
"List",
"<",
"String",
">... | Retrieves the information necessary to add a new endpoint. Calls the methods that retrieves the
instance identifiers and sets urlParser accordingly.
@param protocol current protocol connected to
@throws SQLException if connection error occur | [
"Retrieves",
"the",
"information",
"necessary",
"to",
"add",
"a",
"new",
"endpoint",
".",
"Calls",
"the",
"methods",
"that",
"retrieves",
"the",
"instance",
"identifiers",
"and",
"sets",
"urlParser",
"accordingly",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java#L241-L248 |
52,542 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java | AuroraListener.getCurrentEndpointIdentifiers | private List<String> getCurrentEndpointIdentifiers(Protocol protocol) throws SQLException {
List<String> endpoints = new ArrayList<>();
try {
proxy.lock.lock();
try {
// Deleted instance may remain in db for 24 hours so ignoring instances that have had no change
// for 3 minutes
... | java | private List<String> getCurrentEndpointIdentifiers(Protocol protocol) throws SQLException {
List<String> endpoints = new ArrayList<>();
try {
proxy.lock.lock();
try {
// Deleted instance may remain in db for 24 hours so ignoring instances that have had no change
// for 3 minutes
... | [
"private",
"List",
"<",
"String",
">",
"getCurrentEndpointIdentifiers",
"(",
"Protocol",
"protocol",
")",
"throws",
"SQLException",
"{",
"List",
"<",
"String",
">",
"endpoints",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"{",
"proxy",
".",
"lock",
... | Retrieves all endpoints of a cluster from the appropriate database table.
@param protocol current protocol connected to
@return instance endpoints of the cluster
@throws SQLException if connection error occur | [
"Retrieves",
"all",
"endpoints",
"of",
"a",
"cluster",
"from",
"the",
"appropriate",
"database",
"table",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java#L257-L295 |
52,543 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java | AuroraListener.setUrlParserFromEndpoints | private void setUrlParserFromEndpoints(List<String> endpoints, int port) {
List<HostAddress> addresses = new ArrayList<>();
for (String endpoint : endpoints) {
HostAddress newHostAddress = new HostAddress(endpoint, port, null);
addresses.add(newHostAddress);
}
synchronized (urlParser) {
... | java | private void setUrlParserFromEndpoints(List<String> endpoints, int port) {
List<HostAddress> addresses = new ArrayList<>();
for (String endpoint : endpoints) {
HostAddress newHostAddress = new HostAddress(endpoint, port, null);
addresses.add(newHostAddress);
}
synchronized (urlParser) {
... | [
"private",
"void",
"setUrlParserFromEndpoints",
"(",
"List",
"<",
"String",
">",
"endpoints",
",",
"int",
"port",
")",
"{",
"List",
"<",
"HostAddress",
">",
"addresses",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"endpoint",
":",
... | Sets urlParser accordingly to discovered hosts.
@param endpoints instance identifiers
@param port port that is common to all endpoints | [
"Sets",
"urlParser",
"accordingly",
"to",
"discovered",
"hosts",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/impl/AuroraListener.java#L303-L313 |
52,544 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.p2 | public static org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement p2(
final Curve curve,
final FieldElement X,
final FieldElement Y,
final FieldElement Z) {
return new org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement(curve,
Represent... | java | public static org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement p2(
final Curve curve,
final FieldElement X,
final FieldElement Y,
final FieldElement Z) {
return new org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement(curve,
Represent... | [
"public",
"static",
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"p2",
"(",
"final",
"Curve",
"curve",
",",
"final",
"FieldElement",
"X",
",",
"fina... | Creates a new group element in P2 representation.
@param curve The curve.
@param X The $X$ coordinate.
@param Y The $Y$ coordinate.
@param Z The $Z$ coordinate.
@return The group element in P2 representation. | [
"Creates",
"a",
"new",
"group",
"element",
"in",
"P2",
"representation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L170-L177 |
52,545 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.p1p1 | public static org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement p1p1(
final Curve curve,
final FieldElement X,
final FieldElement Y,
final FieldElement Z,
final FieldElement T) {
return new org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupEl... | java | public static org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement p1p1(
final Curve curve,
final FieldElement X,
final FieldElement Y,
final FieldElement Z,
final FieldElement T) {
return new org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupEl... | [
"public",
"static",
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"p1p1",
"(",
"final",
"Curve",
"curve",
",",
"final",
"FieldElement",
"X",
",",
"fi... | Creates a new group element in P1P1 representation.
@param curve The curve.
@param X The $X$ coordinate.
@param Y The $Y$ coordinate.
@param Z The $Z$ coordinate.
@param T The $T$ coordinate.
@return The group element in P1P1 representation. | [
"Creates",
"a",
"new",
"group",
"element",
"in",
"P1P1",
"representation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L209-L217 |
52,546 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.precomp | public static org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement precomp(
final Curve curve,
final FieldElement ypx,
final FieldElement ymx,
final FieldElement xy2d) {
return new org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement(curve,
... | java | public static org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement precomp(
final Curve curve,
final FieldElement ypx,
final FieldElement ymx,
final FieldElement xy2d) {
return new org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement(curve,
... | [
"public",
"static",
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"precomp",
"(",
"final",
"Curve",
"curve",
",",
"final",
"FieldElement",
"ypx",
",",
... | Creates a new group element in PRECOMP representation.
@param curve The curve.
@param ypx The $y + x$ value.
@param ymx The $y - x$ value.
@param xy2d The $2 * d * x * y$ value.
@return The group element in PRECOMP representation. | [
"Creates",
"a",
"new",
"group",
"element",
"in",
"PRECOMP",
"representation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L228-L235 |
52,547 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.cached | public static org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement cached(
final Curve curve,
final FieldElement YpX,
final FieldElement YmX,
final FieldElement Z,
final FieldElement T2d) {
return new org.mariadb.jdbc.internal.com.send.authentication.ed25519.math... | java | public static org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement cached(
final Curve curve,
final FieldElement YpX,
final FieldElement YmX,
final FieldElement Z,
final FieldElement T2d) {
return new org.mariadb.jdbc.internal.com.send.authentication.ed25519.math... | [
"public",
"static",
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"cached",
"(",
"final",
"Curve",
"curve",
",",
"final",
"FieldElement",
"YpX",
",",
... | Creates a new group element in CACHED representation.
@param curve The curve.
@param YpX The $Y + X$ value.
@param YmX The $Y - X$ value.
@param Z The $Z$ coordinate.
@param T2d The $2 * d * T$ value.
@return The group element in CACHED representation. | [
"Creates",
"a",
"new",
"group",
"element",
"in",
"CACHED",
"representation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L247-L255 |
52,548 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.toByteArray | public byte[] toByteArray() {
switch (this.repr) {
case P2:
case P3:
FieldElement recip = Z.invert();
FieldElement x = X.multiply(recip);
FieldElement y = Y.multiply(recip);
byte[] s = y.toByteArray();
s[s.length - 1] |= (x.isNegative() ? (byte) 0x80 : 0);
... | java | public byte[] toByteArray() {
switch (this.repr) {
case P2:
case P3:
FieldElement recip = Z.invert();
FieldElement x = X.multiply(recip);
FieldElement y = Y.multiply(recip);
byte[] s = y.toByteArray();
s[s.length - 1] |= (x.isNegative() ? (byte) 0x80 : 0);
... | [
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
")",
"{",
"switch",
"(",
"this",
".",
"repr",
")",
"{",
"case",
"P2",
":",
"case",
"P3",
":",
"FieldElement",
"recip",
"=",
"Z",
".",
"invert",
"(",
")",
";",
"FieldElement",
"x",
"=",
"X",
".",
"mu... | Converts the group element to an encoded point on the curve.
@return The encoded point as byte array. | [
"Converts",
"the",
"group",
"element",
"to",
"an",
"encoded",
"point",
"on",
"the",
"curve",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L399-L412 |
52,549 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.toP2 | public org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement toP2() {
return toRep(Representation.P2);
} | java | public org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement toP2() {
return toRep(Representation.P2);
} | [
"public",
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"toP2",
"(",
")",
"{",
"return",
"toRep",
"(",
"Representation",
".",
"P2",
")",
";",
"}"
] | Converts the group element to the P2 representation.
@return The group element in the P2 representation. | [
"Converts",
"the",
"group",
"element",
"to",
"the",
"P2",
"representation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L419-L421 |
52,550 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.toP3 | public org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement toP3() {
return toRep(Representation.P3);
} | java | public org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement toP3() {
return toRep(Representation.P3);
} | [
"public",
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"toP3",
"(",
")",
"{",
"return",
"toRep",
"(",
"Representation",
".",
"P3",
")",
";",
"}"
] | Converts the group element to the P3 representation.
@return The group element in the P3 representation. | [
"Converts",
"the",
"group",
"element",
"to",
"the",
"P3",
"representation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L428-L430 |
52,551 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.toCached | public org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement toCached() {
return toRep(Representation.CACHED);
} | java | public org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement toCached() {
return toRep(Representation.CACHED);
} | [
"public",
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"toCached",
"(",
")",
"{",
"return",
"toRep",
"(",
"Representation",
".",
"CACHED",
")",
";",... | Converts the group element to the CACHED representation.
@return The group element in the CACHED representation. | [
"Converts",
"the",
"group",
"element",
"to",
"the",
"CACHED",
"representation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L437-L439 |
52,552 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.isOnCurve | public boolean isOnCurve(Curve curve) {
switch (repr) {
case P2:
case P3:
FieldElement recip = Z.invert();
FieldElement x = X.multiply(recip);
FieldElement y = Y.multiply(recip);
FieldElement xx = x.square();
FieldElement yy = y.square();
FieldElement dxxy... | java | public boolean isOnCurve(Curve curve) {
switch (repr) {
case P2:
case P3:
FieldElement recip = Z.invert();
FieldElement x = X.multiply(recip);
FieldElement y = Y.multiply(recip);
FieldElement xx = x.square();
FieldElement yy = y.square();
FieldElement dxxy... | [
"public",
"boolean",
"isOnCurve",
"(",
"Curve",
"curve",
")",
"{",
"switch",
"(",
"repr",
")",
"{",
"case",
"P2",
":",
"case",
"P3",
":",
"FieldElement",
"recip",
"=",
"Z",
".",
"invert",
"(",
")",
";",
"FieldElement",
"x",
"=",
"X",
".",
"multiply",... | Verify that a point is on the curve.
@param curve The curve to check.
@return true if the point lies on the curve. | [
"Verify",
"that",
"a",
"point",
"is",
"on",
"the",
"curve",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L1021-L1036 |
52,553 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbClob.java | MariaDbClob.getSubString | public String getSubString(long pos, int length) throws SQLException {
if (pos < 1) {
throw ExceptionMapper.getSqlException("position must be >= 1");
}
if (length < 0) {
throw ExceptionMapper.getSqlException("length must be > 0");
}
try {
String val = toString();
return va... | java | public String getSubString(long pos, int length) throws SQLException {
if (pos < 1) {
throw ExceptionMapper.getSqlException("position must be >= 1");
}
if (length < 0) {
throw ExceptionMapper.getSqlException("length must be > 0");
}
try {
String val = toString();
return va... | [
"public",
"String",
"getSubString",
"(",
"long",
"pos",
",",
"int",
"length",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"pos",
"<",
"1",
")",
"{",
"throw",
"ExceptionMapper",
".",
"getSqlException",
"(",
"\"position must be >= 1\"",
")",
";",
"}",
"if",... | Get sub string.
@param pos position
@param length length of sub string
@return substring
@throws SQLException if pos is less than 1 or length is less than 0 | [
"Get",
"sub",
"string",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbClob.java#L118-L134 |
52,554 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbClob.java | MariaDbClob.getCharacterStream | public Reader getCharacterStream(long pos, long length) throws SQLException {
String val = toString();
if (val.length() < (int) pos - 1 + length) {
throw ExceptionMapper
.getSqlException("pos + length is greater than the number of characters in the Clob");
}
String sub = val.substring((i... | java | public Reader getCharacterStream(long pos, long length) throws SQLException {
String val = toString();
if (val.length() < (int) pos - 1 + length) {
throw ExceptionMapper
.getSqlException("pos + length is greater than the number of characters in the Clob");
}
String sub = val.substring((i... | [
"public",
"Reader",
"getCharacterStream",
"(",
"long",
"pos",
",",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"String",
"val",
"=",
"toString",
"(",
")",
";",
"if",
"(",
"val",
".",
"length",
"(",
")",
"<",
"(",
"int",
")",
"pos",
"-",
"1"... | Returns a Reader object that contains a partial Clob value, starting with the character
specified by pos, which is length characters in length.
@param pos the offset to the first character of the partial value to be retrieved. The first
character in the Clob is at position 1.
@param length the length in characters ... | [
"Returns",
"a",
"Reader",
"object",
"that",
"contains",
"a",
"partial",
"Clob",
"value",
"starting",
"with",
"the",
"character",
"specified",
"by",
"pos",
"which",
"is",
"length",
"characters",
"in",
"length",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbClob.java#L152-L160 |
52,555 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbClob.java | MariaDbClob.setCharacterStream | public Writer setCharacterStream(long pos) throws SQLException {
int bytePosition = utf8Position((int) pos - 1);
OutputStream stream = setBinaryStream(bytePosition + 1);
return new OutputStreamWriter(stream, StandardCharsets.UTF_8);
} | java | public Writer setCharacterStream(long pos) throws SQLException {
int bytePosition = utf8Position((int) pos - 1);
OutputStream stream = setBinaryStream(bytePosition + 1);
return new OutputStreamWriter(stream, StandardCharsets.UTF_8);
} | [
"public",
"Writer",
"setCharacterStream",
"(",
"long",
"pos",
")",
"throws",
"SQLException",
"{",
"int",
"bytePosition",
"=",
"utf8Position",
"(",
"(",
"int",
")",
"pos",
"-",
"1",
")",
";",
"OutputStream",
"stream",
"=",
"setBinaryStream",
"(",
"bytePosition"... | Set character stream.
@param pos position
@return writer
@throws SQLException if position is invalid | [
"Set",
"character",
"stream",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbClob.java#L169-L173 |
52,556 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbClob.java | MariaDbClob.utf8Position | private int utf8Position(int charPosition) {
int pos = offset;
for (int i = 0; i < charPosition; i++) {
int byteValue = data[pos] & 0xff;
if (byteValue < 0x80) {
pos += 1;
} else if (byteValue < 0xC2) {
throw new UncheckedIOException("invalid UTF8", new CharacterCodingException... | java | private int utf8Position(int charPosition) {
int pos = offset;
for (int i = 0; i < charPosition; i++) {
int byteValue = data[pos] & 0xff;
if (byteValue < 0x80) {
pos += 1;
} else if (byteValue < 0xC2) {
throw new UncheckedIOException("invalid UTF8", new CharacterCodingException... | [
"private",
"int",
"utf8Position",
"(",
"int",
"charPosition",
")",
"{",
"int",
"pos",
"=",
"offset",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"charPosition",
";",
"i",
"++",
")",
"{",
"int",
"byteValue",
"=",
"data",
"[",
"pos",
"]",
... | Convert character position into byte position in UTF8 byte array.
@param charPosition charPosition
@return byte position | [
"Convert",
"character",
"position",
"into",
"byte",
"position",
"in",
"UTF8",
"byte",
"array",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbClob.java#L193-L212 |
52,557 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbClob.java | MariaDbClob.setString | public int setString(long pos, String str) throws SQLException {
int bytePosition = utf8Position((int) pos - 1);
super.setBytes(bytePosition + 1 - offset, str.getBytes(StandardCharsets.UTF_8));
return str.length();
} | java | public int setString(long pos, String str) throws SQLException {
int bytePosition = utf8Position((int) pos - 1);
super.setBytes(bytePosition + 1 - offset, str.getBytes(StandardCharsets.UTF_8));
return str.length();
} | [
"public",
"int",
"setString",
"(",
"long",
"pos",
",",
"String",
"str",
")",
"throws",
"SQLException",
"{",
"int",
"bytePosition",
"=",
"utf8Position",
"(",
"(",
"int",
")",
"pos",
"-",
"1",
")",
";",
"super",
".",
"setBytes",
"(",
"bytePosition",
"+",
... | Set String.
@param pos position
@param str string
@return string length
@throws SQLException if UTF-8 conversion failed | [
"Set",
"String",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbClob.java#L222-L226 |
52,558 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbClob.java | MariaDbClob.length | @Override
public long length() {
//The length of a character string is the number of UTF-16 units (not the number of characters)
long len = 0;
int pos = offset;
//set ASCII (<= 127 chars)
for (; len < length && data[pos] >= 0; ) {
len++;
pos++;
}
//multi-bytes UTF-8
while... | java | @Override
public long length() {
//The length of a character string is the number of UTF-16 units (not the number of characters)
long len = 0;
int pos = offset;
//set ASCII (<= 127 chars)
for (; len < length && data[pos] >= 0; ) {
len++;
pos++;
}
//multi-bytes UTF-8
while... | [
"@",
"Override",
"public",
"long",
"length",
"(",
")",
"{",
"//The length of a character string is the number of UTF-16 units (not the number of characters)",
"long",
"len",
"=",
"0",
";",
"int",
"pos",
"=",
"offset",
";",
"//set ASCII (<= 127 chars)",
"for",
"(",
";",
... | Return character length of the Clob. Assume UTF8 encoding. | [
"Return",
"character",
"length",
"of",
"the",
"Clob",
".",
"Assume",
"UTF8",
"encoding",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbClob.java#L239-L282 |
52,559 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/tls/MariaDbX509KeyManager.java | MariaDbX509KeyManager.searchAccurateAliases | private ArrayList<String> searchAccurateAliases(String[] keyTypes, Principal[] issuers) {
if (keyTypes == null || keyTypes.length == 0) {
return null;
}
ArrayList<String> accurateAliases = new ArrayList<>();
for (Map.Entry<String, KeyStore.PrivateKeyEntry> mapEntry : privateKeyHash.entrySet()) {
... | java | private ArrayList<String> searchAccurateAliases(String[] keyTypes, Principal[] issuers) {
if (keyTypes == null || keyTypes.length == 0) {
return null;
}
ArrayList<String> accurateAliases = new ArrayList<>();
for (Map.Entry<String, KeyStore.PrivateKeyEntry> mapEntry : privateKeyHash.entrySet()) {
... | [
"private",
"ArrayList",
"<",
"String",
">",
"searchAccurateAliases",
"(",
"String",
"[",
"]",
"keyTypes",
",",
"Principal",
"[",
"]",
"issuers",
")",
"{",
"if",
"(",
"keyTypes",
"==",
"null",
"||",
"keyTypes",
".",
"length",
"==",
"0",
")",
"{",
"return"... | Search aliases corresponding to algorithms and issuers.
@param keyTypes list of algorithms
@param issuers list of issuers;
@return list of corresponding aliases | [
"Search",
"aliases",
"corresponding",
"to",
"algorithms",
"and",
"issuers",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/tls/MariaDbX509KeyManager.java#L156-L189 |
52,560 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/io/socket/SocketUtility.java | SocketUtility.getSocketHandler | @SuppressWarnings("unchecked")
public static SocketHandlerFunction getSocketHandler() {
try {
//forcing use of JNA to ensure AOT compilation
Platform.getOSType();
return (urlParser, host) -> {
if (urlParser.getOptions().pipe != null) {
return new NamedPipeSocket(host, urlParse... | java | @SuppressWarnings("unchecked")
public static SocketHandlerFunction getSocketHandler() {
try {
//forcing use of JNA to ensure AOT compilation
Platform.getOSType();
return (urlParser, host) -> {
if (urlParser.getOptions().pipe != null) {
return new NamedPipeSocket(host, urlParse... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"SocketHandlerFunction",
"getSocketHandler",
"(",
")",
"{",
"try",
"{",
"//forcing use of JNA to ensure AOT compilation",
"Platform",
".",
"getOSType",
"(",
")",
";",
"return",
"(",
"urlParser",
"... | Create socket according to options. In case of compilation ahead of time, will throw an error
if dependencies found, then use default socket implementation.
@return Socket | [
"Create",
"socket",
"according",
"to",
"options",
".",
"In",
"case",
"of",
"compilation",
"ahead",
"of",
"time",
"will",
"throw",
"an",
"error",
"if",
"dependencies",
"found",
"then",
"use",
"default",
"socket",
"implementation",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/socket/SocketUtility.java#L15-L45 |
52,561 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/thread/TerminableRunnable.java | TerminableRunnable.blockTillTerminated | public void blockTillTerminated() {
while (!runState.compareAndSet(State.IDLE, State.REMOVED)) {
// wait and retry
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(10));
if (Thread.currentThread().isInterrupted()) {
runState.set(State.REMOVED);
return;
}
}
} | java | public void blockTillTerminated() {
while (!runState.compareAndSet(State.IDLE, State.REMOVED)) {
// wait and retry
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(10));
if (Thread.currentThread().isInterrupted()) {
runState.set(State.REMOVED);
return;
}
}
} | [
"public",
"void",
"blockTillTerminated",
"(",
")",
"{",
"while",
"(",
"!",
"runState",
".",
"compareAndSet",
"(",
"State",
".",
"IDLE",
",",
"State",
".",
"REMOVED",
")",
")",
"{",
"// wait and retry",
"LockSupport",
".",
"parkNanos",
"(",
"TimeUnit",
".",
... | Unschedule next launched, and wait for the current task to complete before closing it. | [
"Unschedule",
"next",
"launched",
"and",
"wait",
"for",
"the",
"current",
"task",
"to",
"complete",
"before",
"closing",
"it",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/thread/TerminableRunnable.java#L94-L103 |
52,562 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/thread/TerminableRunnable.java | TerminableRunnable.unscheduleTask | public void unscheduleTask() {
if (unschedule.compareAndSet(false, true)) {
scheduledFuture.cancel(false);
scheduledFuture = null;
}
} | java | public void unscheduleTask() {
if (unschedule.compareAndSet(false, true)) {
scheduledFuture.cancel(false);
scheduledFuture = null;
}
} | [
"public",
"void",
"unscheduleTask",
"(",
")",
"{",
"if",
"(",
"unschedule",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"scheduledFuture",
".",
"cancel",
"(",
"false",
")",
";",
"scheduledFuture",
"=",
"null",
";",
"}",
"}"
] | Unschedule task if active, and cancel thread to inform it must be interrupted in a proper way. | [
"Unschedule",
"task",
"if",
"active",
"and",
"cancel",
"thread",
"to",
"inform",
"it",
"must",
"be",
"interrupted",
"in",
"a",
"proper",
"way",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/thread/TerminableRunnable.java#L112-L118 |
52,563 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/dao/CmdInformationSingle.java | CmdInformationSingle.getGeneratedKeys | public ResultSet getGeneratedKeys(Protocol protocol) {
if (insertId == 0) {
return SelectResultSet.createEmptyResultSet();
}
if (updateCount > 1) {
long[] insertIds = new long[(int) updateCount];
for (int i = 0; i < updateCount; i++) {
insertIds[i] = insertId + i * autoIncrement;
... | java | public ResultSet getGeneratedKeys(Protocol protocol) {
if (insertId == 0) {
return SelectResultSet.createEmptyResultSet();
}
if (updateCount > 1) {
long[] insertIds = new long[(int) updateCount];
for (int i = 0; i < updateCount; i++) {
insertIds[i] = insertId + i * autoIncrement;
... | [
"public",
"ResultSet",
"getGeneratedKeys",
"(",
"Protocol",
"protocol",
")",
"{",
"if",
"(",
"insertId",
"==",
"0",
")",
"{",
"return",
"SelectResultSet",
".",
"createEmptyResultSet",
"(",
")",
";",
"}",
"if",
"(",
"updateCount",
">",
"1",
")",
"{",
"long"... | Get generated Keys.
@param protocol current protocol
@return a resultSet containing the single insert ids. | [
"Get",
"generated",
"Keys",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/dao/CmdInformationSingle.java#L126-L140 |
52,564 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalBigDecimal | public BigDecimal getInternalBigDecimal(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case BIT:
return BigDecimal.valueOf(parseBit());
case TINYINT:
return BigDecimal.valueOf((long) getInt... | java | public BigDecimal getInternalBigDecimal(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case BIT:
return BigDecimal.valueOf(parseBit());
case TINYINT:
return BigDecimal.valueOf((long) getInt... | [
"public",
"BigDecimal",
"getInternalBigDecimal",
"(",
"ColumnInformation",
"columnInfo",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
"columnInfo",
".",
"getColumnType",
"(",
")... | Get BigDecimal from raw binary format.
@param columnInfo column information
@return BigDecimal value
@throws SQLException if column is not numeric | [
"Get",
"BigDecimal",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L668-L717 |
52,565 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalDate | @SuppressWarnings("deprecation")
public Date getInternalDate(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case TIMESTAMP:
case DATETIME:
Timestamp timestam... | java | @SuppressWarnings("deprecation")
public Date getInternalDate(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case TIMESTAMP:
case DATETIME:
Timestamp timestam... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"Date",
"getInternalDate",
"(",
"ColumnInformation",
"columnInfo",
",",
"Calendar",
"cal",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")"... | Get date from raw binary format.
@param columnInfo column information
@param cal calendar
@param timeZone time zone
@return date value
@throws SQLException if column is not compatible to Date | [
"Get",
"date",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L728-L790 |
52,566 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalTime | public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case TIMESTAMP:
case DATETIME:
Timestamp ts = getInternalTimestamp(columnInfo, cal, ... | java | public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case TIMESTAMP:
case DATETIME:
Timestamp ts = getInternalTimestamp(columnInfo, cal, ... | [
"public",
"Time",
"getInternalTime",
"(",
"ColumnInformation",
"columnInfo",
",",
"Calendar",
"cal",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
... | Get time from raw binary format.
@param columnInfo column information
@param cal calendar
@param timeZone time zone
@return Time value
@throws SQLException if column cannot be converted to Time | [
"Get",
"time",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L801-L851 |
52,567 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalObject | public Object getInternalObject(ColumnInformation columnInfo, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case BIT:
if (columnInfo.getLength() == 1) {
return buf[pos] != 0;
}
byte... | java | public Object getInternalObject(ColumnInformation columnInfo, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case BIT:
if (columnInfo.getLength() == 1) {
return buf[pos] != 0;
}
byte... | [
"public",
"Object",
"getInternalObject",
"(",
"ColumnInformation",
"columnInfo",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
"columnInfo",
".",
"... | Get Object from raw binary format.
@param columnInfo column information
@param timeZone time zone
@return Object value
@throws SQLException if column type is not compatible | [
"Get",
"Object",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L982-L1068 |
52,568 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalBoolean | public boolean getInternalBoolean(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return false;
}
switch (columnInfo.getColumnType()) {
case BIT:
return parseBit() != 0;
case TINYINT:
return getInternalTinyInt(columnInfo) != 0;
case SMALL... | java | public boolean getInternalBoolean(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return false;
}
switch (columnInfo.getColumnType()) {
case BIT:
return parseBit() != 0;
case TINYINT:
return getInternalTinyInt(columnInfo) != 0;
case SMALL... | [
"public",
"boolean",
"getInternalBoolean",
"(",
"ColumnInformation",
"columnInfo",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"switch",
"(",
"columnInfo",
".",
"getColumnType",
"(",
")",
... | Get boolean from raw binary format.
@param columnInfo column information
@return boolean value
@throws SQLException if column type doesn't permit conversion | [
"Get",
"boolean",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L1077-L1105 |
52,569 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalByte | public byte getInternalByte(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return 0;
}
long value;
switch (columnInfo.getColumnType()) {
case BIT:
value = parseBit();
break;
case TINYINT:
value = getInternalTinyInt(columnInfo);
... | java | public byte getInternalByte(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return 0;
}
long value;
switch (columnInfo.getColumnType()) {
case BIT:
value = parseBit();
break;
case TINYINT:
value = getInternalTinyInt(columnInfo);
... | [
"public",
"byte",
"getInternalByte",
"(",
"ColumnInformation",
"columnInfo",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"long",
"value",
";",
"switch",
"(",
"columnInfo",
".",
"getColumnType"... | Get byte from raw binary format.
@param columnInfo column information
@return byte value
@throws SQLException if column type doesn't permit conversion | [
"Get",
"byte",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L1114-L1160 |
52,570 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalTimeString | public String getInternalTimeString(ColumnInformation columnInfo) {
if (lastValueWasNull()) {
return null;
}
if (length == 0) {
// binary send 00:00:00 as 0.
if (columnInfo.getDecimals() == 0) {
return "00:00:00";
} else {
StringBuilder value = new StringBuilder("00:0... | java | public String getInternalTimeString(ColumnInformation columnInfo) {
if (lastValueWasNull()) {
return null;
}
if (length == 0) {
// binary send 00:00:00 as 0.
if (columnInfo.getDecimals() == 0) {
return "00:00:00";
} else {
StringBuilder value = new StringBuilder("00:0... | [
"public",
"String",
"getInternalTimeString",
"(",
"ColumnInformation",
"columnInfo",
")",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"// binary send 00:00:00 as 0.",
"if",
"(",
... | Get Time in string format from raw binary format.
@param columnInfo column information
@return time value | [
"Get",
"Time",
"in",
"string",
"format",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L1228-L1295 |
52,571 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalZonedDateTime | public ZonedDateTime getInternalZonedDateTime(ColumnInformation columnInfo, Class clazz,
TimeZone timeZone) throws SQLException {
if (lastValueWasNull()) {
return null;
}
if (length == 0) {
lastValueNull |= BIT_LAST_FIELD_NULL;
return null;
}
switch (columnInfo.getColumnType... | java | public ZonedDateTime getInternalZonedDateTime(ColumnInformation columnInfo, Class clazz,
TimeZone timeZone) throws SQLException {
if (lastValueWasNull()) {
return null;
}
if (length == 0) {
lastValueNull |= BIT_LAST_FIELD_NULL;
return null;
}
switch (columnInfo.getColumnType... | [
"public",
"ZonedDateTime",
"getInternalZonedDateTime",
"(",
"ColumnInformation",
"columnInfo",
",",
"Class",
"clazz",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
... | Get ZonedDateTime from raw binary format.
@param columnInfo column information
@param clazz asked class
@param timeZone time zone
@return ZonedDateTime value
@throws SQLException if column type doesn't permit conversion | [
"Get",
"ZonedDateTime",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L1367-L1427 |
52,572 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalLocalTime | public LocalTime getInternalLocalTime(ColumnInformation columnInfo, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
if (length == 0) {
lastValueNull |= BIT_LAST_FIELD_NULL;
return null;
}
switch (columnInfo.getColumnType().getSqlType()) {
... | java | public LocalTime getInternalLocalTime(ColumnInformation columnInfo, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
if (length == 0) {
lastValueNull |= BIT_LAST_FIELD_NULL;
return null;
}
switch (columnInfo.getColumnType().getSqlType()) {
... | [
"public",
"LocalTime",
"getInternalLocalTime",
"(",
"ColumnInformation",
"columnInfo",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"length",
"==",
"0... | Get LocalTime from raw binary format.
@param columnInfo column information
@param timeZone time zone
@return LocalTime value
@throws SQLException if column type doesn't permit conversion | [
"Get",
"LocalTime",
"from",
"raw",
"binary",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L1548-L1618 |
52,573 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pools.java | Pools.retrievePool | public static Pool retrievePool(UrlParser urlParser) {
if (!poolMap.containsKey(urlParser)) {
synchronized (poolMap) {
if (!poolMap.containsKey(urlParser)) {
if (poolExecutor == null) {
poolExecutor = new ScheduledThreadPoolExecutor(1,
new MariaDbThreadFactory("Ma... | java | public static Pool retrievePool(UrlParser urlParser) {
if (!poolMap.containsKey(urlParser)) {
synchronized (poolMap) {
if (!poolMap.containsKey(urlParser)) {
if (poolExecutor == null) {
poolExecutor = new ScheduledThreadPoolExecutor(1,
new MariaDbThreadFactory("Ma... | [
"public",
"static",
"Pool",
"retrievePool",
"(",
"UrlParser",
"urlParser",
")",
"{",
"if",
"(",
"!",
"poolMap",
".",
"containsKey",
"(",
"urlParser",
")",
")",
"{",
"synchronized",
"(",
"poolMap",
")",
"{",
"if",
"(",
"!",
"poolMap",
".",
"containsKey",
... | Get existing pool for a configuration. Create it if doesn't exists.
@param urlParser configuration parser
@return pool | [
"Get",
"existing",
"pool",
"for",
"a",
"configuration",
".",
"Create",
"it",
"if",
"doesn",
"t",
"exists",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pools.java#L45-L60 |
52,574 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pools.java | Pools.remove | public static void remove(Pool pool) {
if (poolMap.containsKey(pool.getUrlParser())) {
synchronized (poolMap) {
if (poolMap.containsKey(pool.getUrlParser())) {
poolMap.remove(pool.getUrlParser());
shutdownExecutor();
}
}
}
} | java | public static void remove(Pool pool) {
if (poolMap.containsKey(pool.getUrlParser())) {
synchronized (poolMap) {
if (poolMap.containsKey(pool.getUrlParser())) {
poolMap.remove(pool.getUrlParser());
shutdownExecutor();
}
}
}
} | [
"public",
"static",
"void",
"remove",
"(",
"Pool",
"pool",
")",
"{",
"if",
"(",
"poolMap",
".",
"containsKey",
"(",
"pool",
".",
"getUrlParser",
"(",
")",
")",
")",
"{",
"synchronized",
"(",
"poolMap",
")",
"{",
"if",
"(",
"poolMap",
".",
"containsKey"... | Remove pool.
@param pool pool to remove | [
"Remove",
"pool",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pools.java#L67-L76 |
52,575 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pools.java | Pools.close | public static void close() {
synchronized (poolMap) {
for (Pool pool : poolMap.values()) {
try {
pool.close();
} catch (InterruptedException exception) {
//eat
}
}
shutdownExecutor();
poolMap.clear();
}
} | java | public static void close() {
synchronized (poolMap) {
for (Pool pool : poolMap.values()) {
try {
pool.close();
} catch (InterruptedException exception) {
//eat
}
}
shutdownExecutor();
poolMap.clear();
}
} | [
"public",
"static",
"void",
"close",
"(",
")",
"{",
"synchronized",
"(",
"poolMap",
")",
"{",
"for",
"(",
"Pool",
"pool",
":",
"poolMap",
".",
"values",
"(",
")",
")",
"{",
"try",
"{",
"pool",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Inte... | Close all pools. | [
"Close",
"all",
"pools",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pools.java#L81-L93 |
52,576 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pools.java | Pools.close | public static void close(String poolName) {
if (poolName == null) {
return;
}
synchronized (poolMap) {
for (Pool pool : poolMap.values()) {
if (poolName.equals(pool.getUrlParser().getOptions().poolName)) {
try {
pool.close();
} catch (InterruptedException ... | java | public static void close(String poolName) {
if (poolName == null) {
return;
}
synchronized (poolMap) {
for (Pool pool : poolMap.values()) {
if (poolName.equals(pool.getUrlParser().getOptions().poolName)) {
try {
pool.close();
} catch (InterruptedException ... | [
"public",
"static",
"void",
"close",
"(",
"String",
"poolName",
")",
"{",
"if",
"(",
"poolName",
"==",
"null",
")",
"{",
"return",
";",
"}",
"synchronized",
"(",
"poolMap",
")",
"{",
"for",
"(",
"Pool",
"pool",
":",
"poolMap",
".",
"values",
"(",
")"... | Closing a pool with name defined in url.
@param poolName the option "poolName" value | [
"Closing",
"a",
"pool",
"with",
"name",
"defined",
"in",
"url",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pools.java#L100-L121 |
52,577 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/io/input/ReadAheadBufferedStream.java | ReadAheadBufferedStream.read | public synchronized int read(byte[] externalBuf, int off, int len) throws IOException {
if (len == 0) {
return 0;
}
int totalReads = 0;
while (true) {
//read
if (end - pos <= 0) {
if (len - totalReads >= buf.length) {
//buffer length is less than asked byte and buf... | java | public synchronized int read(byte[] externalBuf, int off, int len) throws IOException {
if (len == 0) {
return 0;
}
int totalReads = 0;
while (true) {
//read
if (end - pos <= 0) {
if (len - totalReads >= buf.length) {
//buffer length is less than asked byte and buf... | [
"public",
"synchronized",
"int",
"read",
"(",
"byte",
"[",
"]",
"externalBuf",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"len",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"int",
"totalReads",
"=",
"0",
"... | Returing byte array, from cache of reading socket if needed.
@param externalBuf buffer to fill
@param off offset
@param len length to read
@return number of added bytes
@throws IOException if exception during socket reading | [
"Returing",
"byte",
"array",
"from",
"cache",
"of",
"reading",
"socket",
"if",
"needed",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/input/ReadAheadBufferedStream.java#L80-L120 |
52,578 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/io/input/ReadAheadBufferedStream.java | ReadAheadBufferedStream.fillBuffer | private void fillBuffer(int minNeededBytes) throws IOException {
int lengthToReallyRead = Math.min(BUF_SIZE, Math.max(super.available(), minNeededBytes));
end = super.read(buf, 0, lengthToReallyRead);
pos = 0;
} | java | private void fillBuffer(int minNeededBytes) throws IOException {
int lengthToReallyRead = Math.min(BUF_SIZE, Math.max(super.available(), minNeededBytes));
end = super.read(buf, 0, lengthToReallyRead);
pos = 0;
} | [
"private",
"void",
"fillBuffer",
"(",
"int",
"minNeededBytes",
")",
"throws",
"IOException",
"{",
"int",
"lengthToReallyRead",
"=",
"Math",
".",
"min",
"(",
"BUF_SIZE",
",",
"Math",
".",
"max",
"(",
"super",
".",
"available",
"(",
")",
",",
"minNeededBytes",... | Fill buffer with required length, or available bytes.
@param minNeededBytes asked number of bytes
@throws IOException in case of failing reading stream. | [
"Fill",
"buffer",
"with",
"required",
"length",
"or",
"available",
"bytes",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/io/input/ReadAheadBufferedStream.java#L128-L132 |
52,579 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/protocol/tls/MariaDbX509TrustManager.java | MariaDbX509TrustManager.checkClientTrusted | @Override
public void checkClientTrusted(X509Certificate[] x509Certificates, String string)
throws CertificateException {
if (trustManager == null) {
return;
}
trustManager.checkClientTrusted(x509Certificates, string);
} | java | @Override
public void checkClientTrusted(X509Certificate[] x509Certificates, String string)
throws CertificateException {
if (trustManager == null) {
return;
}
trustManager.checkClientTrusted(x509Certificates, string);
} | [
"@",
"Override",
"public",
"void",
"checkClientTrusted",
"(",
"X509Certificate",
"[",
"]",
"x509Certificates",
",",
"String",
"string",
")",
"throws",
"CertificateException",
"{",
"if",
"(",
"trustManager",
"==",
"null",
")",
"{",
"return",
";",
"}",
"trustManag... | Check client trusted.
@param x509Certificates certificate
@param string string
@throws CertificateException exception | [
"Check",
"client",
"trusted",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/tls/MariaDbX509TrustManager.java#L203-L210 |
52,580 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java | Pool.addConnectionRequest | private void addConnectionRequest() {
if (totalConnection.get() < options.maxPoolSize && poolState.get() == POOL_STATE_OK) {
//ensure to have one worker if was timeout
connectionAppender.prestartCoreThread();
connectionAppenderQueue.offer(() -> {
if ((totalConnection.get() < options.minP... | java | private void addConnectionRequest() {
if (totalConnection.get() < options.maxPoolSize && poolState.get() == POOL_STATE_OK) {
//ensure to have one worker if was timeout
connectionAppender.prestartCoreThread();
connectionAppenderQueue.offer(() -> {
if ((totalConnection.get() < options.minP... | [
"private",
"void",
"addConnectionRequest",
"(",
")",
"{",
"if",
"(",
"totalConnection",
".",
"get",
"(",
")",
"<",
"options",
".",
"maxPoolSize",
"&&",
"poolState",
".",
"get",
"(",
")",
"==",
"POOL_STATE_OK",
")",
"{",
"//ensure to have one worker if was timeou... | Add new connection if needed. Only one thread create new connection, so new connection request
will wait to newly created connection or for a released connection. | [
"Add",
"new",
"connection",
"if",
"needed",
".",
"Only",
"one",
"thread",
"create",
"new",
"connection",
"so",
"new",
"connection",
"request",
"will",
"wait",
"to",
"newly",
"created",
"connection",
"or",
"for",
"a",
"released",
"connection",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java#L140-L157 |
52,581 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java | Pool.removeIdleTimeoutConnection | private void removeIdleTimeoutConnection() {
//descending iterator since first from queue are the first to be used
Iterator<MariaDbPooledConnection> iterator = idleConnections.descendingIterator();
MariaDbPooledConnection item;
while (iterator.hasNext()) {
item = iterator.next();
long id... | java | private void removeIdleTimeoutConnection() {
//descending iterator since first from queue are the first to be used
Iterator<MariaDbPooledConnection> iterator = idleConnections.descendingIterator();
MariaDbPooledConnection item;
while (iterator.hasNext()) {
item = iterator.next();
long id... | [
"private",
"void",
"removeIdleTimeoutConnection",
"(",
")",
"{",
"//descending iterator since first from queue are the first to be used",
"Iterator",
"<",
"MariaDbPooledConnection",
">",
"iterator",
"=",
"idleConnections",
".",
"descendingIterator",
"(",
")",
";",
"MariaDbPoole... | Removing idle connection.
Close them and recreate connection to reach minimal number of connection. | [
"Removing",
"idle",
"connection",
".",
"Close",
"them",
"and",
"recreate",
"connection",
"to",
"reach",
"minimal",
"number",
"of",
"connection",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java#L163-L208 |
52,582 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java | Pool.addConnection | private void addConnection() throws SQLException {
//create new connection
Protocol protocol = Utils.retrieveProxy(urlParser, globalInfo);
MariaDbConnection connection = new MariaDbConnection(protocol);
MariaDbPooledConnection pooledConnection = createPoolConnection(connection);
if (options.static... | java | private void addConnection() throws SQLException {
//create new connection
Protocol protocol = Utils.retrieveProxy(urlParser, globalInfo);
MariaDbConnection connection = new MariaDbConnection(protocol);
MariaDbPooledConnection pooledConnection = createPoolConnection(connection);
if (options.static... | [
"private",
"void",
"addConnection",
"(",
")",
"throws",
"SQLException",
"{",
"//create new connection",
"Protocol",
"protocol",
"=",
"Utils",
".",
"retrieveProxy",
"(",
"urlParser",
",",
"globalInfo",
")",
";",
"MariaDbConnection",
"connection",
"=",
"new",
"MariaDb... | Create new connection.
@throws SQLException if connection creation failed | [
"Create",
"new",
"connection",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java#L215-L246 |
52,583 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java | Pool.getIdleConnection | private MariaDbPooledConnection getIdleConnection(long timeout, TimeUnit timeUnit)
throws InterruptedException {
while (true) {
MariaDbPooledConnection item =
(timeout == 0) ? idleConnections.pollFirst() : idleConnections.pollFirst(timeout, timeUnit);
if (item != null) {
Ma... | java | private MariaDbPooledConnection getIdleConnection(long timeout, TimeUnit timeUnit)
throws InterruptedException {
while (true) {
MariaDbPooledConnection item =
(timeout == 0) ? idleConnections.pollFirst() : idleConnections.pollFirst(timeout, timeUnit);
if (item != null) {
Ma... | [
"private",
"MariaDbPooledConnection",
"getIdleConnection",
"(",
"long",
"timeout",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"InterruptedException",
"{",
"while",
"(",
"true",
")",
"{",
"MariaDbPooledConnection",
"item",
"=",
"(",
"timeout",
"==",
"0",
")",
"?",... | Get an existing idle connection in pool.
@return an IDLE connection. | [
"Get",
"an",
"existing",
"idle",
"connection",
"in",
"pool",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java#L257-L304 |
52,584 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java | Pool.getConnection | public MariaDbConnection getConnection(String username, String password) throws SQLException {
try {
if ((urlParser.getUsername() != null ? urlParser.getUsername().equals(username)
: username == null)
&& (urlParser.getPassword() != null ? urlParser.getPassword().equals(password)
... | java | public MariaDbConnection getConnection(String username, String password) throws SQLException {
try {
if ((urlParser.getUsername() != null ? urlParser.getUsername().equals(username)
: username == null)
&& (urlParser.getPassword() != null ? urlParser.getPassword().equals(password)
... | [
"public",
"MariaDbConnection",
"getConnection",
"(",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"if",
"(",
"(",
"urlParser",
".",
"getUsername",
"(",
")",
"!=",
"null",
"?",
"urlParser",
".",
"getUsername",... | Get new connection from pool if user and password correspond to pool. If username and password
are different from pool, will return a dedicated connection.
@param username username
@param password password
@return connection
@throws SQLException if any error occur during connection | [
"Get",
"new",
"connection",
"from",
"pool",
"if",
"user",
"and",
"password",
"correspond",
"to",
"pool",
".",
"If",
"username",
"and",
"password",
"are",
"different",
"from",
"pool",
"will",
"return",
"a",
"dedicated",
"connection",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java#L425-L447 |
52,585 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java | Pool.close | public void close() throws InterruptedException {
synchronized (this) {
Pools.remove(this);
poolState.set(POOL_STATE_CLOSING);
pendingRequestNumber.set(0);
scheduledFuture.cancel(false);
connectionAppender.shutdown();
try {
connectionAppender.awaitTermination(10, TimeUn... | java | public void close() throws InterruptedException {
synchronized (this) {
Pools.remove(this);
poolState.set(POOL_STATE_CLOSING);
pendingRequestNumber.set(0);
scheduledFuture.cancel(false);
connectionAppender.shutdown();
try {
connectionAppender.awaitTermination(10, TimeUn... | [
"public",
"void",
"close",
"(",
")",
"throws",
"InterruptedException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Pools",
".",
"remove",
"(",
"this",
")",
";",
"poolState",
".",
"set",
"(",
"POOL_STATE_CLOSING",
")",
";",
"pendingRequestNumber",
".",
"set"... | Close pool and underlying connections.
@throws InterruptedException if interrupted | [
"Close",
"pool",
"and",
"underlying",
"connections",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/util/pool/Pool.java#L465-L513 |
52,586 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java | AbstractMastersListener.addToBlacklist | public void addToBlacklist(HostAddress hostAddress) {
if (hostAddress != null && !isExplicitClosed()) {
blacklist.putIfAbsent(hostAddress, System.nanoTime());
}
} | java | public void addToBlacklist(HostAddress hostAddress) {
if (hostAddress != null && !isExplicitClosed()) {
blacklist.putIfAbsent(hostAddress, System.nanoTime());
}
} | [
"public",
"void",
"addToBlacklist",
"(",
"HostAddress",
"hostAddress",
")",
"{",
"if",
"(",
"hostAddress",
"!=",
"null",
"&&",
"!",
"isExplicitClosed",
"(",
")",
")",
"{",
"blacklist",
".",
"putIfAbsent",
"(",
"hostAddress",
",",
"System",
".",
"nanoTime",
"... | After a failover, put the hostAddress in a static list so the other connection will not take
this host in account for a time.
@param hostAddress the HostAddress to add to blacklist | [
"After",
"a",
"failover",
"put",
"the",
"hostAddress",
"in",
"a",
"static",
"list",
"so",
"the",
"other",
"connection",
"will",
"not",
"take",
"this",
"host",
"in",
"account",
"for",
"a",
"time",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java#L212-L216 |
52,587 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java | AbstractMastersListener.resetOldsBlackListHosts | public void resetOldsBlackListHosts() {
long currentTimeNanos = System.nanoTime();
Set<Map.Entry<HostAddress, Long>> entries = blacklist.entrySet();
for (Map.Entry<HostAddress, Long> blEntry : entries) {
long entryNanos = blEntry.getValue();
long durationSeconds = TimeUnit.NANOSECONDS.toSeconds(... | java | public void resetOldsBlackListHosts() {
long currentTimeNanos = System.nanoTime();
Set<Map.Entry<HostAddress, Long>> entries = blacklist.entrySet();
for (Map.Entry<HostAddress, Long> blEntry : entries) {
long entryNanos = blEntry.getValue();
long durationSeconds = TimeUnit.NANOSECONDS.toSeconds(... | [
"public",
"void",
"resetOldsBlackListHosts",
"(",
")",
"{",
"long",
"currentTimeNanos",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"Set",
"<",
"Map",
".",
"Entry",
"<",
"HostAddress",
",",
"Long",
">",
">",
"entries",
"=",
"blacklist",
".",
"entrySet",... | Permit to remove Host to blacklist after loadBalanceBlacklistTimeout seconds. | [
"Permit",
"to",
"remove",
"Host",
"to",
"blacklist",
"after",
"loadBalanceBlacklistTimeout",
"seconds",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java#L232-L242 |
52,588 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java | AbstractMastersListener.setMasterHostFail | public boolean setMasterHostFail() {
if (masterHostFail.compareAndSet(false, true)) {
masterHostFailNanos = System.nanoTime();
currentConnectionAttempts.set(0);
return true;
}
return false;
} | java | public boolean setMasterHostFail() {
if (masterHostFail.compareAndSet(false, true)) {
masterHostFailNanos = System.nanoTime();
currentConnectionAttempts.set(0);
return true;
}
return false;
} | [
"public",
"boolean",
"setMasterHostFail",
"(",
")",
"{",
"if",
"(",
"masterHostFail",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"masterHostFailNanos",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"currentConnectionAttempts",
".",
"set",... | Set master fail variables.
@return true if was already failed | [
"Set",
"master",
"fail",
"variables",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java#L275-L282 |
52,589 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java | AbstractMastersListener.relaunchOperation | public HandleErrorResult relaunchOperation(Method method, Object[] args)
throws IllegalAccessException, InvocationTargetException {
HandleErrorResult handleErrorResult = new HandleErrorResult(true);
if (method != null) {
switch (method.getName()) {
case "executeQuery":
if (args[2]... | java | public HandleErrorResult relaunchOperation(Method method, Object[] args)
throws IllegalAccessException, InvocationTargetException {
HandleErrorResult handleErrorResult = new HandleErrorResult(true);
if (method != null) {
switch (method.getName()) {
case "executeQuery":
if (args[2]... | [
"public",
"HandleErrorResult",
"relaunchOperation",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"HandleErrorResult",
"handleErrorResult",
"=",
"new",
"HandleErrorResult",
"(",
... | After a failover that has bean done, relaunch the operation that was in progress. In case of
special operation that crash server, doesn't relaunched it;
@param method the methode accessed
@param args the parameters
@return An object that indicate the result or that the exception as to be thrown
@throws IllegalAccess... | [
"After",
"a",
"failover",
"that",
"has",
"bean",
"done",
"relaunch",
"the",
"operation",
"that",
"was",
"in",
"progress",
".",
"In",
"case",
"of",
"special",
"operation",
"that",
"crash",
"server",
"doesn",
"t",
"relaunched",
"it",
";"
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java#L306-L351 |
52,590 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java | AbstractMastersListener.isQueryRelaunchable | public boolean isQueryRelaunchable(Method method, Object[] args) {
if (method != null) {
switch (method.getName()) {
case "executeQuery":
if (!((Boolean) args[0])) {
return true; //launched on slave connection
}
if (args[2] instanceof String) {
ret... | java | public boolean isQueryRelaunchable(Method method, Object[] args) {
if (method != null) {
switch (method.getName()) {
case "executeQuery":
if (!((Boolean) args[0])) {
return true; //launched on slave connection
}
if (args[2] instanceof String) {
ret... | [
"public",
"boolean",
"isQueryRelaunchable",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"method",
"!=",
"null",
")",
"{",
"switch",
"(",
"method",
".",
"getName",
"(",
")",
")",
"{",
"case",
"\"executeQuery\"",
":",
"... | Check if query can be re-executed.
@param method invoke method
@param args invoke arguments
@return true if can be re-executed | [
"Check",
"if",
"query",
"can",
"be",
"re",
"-",
"executed",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java#L360-L391 |
52,591 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java | AbstractMastersListener.syncConnection | public void syncConnection(Protocol from, Protocol to) throws SQLException {
if (from != null) {
proxy.lock.lock();
try {
to.resetStateAfterFailover(from.getMaxRows(), from.getTransactionIsolationLevel(),
from.getDatabase(), from.getAutocommit());
} finally {
proxy.lo... | java | public void syncConnection(Protocol from, Protocol to) throws SQLException {
if (from != null) {
proxy.lock.lock();
try {
to.resetStateAfterFailover(from.getMaxRows(), from.getTransactionIsolationLevel(),
from.getDatabase(), from.getAutocommit());
} finally {
proxy.lo... | [
"public",
"void",
"syncConnection",
"(",
"Protocol",
"from",
",",
"Protocol",
"to",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"from",
"!=",
"null",
")",
"{",
"proxy",
".",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"to",
".",
"resetStateAfter... | When switching between 2 connections, report existing connection parameter to the new used
connection.
@param from used connection
@param to will-be-current connection
@throws SQLException if catalog cannot be set | [
"When",
"switching",
"between",
"2",
"connections",
"report",
"existing",
"connection",
"parameter",
"to",
"the",
"new",
"used",
"connection",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java#L409-L422 |
52,592 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java | AbstractMastersListener.throwFailoverMessage | @Override
public void throwFailoverMessage(HostAddress failHostAddress, boolean wasMaster,
SQLException queryException,
boolean reconnected) throws SQLException {
String firstPart = "Communications link failure with "
+ (wasMaster ? "primary" : "secondary")
+ ((failHostAddress != null)... | java | @Override
public void throwFailoverMessage(HostAddress failHostAddress, boolean wasMaster,
SQLException queryException,
boolean reconnected) throws SQLException {
String firstPart = "Communications link failure with "
+ (wasMaster ? "primary" : "secondary")
+ ((failHostAddress != null)... | [
"@",
"Override",
"public",
"void",
"throwFailoverMessage",
"(",
"HostAddress",
"failHostAddress",
",",
"boolean",
"wasMaster",
",",
"SQLException",
"queryException",
",",
"boolean",
"reconnected",
")",
"throws",
"SQLException",
"{",
"String",
"firstPart",
"=",
"\"Comm... | Throw a human readable message after a failoverException.
@param failHostAddress failedHostAddress
@param wasMaster was failed connection master
@param queryException internal error
@param reconnected connection status
@throws SQLException error with failover information | [
"Throw",
"a",
"human",
"readable",
"message",
"after",
"a",
"failoverException",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/failover/AbstractMastersListener.java#L496-L540 |
52,593 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java | TextRowProtocol.getInternalString | public String getInternalString(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case BIT:
return String.valueOf(parseBit());
case DOUBLE:
case FLOAT:
... | java | public String getInternalString(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case BIT:
return String.valueOf(parseBit());
case DOUBLE:
case FLOAT:
... | [
"public",
"String",
"getInternalString",
"(",
"ColumnInformation",
"columnInfo",
",",
"Calendar",
"cal",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"... | Get String from raw text format.
@param columnInfo column information
@param cal calendar
@param timeZone time zone
@return String value
@throws SQLException if column type doesn't permit conversion | [
"Get",
"String",
"from",
"raw",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L186-L244 |
52,594 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java | TextRowProtocol.getInternalInt | public int getInternalInt(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return 0;
}
long value = getInternalLong(columnInfo);
rangeCheck(Integer.class, Integer.MIN_VALUE, Integer.MAX_VALUE, value, columnInfo);
return (int) value;
} | java | public int getInternalInt(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return 0;
}
long value = getInternalLong(columnInfo);
rangeCheck(Integer.class, Integer.MIN_VALUE, Integer.MAX_VALUE, value, columnInfo);
return (int) value;
} | [
"public",
"int",
"getInternalInt",
"(",
"ColumnInformation",
"columnInfo",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"long",
"value",
"=",
"getInternalLong",
"(",
"columnInfo",
")",
";",
"... | Get int from raw text format.
@param columnInfo column information
@return int value
@throws SQLException if column type doesn't permit conversion or not in Integer range | [
"Get",
"int",
"from",
"raw",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L253-L260 |
52,595 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java | TextRowProtocol.getInternalFloat | public float getInternalFloat(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return 0;
}
switch (columnInfo.getColumnType()) {
case BIT:
return parseBit();
case TINYINT:
case SMALLINT:
case YEAR:
case INTEGER:
case MEDIUMINT:
... | java | public float getInternalFloat(ColumnInformation columnInfo) throws SQLException {
if (lastValueWasNull()) {
return 0;
}
switch (columnInfo.getColumnType()) {
case BIT:
return parseBit();
case TINYINT:
case SMALLINT:
case YEAR:
case INTEGER:
case MEDIUMINT:
... | [
"public",
"float",
"getInternalFloat",
"(",
"ColumnInformation",
"columnInfo",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"switch",
"(",
"columnInfo",
".",
"getColumnType",
"(",
")",
")",
"... | Get float from raw text format.
@param columnInfo column information
@return float value
@throws SQLException if column type doesn't permit conversion or not in Float range | [
"Get",
"float",
"from",
"raw",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L350-L387 |
52,596 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java | TextRowProtocol.getInternalBigDecimal | public BigDecimal getInternalBigDecimal(ColumnInformation columnInfo) {
if (lastValueWasNull()) {
return null;
}
if (columnInfo.getColumnType() == ColumnType.BIT) {
return BigDecimal.valueOf(parseBit());
}
return new BigDecimal(new String(buf, pos, length, StandardCharsets.UTF_8));
} | java | public BigDecimal getInternalBigDecimal(ColumnInformation columnInfo) {
if (lastValueWasNull()) {
return null;
}
if (columnInfo.getColumnType() == ColumnType.BIT) {
return BigDecimal.valueOf(parseBit());
}
return new BigDecimal(new String(buf, pos, length, StandardCharsets.UTF_8));
} | [
"public",
"BigDecimal",
"getInternalBigDecimal",
"(",
"ColumnInformation",
"columnInfo",
")",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"columnInfo",
".",
"getColumnType",
"(",
")",
"==",
"ColumnType",
".",
... | Get BigDecimal from raw text format.
@param columnInfo column information
@return BigDecimal value | [
"Get",
"BigDecimal",
"from",
"raw",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L442-L451 |
52,597 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java | TextRowProtocol.getInternalDate | @SuppressWarnings("deprecation")
public Date getInternalDate(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case DATE:
int[] datePart = new int[]{0,0,0};
... | java | @SuppressWarnings("deprecation")
public Date getInternalDate(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case DATE:
int[] datePart = new int[]{0,0,0};
... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"Date",
"getInternalDate",
"(",
"ColumnInformation",
"columnInfo",
",",
"Calendar",
"cal",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")"... | Get date from raw text format.
@param columnInfo column information
@param cal calendar
@param timeZone time zone
@return date value
@throws SQLException if column type doesn't permit conversion | [
"Get",
"date",
"from",
"raw",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L462-L534 |
52,598 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java | TextRowProtocol.getInternalTime | public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
if (columnInfo.getColumnType() == ColumnType.TIMESTAMP
|| columnInfo.getColumnType() == ColumnType.DATETIME) {
Timestamp timest... | java | public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
if (columnInfo.getColumnType() == ColumnType.TIMESTAMP
|| columnInfo.getColumnType() == ColumnType.DATETIME) {
Timestamp timest... | [
"public",
"Time",
"getInternalTime",
"(",
"ColumnInformation",
"columnInfo",
",",
"Calendar",
"cal",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"c... | Get time from raw text format.
@param columnInfo column information
@param cal calendar
@param timeZone time zone
@return time value
@throws SQLException if column type doesn't permit conversion | [
"Get",
"time",
"from",
"raw",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L545-L591 |
52,599 | MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java | TextRowProtocol.getInternalBoolean | public boolean getInternalBoolean(ColumnInformation columnInfo) {
if (lastValueWasNull()) {
return false;
}
if (columnInfo.getColumnType() == ColumnType.BIT) {
return parseBit() != 0;
}
final String rawVal = new String(buf, pos, length, StandardCharsets.UTF_8);
return !("false".equa... | java | public boolean getInternalBoolean(ColumnInformation columnInfo) {
if (lastValueWasNull()) {
return false;
}
if (columnInfo.getColumnType() == ColumnType.BIT) {
return parseBit() != 0;
}
final String rawVal = new String(buf, pos, length, StandardCharsets.UTF_8);
return !("false".equa... | [
"public",
"boolean",
"getInternalBoolean",
"(",
"ColumnInformation",
"columnInfo",
")",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"columnInfo",
".",
"getColumnType",
"(",
")",
"==",
"ColumnType",
".",
"BI... | Get boolean from raw text format.
@param columnInfo column information
@return boolean value | [
"Get",
"boolean",
"from",
"raw",
"text",
"format",
"."
] | d148c7cd347c4680617be65d9e511b289d38a30b | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/TextRowProtocol.java#L797-L807 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.