Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix proxies

  • Loading branch information...
commit 386a1503b862c50a1d084a17467032ab00a142f4 1 parent 11dee94
@freels freels authored
View
12 src/main/scala/com/twitter/querulous/database/AutoDisablingDatabase.scala
@@ -6,12 +6,12 @@ import java.sql.{Connection, SQLException, SQLIntegrityConstraintViolationExcept
class AutoDisablingDatabaseFactory(databaseFactory: DatabaseFactory, disableErrorCount: Int, disableDuration: Duration) extends DatabaseFactory {
- def apply(dbhosts: List[String], dbname: String, username: String, password: String) = {
- new AutoDisablingDatabase(databaseFactory(dbhosts, dbname, username, password), dbhosts.first, disableErrorCount, disableDuration)
- }
-
- def apply(dbhosts: List[String], username: String, password: String) = {
- new AutoDisablingDatabase(databaseFactory(dbhosts, username, password), dbhosts.first, disableErrorCount, disableDuration)
+ def apply(dbhosts: List[String], dbname: String, username: String, password: String, urlOptions: String) = {
+ new AutoDisablingDatabase(
+ databaseFactory(dbhosts, dbname, username, password, urlOptions),
+ dbhosts.first,
+ disableErrorCount,
+ disableDuration)
}
}
View
7 src/main/scala/com/twitter/querulous/database/MemoizingDatabase.scala
@@ -5,11 +5,12 @@ import scala.collection.mutable
class MemoizingDatabaseFactory(databaseFactory: DatabaseFactory) extends DatabaseFactory {
private val databases = new mutable.HashMap[String, Database] with mutable.SynchronizedMap[String, Database]
- def apply(dbhosts: List[String], dbname: String, username: String, password: String) = synchronized {
+ def apply(dbhosts: List[String], dbname: String, username: String, password: String, urlOptions: String) = synchronized {
databases.getOrElseUpdate(
dbhosts.first + "/" + dbname,
- databaseFactory(dbhosts, dbname, username, password))
+ databaseFactory(dbhosts, dbname, username, password, urlOptions))
}
- def apply(dbhosts: List[String], username: String, password: String) = databaseFactory(dbhosts, username, password)
+ // cannot memoize a connection without specifying a database
+ override def apply(dbhosts: List[String], username: String, password: String) = databaseFactory(dbhosts, username, password)
}
View
8 src/main/scala/com/twitter/querulous/database/StatsCollectingDatabase.scala
@@ -6,12 +6,8 @@ class StatsCollectingDatabaseFactory(
databaseFactory: DatabaseFactory,
stats: StatsCollector) extends DatabaseFactory {
- def apply(dbhosts: List[String], dbname: String, username: String, password: String) = {
- new StatsCollectingDatabase(databaseFactory(dbhosts, dbname, username, password), stats)
- }
-
- def apply(dbhosts: List[String], username: String, password: String) = {
- new StatsCollectingDatabase(databaseFactory(dbhosts, username, password), stats)
+ def apply(dbhosts: List[String], dbname: String, username: String, password: String, urlOptions: String) = {
+ new StatsCollectingDatabase(databaseFactory(dbhosts, dbname, username, password, urlOptions), stats)
}
}
View
6 src/main/scala/com/twitter/querulous/database/TimingOutDatabase.scala
@@ -9,11 +9,11 @@ import net.lag.logging.Logger
class SqlDatabaseTimeoutException(msg: String) extends SQLException(msg)
class TimingOutDatabaseFactory(databaseFactory: DatabaseFactory, poolSize: Int, queueSize: Int, openTimeout: Duration, initialTimeout: Duration, maxConnections: Int) extends DatabaseFactory {
- def apply(dbhosts: List[String], dbname: String, username: String, password: String) = {
- new TimingOutDatabase(databaseFactory(dbhosts, dbname, username, password), dbhosts, dbname, poolSize, queueSize, openTimeout, initialTimeout, maxConnections)
+ def apply(dbhosts: List[String], dbname: String, username: String, password: String, urlOptions: String) = {
+ new TimingOutDatabase(databaseFactory(dbhosts, dbname, username, password, urlOptions), dbhosts, dbname, poolSize, queueSize, openTimeout, initialTimeout, maxConnections)
}
- def apply(dbhosts: List[String], username: String, password: String) = {
+ override def apply(dbhosts: List[String], username: String, password: String) = {
new TimingOutDatabase(databaseFactory(dbhosts, username, password), dbhosts, "(null)", poolSize, queueSize, openTimeout, initialTimeout, maxConnections)
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.