Permalink
Browse files

Merge pull request #22 from jdowens/scrooge3upgrade

Scrooge3upgrade
  • Loading branch information...
2 parents d61aae8 + cde884d commit e38ae6cb4d69a0aba1d5dfc9be0f3727df73923a @chunyan chunyan committed Aug 24, 2012
@@ -125,6 +125,7 @@ end
"src/scripts/#{project_name.downcase}.sh",
"src/scripts/devel.sh",
"console",
+ "sbt",
].each do |executable|
`chmod +x #{executable}` if File.exists?(executable)
end
@@ -16,17 +16,18 @@ name := "birdname"
version := "1.0.0-SNAPSHOT"
libraryDependencies ++= Seq(
- "org.scala-lang" % "jline" % "2.9.1",
- "com.twitter" %% "scrooge-runtime" % "1.1.3",
- "com.twitter" %% "finagle-core" % "3.0.0",
- "com.twitter" %% "finagle-thrift" % "3.0.0",
- "com.twitter" %% "finagle-ostrich4" % "3.0.0",
- "org.scalatest" %% "scalatest" % "1.7.1" % "test",
- "com.twitter" %% "scalatest-mixins" % "1.0.3" % "test"
+ "org.scala-lang" % "jline" % "2.9.1",
+ "com.twitter" % "scrooge" % "3.0.1",
+ "com.twitter" % "scrooge-runtime_2.9.2" % "3.0.1",
+ "com.twitter" % "finagle-core" % "5.3.6",
+ "com.twitter" % "finagle-thrift" % "5.3.6",
+ "com.twitter" % "finagle-ostrich4" % "5.3.1",
+ "org.scalatest" %% "scalatest" % "1.7.1" % "test",
+ "com.twitter" %% "scalatest-mixins" % "1.1.0" % "test"
)
mainClass in (Compile, run) := Some("com.twitter.birdname.Main")
mainClass in (Compile, packageBin) := Some("com.twitter.birdname.Main")
-CompileThriftScrooge.scroogeVersion := "2.5.4"
+CompileThriftScrooge.scroogeVersion := "3.0.1"
@@ -5,4 +5,4 @@ if [ $# -lt 2 ] ; then
exit 0
fi
-sbt "run-main com.twitter.birdname.BirdNameConsoleClient $1 $2"
+./sbt "run-main com.twitter.birdname.BirdNameConsoleClient $1 $2"
@@ -19,8 +19,10 @@ resolvers <<= (resolvers) { r =>
externalResolvers <<= (resolvers) map identity
-addSbtPlugin("com.twitter" %% "sbt-package-dist" % "1.0.4")
+addSbtPlugin("com.twitter" %% "sbt-package-dist" % "1.0.5")
-addSbtPlugin("com.twitter" %% "sbt11-scrooge" % "1.0.0")
+addSbtPlugin("com.twitter" %% "sbt11-scrooge" % "3.0.0")
+
+addSbtPlugin("com.twitter" % "sbt-thrift2" % "0.0.1")
libraryDependencies += "com.twitter" %% "scalatest-mixins" % "1.0.3"
View
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+root=$(
+ cd $(dirname $(readlink $0 || echo $0))/..
+ /bin/pwd
+)
+
+sbtjar=sbt-launch.jar
+
+if [ ! -f $sbtjar ]; then
+ echo 'downloading '$sbtjar 1>&2
+ curl -O http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/0.11.2/$sbtjar
+fi
+
+test -f $sbtjar || exit 1
+
+sbtjar_md5=$(openssl md5 < $sbtjar|cut -f2 -d'='|awk '{print $1}')
+
+if [ "${sbtjar_md5}" != 2886cc391e38fa233b3e6c0ec9adfa1e ]; then
+ echo 'bad sbtjar!' 1>&2
+ exit 1
+fi
+
+test -f ~/.sbtconfig && . ~/.sbtconfig
+
+java -ea \
+ $SBT_OPTS \
+ $JAVA_OPTS \
+ -Djava.net.preferIPv4Stack=true \
+ -XX:+AggressiveOpts \
+ -XX:+UseParNewGC \
+ -XX:+UseConcMarkSweepGC \
+ -XX:+CMSParallelRemarkEnabled \
+ -XX:+CMSClassUnloadingEnabled \
+ -XX:MaxPermSize=1024m \
+ -XX:SurvivorRatio=128 \
+ -XX:MaxTenuringThreshold=0 \
+ -Xss8M \
+ -Xms512M \
+ -Xmx3G \
+ -server \
+ -jar $sbtjar "$@"
@@ -1,5 +1,6 @@
package com.twitter.birdname
+import com.twitter.conversions.time._
import com.twitter.logging.Logger
import com.twitter.util._
import java.util.concurrent.Executors
@@ -31,7 +32,7 @@ class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameService
database.get(key) match {
case None =>
log.debug("get %s: miss", key)
- Future.exception(new BirdNameException("No such key"))
+ Future.exception(BirdNameException("No such key"))
case Some(value) =>
log.debug("get %s: hit", key)
Future(value)
@@ -43,4 +44,8 @@ class BirdNameServiceImpl(config: BirdNameServiceConfig) extends BirdNameService
database(key) = value
Future.Unit
}
+
+ def shutdown() = {
+ super.shutdown(0.seconds)
+ }
}

0 comments on commit e38ae6c

Please sign in to comment.