public final class FederationStateStoreUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FEDERATION_STORE_URL |
static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
static void |
logAndThrowException(org.slf4j.Logger log,
String errMsg,
Throwable t)
Throws an exception due to an error in
FederationStateStore . |
static void |
logAndThrowInvalidInputException(org.slf4j.Logger log,
String errMsg)
Throws an
FederationStateStoreInvalidInputException due to an
error in FederationStateStore . |
static void |
logAndThrowRetriableException(org.slf4j.Logger log,
String errMsg,
Throwable t)
Throws an
FederationStateStoreRetriableException due to an
error in FederationStateStore . |
static void |
logAndThrowStoreException(org.slf4j.Logger log,
String errMsg)
Throws an
FederationStateStoreException due to an error in
FederationStateStore . |
static void |
returnToPool(org.slf4j.Logger log,
CallableStatement cstmt,
Connection conn)
Returns the SQL
FederationStateStore connections to the pool. |
static void |
returnToPool(org.slf4j.Logger log,
CallableStatement cstmt,
Connection conn,
ResultSet rs)
Returns the SQL
FederationStateStore connections to the pool. |
static void |
setPassword(com.zaxxer.hikari.HikariDataSource dataSource,
String password)
Sets a specific password for
HikariDataSource SQL connections. |
static void |
setProperty(com.zaxxer.hikari.HikariDataSource dataSource,
String property,
String value)
Sets a specific value for a specific property of
HikariDataSource SQL connections. |
static void |
setUsername(com.zaxxer.hikari.HikariDataSource dataSource,
String userNameDB)
Sets a specific username for
HikariDataSource SQL connections. |
public static final org.slf4j.Logger LOG
public static final String FEDERATION_STORE_URL
public static void returnToPool(org.slf4j.Logger log, CallableStatement cstmt, Connection conn, ResultSet rs) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationStateStore
connections to the pool.log
- the logger interfacecstmt
- the interface used to execute SQL stored proceduresconn
- the SQL connectionrs
- the ResultSet interface used to execute SQL stored proceduresorg.apache.hadoop.yarn.exceptions.YarnException
- on failurepublic static void returnToPool(org.slf4j.Logger log, CallableStatement cstmt, Connection conn) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationStateStore
connections to the pool.log
- the logger interfacecstmt
- the interface used to execute SQL stored proceduresconn
- the SQL connectionorg.apache.hadoop.yarn.exceptions.YarnException
- on failurepublic static void logAndThrowException(org.slf4j.Logger log, String errMsg, Throwable t) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationStateStore
.log
- the logger interfaceerrMsg
- the error messaget
- the throwable raised in the called class.org.apache.hadoop.yarn.exceptions.YarnException
- on failurepublic static void logAndThrowStoreException(org.slf4j.Logger log, String errMsg) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationStateStoreException
due to an error in
FederationStateStore
.log
- the logger interfaceerrMsg
- the error messageorg.apache.hadoop.yarn.exceptions.YarnException
- on failurepublic static void logAndThrowInvalidInputException(org.slf4j.Logger log, String errMsg) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationStateStoreInvalidInputException
due to an
error in FederationStateStore
.log
- the logger interfaceerrMsg
- the error messageorg.apache.hadoop.yarn.exceptions.YarnException
- on failurepublic static void logAndThrowRetriableException(org.slf4j.Logger log, String errMsg, Throwable t) throws org.apache.hadoop.yarn.exceptions.YarnException
FederationStateStoreRetriableException
due to an
error in FederationStateStore
.log
- the logger interfaceerrMsg
- the error messaget
- the throwable raised in the called class.org.apache.hadoop.yarn.exceptions.YarnException
- on failurepublic static void setProperty(com.zaxxer.hikari.HikariDataSource dataSource, String property, String value)
HikariDataSource
SQL connections.dataSource
- the HikariDataSource
connectionsproperty
- the property to setvalue
- the value to setpublic static void setUsername(com.zaxxer.hikari.HikariDataSource dataSource, String userNameDB)
HikariDataSource
SQL connections.dataSource
- the HikariDataSource
connectionsuserNameDB
- the value to setpublic static void setPassword(com.zaxxer.hikari.HikariDataSource dataSource, String password)
HikariDataSource
SQL connections.dataSource
- the HikariDataSource
connectionspassword
- the value to setCopyright © 2008–2023 Apache Software Foundation. All rights reserved.