Skip to content

Commit

Permalink
refactoring - mainly removing commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
debasishg committed Dec 16, 2011
1 parent 71f3a49 commit 5d3bfe5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
14 changes: 0 additions & 14 deletions src/main/scala/net/debasishg/recon/FileUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ object FileUtils {
closeReader(_:BufferedReader),
enumReader(_:BufferedReader, i))

/**
def enumReader[A](r: BufferedReader, it: IterV[String, A]): IO[IterV[String, A]] = {
def loop: IterV[String, A] => IO[IterV[String, A]] = {
case i@Done(_, _) => io(i)
case i@Cont(k) => for {
s <- io { r.readLine }
a <- if (s == null) io(i) else loop(k(El(s)))
} yield a
}
loop(it)
}
**/

def enumReader[A](r: BufferedReader, it: IterV[String, A]): IO[IterV[String, A]] = {
def loop(x: IterV[String, A]): IterV[String, A] = x match {
case Done(_, _) => x
Expand All @@ -55,6 +42,5 @@ object FileUtils {
io { loop(it) }
}


val repeatHead = repeat[String, Option[String], List](head[String])
}
9 changes: 0 additions & 9 deletions src/main/scala/net/debasishg/recon/ReconEngine.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ trait ReconEngine[T, V] {

def fromSource1(fs: (String, ReconSource[T])): Option[ReconDef[T]] = {
val (file, src) = fs
val start = System.currentTimeMillis
import src._
val a = process(file) :-> (x => CollectionDef(id + runDate.toString, x.flatten.flatten))
a match {
Expand Down Expand Up @@ -177,14 +176,6 @@ trait ReconEngine[T, V] {
}
}
res.size
// clients.withClient {client =>
// res map {_ =>
// Map[ReconRez, Option[Int]](
// Match -> (client.hgetall[String, MatchList[V]](matchHashKey).map(_.keySet.size)),
// Break -> (client.hgetall[String, MatchList[V]](breakHashKey).map(_.keySet.size)),
// Unmatch -> (client.hgetall[String, MatchList[V]](unmatchHashKey).map(_.keySet.size)))
// }
// }
}

def consolidateWith(pastDate: LocalDate) (implicit clients: RedisClientPool, m: Monoid[V], s: Semigroup[MatchList[V]], p: Parse[MatchList[V]], f: Format) = {
Expand Down
10 changes: 1 addition & 9 deletions src/main/scala/net/debasishg/recon/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,5 @@ object Util {
(implicit m: Format[MatchList[V]]) = tobinary(l)

def deSerializeMatchList[V](bytes: Array[Byte])
(implicit m: Format[MatchList[V]]) = {
try {
frombinary[MatchList[V]](bytes)
} catch {
case th: Throwable =>
println("***** from deserialize: " + new String(bytes, "UTF-8"))
sys.error(th.getMessage)
}
}
(implicit m: Format[MatchList[V]]) = frombinary[MatchList[V]](bytes)
}

0 comments on commit 5d3bfe5

Please sign in to comment.