Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-storage YCSB benchmark for SEATA #63

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add options for connection pool settings
  • Loading branch information
jnmt committed Jun 1, 2022
commit fe4dae5ff9d8e728ab9fb26ecc1edb4c73fcbc49
4 changes: 4 additions & 0 deletions seata-test/multi-storage-ycsb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
username = "root"
password = "root"
driver = "com.mysql.jdbc.Driver"
min_idle = 200
max_active = 500

[secondary_db_config]
url = "jdbc:mysql://localhost:13306/seata?useSSL=false&serverTimezone=UTC"
username = "root"
password = "root"
driver = "com.mysql.jdbc.Driver"
min_idle = 200
max_active = 500
10 changes: 7 additions & 3 deletions seata-test/src/main/java/kelpie/seata/DataSourceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ public Connection getConnectionXA() throws SQLException {

private DataSource getDataSourceXA(String table) {
String url = config.getUserString(table, "url", "jdbc:mysql://localhost/seata");
String username = config.getUserString(table, "username", "cassandra");
String password = config.getUserString(table, "password", "cassandra");
String driver = config.getUserString(table, "isolation_level", "com.mysql.jdbc.Driver");
String username = config.getUserString(table, "username", "root");
String password = config.getUserString(table, "password", "example");
String driver = config.getUserString(table, "driver", "com.mysql.jdbc.Driver");
int minIdle = (int)config.getUserLong(table, "min_idle", (long)0);
int maxActive = (int)config.getUserLong(table, "max_active", (long)8);

DataSource dataSource = new DruidDataSource();
((DruidDataSource)dataSource).setUrl(url);
((DruidDataSource)dataSource).setUsername(username);
((DruidDataSource)dataSource).setPassword(password);
((DruidDataSource)dataSource).setDriverClassName(driver);
((DruidDataSource)dataSource).setMinIdle(minIdle);
((DruidDataSource)dataSource).setMaxActive(maxActive);
return new DataSourceProxyXA(dataSource);
}
}