-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v3.x] Migrate genepi-libs and optimize job list (#101)
* Move all database classes from genepi-db to cloudgene * Migrate logging of db-utils to slf4j * Remove unused dependency to jakarta.annotation-api * Optimize job list
- Loading branch information
Showing
44 changed files
with
1,513 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
src/main/java/cloudgene/mapred/database/util/AbstractDatabaseConnector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package cloudgene.mapred.database.util; | ||
|
||
import org.apache.commons.dbcp.BasicDataSource; | ||
|
||
public abstract class AbstractDatabaseConnector implements DatabaseConnector { | ||
|
||
private int maxActive = 10; | ||
|
||
private int maxWait = 10000; | ||
|
||
private boolean defaultAutoCommit = true; | ||
|
||
private boolean testWhileIdle = true; | ||
|
||
private int minEvictableIdleTimeMillis = 1800000; | ||
|
||
private int timeBetweenEvictionRunsMillis = 1800000; | ||
|
||
protected BasicDataSource createDataSource() { | ||
|
||
BasicDataSource dataSource = new BasicDataSource(); | ||
dataSource.setMaxActive(maxActive); | ||
dataSource.setMaxWait(maxWait); | ||
dataSource.setMaxIdle(maxActive); | ||
dataSource.setDefaultAutoCommit(defaultAutoCommit); | ||
dataSource.setTestWhileIdle(testWhileIdle); | ||
dataSource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); | ||
dataSource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); | ||
return dataSource; | ||
|
||
} | ||
|
||
public int getMaxActive() { | ||
return maxActive; | ||
} | ||
|
||
public void setMaxActive(int maxActive) { | ||
this.maxActive = maxActive; | ||
} | ||
|
||
public int getMaxWait() { | ||
return maxWait; | ||
} | ||
|
||
public void setMaxWait(int maxWait) { | ||
this.maxWait = maxWait; | ||
} | ||
|
||
public boolean isDefaultAutoCommit() { | ||
return defaultAutoCommit; | ||
} | ||
|
||
public void setDefaultAutoCommit(boolean defaultAutoCommit) { | ||
this.defaultAutoCommit = defaultAutoCommit; | ||
} | ||
|
||
public boolean isTestWhileIdle() { | ||
return testWhileIdle; | ||
} | ||
|
||
public void setTestWhileIdle(boolean testWhileIdle) { | ||
this.testWhileIdle = testWhileIdle; | ||
} | ||
|
||
public int getMinEvictableIdleTimeMillis() { | ||
return minEvictableIdleTimeMillis; | ||
} | ||
|
||
public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) { | ||
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; | ||
} | ||
|
||
public int getTimeBetweenEvictionRunsMillis() { | ||
return timeBetweenEvictionRunsMillis; | ||
} | ||
|
||
public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) { | ||
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; | ||
} | ||
|
||
} |
Oops, something went wrong.