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
def whack(objects) | |
return Hash[*objects.map{ |o| [o.send("table_name"), o.send("delete_all")] }.flatten] | |
end |
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
// Scala 2.7.7, immutable map, uses foldLeft to loop over files/words | |
import java.io._ | |
import scala.io._ | |
def time(f: => Unit) = { | |
val t1 = System.currentTimeMillis | |
f | |
((System.currentTimeMillis - t1)/1000.0) | |
} | |
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
protected def ![A <: ColumnContainer](implicit consistency : ReadConsistency) : Seq[(String, Seq[A])] = { | |
ks.pool.withConnection { conn => | |
val results = conn.client.get_range_slices(ks.name, | |
cp, | |
predicate, | |
range, | |
consistency.thrift) | |
results.map { ks => | |
(ks.key, ks.columns.map{ container => new A(container)}) |