Skip to content

Instantly share code, notes, and snippets.

@ceocoder
Created September 17, 2010 19:46
Show Gist options
  • Save ceocoder/584812 to your computer and use it in GitHub Desktop.
Save ceocoder/584812 to your computer and use it in GitHub Desktop.
Code,
object EnterTheDragon {
def main(args: Array[String]) {
val conf = Map(
"seedHost" -> "127.0.0.1",
"seedPort" -> 9160,
"maxIdle" -> 10,
"initCapacity" -> 10,
"clientProvider" -> "scromium.thrift.ThriftClientProvider")
val cassandra = Cassandra.start(conf)
println(cassandra)
val rconst = ReadConsistency.One
val wconst = WriteConsistency.One
cassandra.keyspace("Skunk") { ks =>
ks.columnFamily("Message") { cf =>
cf.batch { put =>
val r = put.row("myrow")
r.insert("c1", "v1")
cf.put(put)
}
}
}
println("hi")
}
}
Error
scromium.Cassandra@7db5391b
ERROR 10/09/17 12:46:05 WrappedProvider - Error while trying to use connection
java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Cassandra$Iface.set_keyspace(Ljava/lang/String;)V
at scromium.thrift.ThriftClient.put(ThriftClient.scala:33)
at scromium.ColumnFamily$$anonfun$put$1.apply(ColumnFamily.scala:57)
at scromium.ColumnFamily$$anonfun$put$1.apply(ColumnFamily.scala:57)
at scromium.thrift.WrappedProvider.withClient(ThriftClientProvider.scala:20)
at scromium.thrift.ThriftClientProvider.withClient(ThriftClientProvider.scala:11)
at scromium.ColumnFamily.put(ColumnFamily.scala:57)
at skunk.EnterTheDragon$$anonfun$main$1$$anonfun$apply$1$$anonfun$apply$2.apply(EnterTheDragon.scala:31)
at skunk.EnterTheDragon$$anonfun$main$1$$anonfun$apply$1$$anonfun$apply$2.apply(EnterTheDragon.scala:28)
at scromium.Put.apply(Put.scala:11)
at skunk.EnterTheDragon$$anonfun$main$1$$anonfun$apply$1.apply(EnterTheDragon.scala:28)
at skunk.EnterTheDragon$$anonfun$main$1$$anonfun$apply$1.apply(EnterTheDragon.scala:27)
at scromium.ColumnFamily.apply(ColumnFamily.scala:16)
at skunk.EnterTheDragon$$anonfun$main$1.apply(EnterTheDragon.scala:27)
at skunk.EnterTheDragon$$anonfun$main$1.apply(EnterTheDragon.scala:26)
at scromium.Keyspace.apply(Keyspace.scala:10)
at skunk.EnterTheDragon$.main(EnterTheDragon.scala:26)
at skunk.EnterTheDragon.main(EnterTheDragon.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sbt.Run.run0(Run.scala:60)
at sbt.Run.execute$1(Run.scala:47)
at sbt.Run$$anonfun$run$2.apply(Run.scala:50)
at sbt.Run$$anonfun$run$2.apply(Run.scala:50)
at sbt.TrapExit$.executeMain$1(TrapExit.scala:33)
at sbt.TrapExit$$anon$1.run(TrapExit.scala:42)
java.lang.NoSuchMethodError: org.apache.cassandra.thrift.Cassandra$Iface.set_keyspace(Ljava/lang/String;)V
at scromium.thrift.ThriftClient.put(ThriftClient.scala:33)
at scromium.ColumnFamily$$anonfun$put$1.apply(ColumnFamily.scala:57)
at scromium.ColumnFamily$$anonfun$put$1.apply(ColumnFamily.scala:57)
at scromium.thrift.WrappedProvider.withClient(ThriftClientProvider.scala:20)
at scromium.thrift.ThriftClientProvider.withClient(ThriftClientProvider.scala:11)
at scromium.ColumnFamily.put(ColumnFamily.scala:57)
at skunk.EnterTheDragon$$anonfun$main$1$$anonfun$apply$1$$anonfun$apply$2.apply(EnterTheDragon.scala:31)
at skunk.EnterTheDragon$$anonfun$main$1$$anonfun$apply$1$$anonfun$apply$2.apply(EnterTheDragon.scala:28)
at scromium.Put.apply(Put.scala:11)
at skunk.EnterTheDragon$$anonfun$main$1$$anonfun$apply$1.apply(EnterTheDragon.scala:28)
at skunk.EnterTheDragon$$anonfun$main$1$$anonfun$apply$1.apply(EnterTheDragon.scala:27)
at scromium.ColumnFamily.apply(ColumnFamily.scala:16)
at skunk.EnterTheDragon$$anonfun$main$1.apply(EnterTheDragon.scala:27)
at skunk.EnterTheDragon$$anonfun$main$1.apply(EnterTheDragon.scala:26)
at scromium.Keyspace.apply(Keyspace.scala:10)
at skunk.EnterTheDragon$.main(EnterTheDragon.scala:26)
at skunk.EnterTheDragon.main(EnterTheDragon.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sbt.Run.run0(Run.scala:60)
at sbt.Run.execute$1(Run.scala:47)
at sbt.Run$$anonfun$run$2.apply(Run.scala:50)
at sbt.Run$$anonfun$run$2.apply(Run.scala:50)
at sbt.TrapExit$.executeMain$1(TrapExit.scala:33)
at sbt.TrapExit$$anon$1.run(TrapExit.scala:42)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment