Permalink
Browse files

cassandra 1.1.0

  • Loading branch information...
1 parent 259ac9d commit 3522ca3cef60ba654aed04724fca960480ad39a3 @Shimi committed May 5, 2012
View
@@ -30,5 +30,6 @@ Download and install "sbt":https://github.com/harrah/xsbt, then run:
h2. Project Status
-master: Cassandra 1.0.x
+master: Cassandra 1.1.x
+branch 1.0.0: Cassandra 1.0.x
branch 0.8: Cassandra 0.8.x
View
@@ -4,16 +4,16 @@ version := "1.3-SNAPSHOT"
organization := "com.shorrockin"
-scalaVersion := "2.9.1"
+scalaVersion := "2.9.2"
compileOrder := CompileOrder.JavaThenScala
libraryDependencies ++= Seq(
- "org.apache.cassandra" % "cassandra-all" % "1.0.9",
- "org.apache.cassandra" % "cassandra-thrift" % "1.0.9",
+ "org.apache.cassandra" % "cassandra-all" % "1.1.0",
+ "org.apache.cassandra" % "cassandra-thrift" % "1.1.0",
"com.eaio.uuid" % "uuid" % "3.2",
- "org.slf4j" % "slf4j-api" % "1.6.1",
- "commons-pool" % "commons-pool" % "1.5.4",
+ "org.slf4j" % "slf4j-api" % "1.6.4",
+ "commons-pool" % "commons-pool" % "1.6",
"junit" % "junit" % "4.10" % "test"
)
@@ -114,14 +114,14 @@ class SessionPool(val hosts:Seq[Host], val params:PoolParams, val defaultConsist
/**
* used to create sessions
*/
- private object SessionFactory extends PoolableObjectFactory with Logging {
+ private object SessionFactory extends PoolableObjectFactory[Session] with Logging {
// instead of randomly choosing a host we'll attempt to round-robin them, may not
// be completely round robin with multiple threads but it should provide a more
// even spread than something random.
var lastHostUsed = 0
def next(current:Int) = (current + 1) % hosts.size
- def makeObject:Object = makeSession(next(lastHostUsed), 0)
+ def makeObject:Session = makeSession(next(lastHostUsed), 0)
def makeSession(hostIndex:Int, count:Int):Session = {
if (count < hosts.size) {
@@ -145,15 +145,13 @@ class SessionPool(val hosts:Seq[Host], val params:PoolParams, val defaultConsist
}
}
- def session(obj:Object) = obj.asInstanceOf[Session]
+ def activateObject(session:Session):Unit = {}
- def activateObject(obj:Object):Unit = {}
+ def destroyObject(session:Session):Unit = session.close
- def destroyObject(obj:Object):Unit = session(obj).close
+ def validateObject(session:Session):Boolean = session.isOpen && !session.hasError
- def validateObject(obj:Object):Boolean = session(obj).isOpen && !session(obj).hasError
-
- def passivateObject(obj:Object):Unit = {}
+ def passivateObject(session:Session):Unit = {}
}
@@ -10,10 +10,8 @@ import org.apache.thrift.transport.{TTransportException, TSocket}
import com.shorrockin.cascal.session._
import com.shorrockin.cascal.utils.{Utils, Logging}
import org.apache.cassandra.config.{CFMetaData, KSMetaData}
-import org.junit.AfterClass
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
-import org.apache.cassandra.config.Schema
/**
* trait which mixes in the functionality necessary to embed
@@ -100,7 +98,8 @@ object EmbeddedCassandraServer extends Logging {
private def loadSchema(ksMetaData: KSMetaData) = {
val ksList = new java.util.ArrayList[KSMetaData]()
ksList.add(ksMetaData)
- Schema.instance.load(ksList, Schema.instance.getVersion)
+ import org.apache.cassandra.config.Schema
+ Schema.instance.load(ksList)
}
def shutdown {
@@ -21,6 +21,6 @@ trait Schema {
lazy val ksMetaData = KSMetaData.testMetadataNotDurable(keyspace, strategyClass, Map("replication_factor" -> "1"), cfMetaDatas:_*)
def cfMetaData(name: String, cfType: ColumnFamilyType, colType: AbstractType[_]) = {
- new CFMetaData(keyspace, name, cfType, colType, null).keyCacheSize(0);
+ new CFMetaData(keyspace, name, cfType, colType, null);
}
}

0 comments on commit 3522ca3

Please sign in to comment.