I am working on a version of this that handles the encoding (and cursing Scala's type system in the process). Unfortunately I get build errors when trying to compile with either Maven or sbt. I got around this in the past because my codec was a bolt-on and required no changes to the rest of the code. This change requires the A type parameter on Column to be covariant (i.e. Column[+A, B] instead of Column[A, B]), so I need to be able to build.
My build errors...
[warn] No .svnrepo file; no svn repo will be configured.
[info] Standard project rules 1.0.4 loaded (2012-03-22).
[warn] No .svnrepo file; no svn repo will be configured.
[info] Standard project rules 1.0.4 loaded (2012-03-22).
[warn] No .svnrepo file; no svn repo will be configured.
[info] Standard project rules 1.0.4 loaded (2012-03-22).
[warn] No .svnrepo file; no svn repo will be configured.
[info] Standard project rules 1.0.4 loaded (2012-03-22).
[warn] No .svnrepo file; no svn repo will be configured.
[info] Building project cassie 0.20.2-SNAPSHOT against Scala 2.8.1
[info] using Cassie with sbt 0.7.4 and Scala 2.7.7
[info]
[info] == cassie-core / check-deps-exist ==
[info] == cassie-core / check-deps-exist ==
[info]
[info] == cassie-core / auto-compile-thrift-java ==
[info] == cassie-core / auto-compile-thrift-java ==
[info]
[info] == cassie-stress / check-deps-exist ==
[info] == cassie-stress / check-deps-exist ==
[info]
[info] == cassie-hadoop / check-deps-exist ==
[info] == cassie-hadoop / check-deps-exist ==
[info]
[info] == cassie-serversets / check-deps-exist ==
[info] == cassie-serversets / check-deps-exist ==
[info]
[info] == cassie-core / compile ==
[info] Source analysis: 83 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[error] Note: Some input files use unchecked or unsafe operations.
[error] Note: Recompile with -Xlint:unchecked for details.
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/BaseColumnFamily.scala:48: value setTerminalId is not a member of object com.twitter.finagle.tracing.Trace
[error] Trace.setTerminalId(Trace.nextId)
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/BatchMutationBuilder.scala:62: value Void is not a member of object com.twitter.util.Future
[error] Future.Void
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/Cluster.scala:56: not found: value collectionAsScalaIterable
[error] this(collectionAsScalaIterable(seedHosts).toSet, 9160, NullStatsReceiver)
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/ClusterRemapper.scala:58: not found: value collectionAsScalaIterable
[error] collectionAsScalaIterable(h.endpoints).map {
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/ColumnFamily.scala:184: not found: value collectionAsScalaIterable
[error] for (rowEntry <- collectionAsScalaIterable(rows.entrySet))
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/ColumnFamily.scala:231: not found: value collectionAsScalaIterable
[error] for (rowEntry <- collectionAsScalaIterable(result.entrySet)) {
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/ColumnFamily.scala:284: not found: value collectionAsScalaIterable
[error] for (key <- collectionAsScalaIterable(result.keySet)) {
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/CounterBatchMutationBuilder.scala:49: value Void is not a member of object com.twitter.util.Future
[error] Future.Void
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/CounterColumnFamily.scala:166: not found: value collectionAsScalaIterable
[error] for (rowEntry <- collectionAsScalaIterable(rows.entrySet))
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/CounterColumnFamily.scala:198: not found: value collectionAsScalaIterable
[error] for (rowEntry <- collectionAsScalaIterable(result.entrySet)) {
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/Keyspace.scala:76: value Void is not a member of object com.twitter.util.Future
[error] if (batches.size == 0) return Future.Void
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/SuperCounterBatchMutationBuilder.scala:33: value Void is not a member of object com.twitter.util.Future
[error] Future.Void
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/SuperCounterColumnFamily.scala:81: not found: value collectionAsScalaIterable
[error] for (rowEntry <- collectionAsScalaIterable(result.entrySet)) {
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/codecs/Codec.scala:18: collectionAsScalaIterable is not a member of scala.collection.JavaConversions
[error] import scala.collection.JavaConversions.collectionAsScalaIterable
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/codecs/Codec.scala:41: not found: value collectionAsScalaIterable
[error] for (value <- collectionAsScalaIterable(values))
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/codecs/LegacyUtf8Codec.scala:24: overloaded method constructor deprecated with alternatives:
[error] ()deprecated <and>
[error] (message: String)deprecated
[error] cannot be applied to (java.lang.String, java.lang.String)
[error] @deprecated("""Use the new Utf8Codec if you can. You may need to use this for backwards
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/codecs/LegacyUtf8Codec.scala:28: overloaded method constructor deprecated with alternatives:
[error] ()deprecated <and>
[error] (message: String)deprecated
[error] cannot be applied to (java.lang.String, java.lang.String)
[error] @deprecated("""Use the new Utf8Codec if you can. You may need to use this for backwards
[error] ^
[error] /Users/rstrickland/workspace/cassie/cassie-core/src/main/scala/com/twitter/cassie/codecs/LegacyUtf8Codec.scala:32: overloaded method constructor deprecated with alternatives:
[error] ()deprecated <and>
[error] (message: String)deprecated
[error] cannot be applied to (java.lang.String, java.lang.String)
[error] @deprecated("""Use the new Utf8Codec if you can. You may need to use this for backwards
[error] ^
[error] 23 errors found
[info] == cassie-core / compile ==
[error] Error running compile: Compilation failed
[info]
[info] Total time: 30 s, completed Nov 29, 2012 4:42:14 PM
[info]
[info] Total session time: 35 s, completed Nov 29, 2012 4:42:14 PM
[error] Error during build.
Maven:
I have messed around with it a bit, but only succeeded in creating different problems. Any help is appreciated!
Robbie