[
https://issues.apache.org/jira/browse/YARN-6526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17107298#comment-17107298
]
Brahma Reddy Battula commented on YARN-6526:
--------------------------------------------
Patch lgtm. apart from the following doubt which i have.
Only I can see incrmenting the connection.
|991|FederationStateStoreClientMetrics.incrConnections();|
dn't we need to decrease it while closing the connection in the following
code..?
{code:java}
/**
* Returns the SQL <code>FederationStateStore</code> connections to the pool.
*
* @param log the logger interface
* @param cstmt the interface used to execute SQL stored procedures
* @param conn the SQL connection
* @param rs the ResultSet interface used to execute SQL stored procedures
* @throws YarnException on failure
*/
public static void returnToPool(Logger log, CallableStatement cstmt,
Connection conn, ResultSet rs) throws YarnException {
if (cstmt != null) {
try {
cstmt.close();
} catch (SQLException e) {
logAndThrowException(log, "Exception while trying to close Statement",
e);
}
}
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
logAndThrowException(log, "Exception while trying to close Connection",
e);
}
}
{code}
> Refactoring SQLFederationStateStore by avoiding to recreate a connection at
> every call
> --------------------------------------------------------------------------------------
>
> Key: YARN-6526
> URL: https://issues.apache.org/jira/browse/YARN-6526
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: federation
> Reporter: Giovanni Matteo Fumarola
> Assignee: Bilwa S T
> Priority: Major
> Fix For: 3.4.0
>
> Attachments: YARN-6526.001.patch, YARN-6526.002.patch,
> YARN-6526.003.patch, YARN-6526.004.patch, YARN-6526.005.patch,
> YARN-6526.006.patch, YARN-6526.007.patch
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]