From 213f3b797dd6728f57923ce1455b7b698d17efde Mon Sep 17 00:00:00 2001 From: kulikov Date: Fri, 1 Feb 2013 14:25:01 +0400 Subject: [PATCH] add build.sbt for simplify usage in multi-modules sbt project --- .gitignore | 1 + build.sbt | 17 +++++++++++++++++ .../core/EventsourcingExtension.scala | 9 ++++----- .../eventsourced/journal/InmemJournal.scala | 4 ++-- 4 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 build.sbt diff --git a/.gitignore b/.gitignore index 679c8a9..a69f2e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea* *.log +*.iml target/ diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..959eaeb --- /dev/null +++ b/build.sbt @@ -0,0 +1,17 @@ +organization := "org.eligosource" + +name := "eventsourced" + +version := "0.5-SNAPSHOT" + +scalaVersion := "2.10.0" + +resolvers += "Journalio Repo" at "http://repo.eligotech.com/nexus/content/repositories/eligosource-releases" + +libraryDependencies ++= Seq( + "com.google.protobuf" % "protobuf-java" % "2.4.1" % "compile", + "com.typesafe.akka" %% "akka-actor" % "2.1.0" % "compile", + "commons-io" % "commons-io" % "2.3" % "compile", + "journalio" % "journalio" % "1.2" % "compile", + "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.4.1" % "compile" +) diff --git a/src/main/scala/org/eligosource/eventsourced/core/EventsourcingExtension.scala b/src/main/scala/org/eligosource/eventsourced/core/EventsourcingExtension.scala index fc7de53..556a092 100644 --- a/src/main/scala/org/eligosource/eventsourced/core/EventsourcingExtension.scala +++ b/src/main/scala/org/eligosource/eventsourced/core/EventsourcingExtension.scala @@ -16,7 +16,6 @@ package org.eligosource.eventsourced.core import java.util.concurrent.atomic.AtomicReference -import java.util.concurrent.TimeoutException import scala.annotation.tailrec import scala.concurrent._ @@ -256,28 +255,28 @@ class EventsourcingExtension(system: ExtendedActorSystem) extends Extension { } @tailrec - private def registerChannel(channelId: Int, channelName: Option[String], channel: ActorRef): Unit = { + private def registerChannel(channelId: Int, channelName: Option[String], channel: ActorRef) { val current = channelsRef.get() val updated = if (channelName.isDefined) current.add(channelId, channelName.get, channel) else current.add(channelId, channel) if (!channelsRef.compareAndSet(current, updated)) registerChannel(channelId, channelName, channel) } @tailrec - private def registerProcessor(processorId: Int, processor: ActorRef): Unit = { + private def registerProcessor(processorId: Int, processor: ActorRef) { val current = processorsRef.get() val updated = current + (processorId -> processor) if (!processorsRef.compareAndSet(current, updated)) registerProcessor(processorId, processor) } @tailrec - private [core] final def deregisterChannel(channelId: Int): Unit = { + private [core] final def deregisterChannel(channelId: Int) { val current = channelsRef.get() val updated = current.remove(channelId) if (!channelsRef.compareAndSet(current, updated)) deregisterChannel(channelId) } @tailrec - private [core] final def deregisterProcessor(processorId: Int): Unit = { + private [core] final def deregisterProcessor(processorId: Int) { val current = processorsRef.get() val updated = current - processorId if (!processorsRef.compareAndSet(current, updated)) deregisterProcessor(processorId) diff --git a/src/main/scala/org/eligosource/eventsourced/journal/InmemJournal.scala b/src/main/scala/org/eligosource/eventsourced/journal/InmemJournal.scala index 5d8cc84..10de9d7 100644 --- a/src/main/scala/org/eligosource/eventsourced/journal/InmemJournal.scala +++ b/src/main/scala/org/eligosource/eventsourced/journal/InmemJournal.scala @@ -64,14 +64,14 @@ private [eventsourced] class InmemJournal extends Journal { def storedCounter = counter - private def replay(processorId: Int, channelId: Int, fromSequenceNr: Long, p: Message => Unit): Unit = { + private def replay(processorId: Int, channelId: Int, fromSequenceNr: Long, p: Message => Unit) { val startKey = Key(processorId, channelId, fromSequenceNr, 0) val iter = redoMap.from(startKey).iterator.buffered replay(iter, startKey, p) } @scala.annotation.tailrec - private def replay(iter: BufferedIterator[(Key, Any)], key: Key, p: Message => Unit): Unit = { + private def replay(iter: BufferedIterator[(Key, Any)], key: Key, p: Message => Unit) { if (iter.hasNext) { val nextEntry = iter.next() val nextKey = nextEntry._1