Class DatabaseProduct
java.lang.Object
org.apache.hadoop.yarn.server.federation.store.sql.DatabaseProduct
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddForUpdateClause(DatabaseProduct.DbType dbType, String selectStatement) We add for update to SQL according to different database types.static DatabaseProduct.DbTypegetDbType(Connection conn) static booleanisDuplicateKeyError(DatabaseProduct.DbType dbType, SQLException ex)
-
Method Details
-
getDbType
- Throws:
SQLException
-
addForUpdateClause
public static String addForUpdateClause(DatabaseProduct.DbType dbType, String selectStatement) throws SQLException We add for update to SQL according to different database types. This statement can ensure that a row of records in the database is only updated by one thread.- Parameters:
dbType- type of database.selectStatement- querySQL.- Returns:
- SQL after adding for update.
- Throws:
SQLException- SQL exception.
-
isDuplicateKeyError
-