Created
November 24, 2016 05:49
-
-
Save TJC/9a6a174cb1419a7c32e8018c5a495e3d to your computer and use it in GitHub Desktop.
Demonstrate slow riak client shutdown
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
lazy val root = (project in file(".")). | |
settings( | |
organization := "au.net.strategicdata", | |
name := "riak-slow", | |
version := "0.1", | |
scalaVersion := "2.11.8" | |
) | |
libraryDependencies += "com.basho.riak" % "riak-client" % "2.1.0" | |
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint") | |
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
package riak.bug | |
import scala.collection.JavaConverters._ // The Riak library needs conversions | |
import com.basho.riak.client.api.RiakClient | |
object RiakDemo { | |
def main(args: Array[String]): Unit = { | |
println("starting up"); | |
if (! sys.env.contains("RIAK_SERVER")) { | |
println("Please define a riak server address in RIAK_SERVER") | |
sys.exit(1) | |
} | |
val riak = new RiakConnection(List(sys.env("RIAK_SERVER"))) | |
riak.shutdown | |
println("done, exiting") | |
sys.exit(0) | |
} | |
} | |
class RiakConnection(servers: List[String]) { | |
val riak = RiakClient.newClient(servers.asJava) | |
def shutdown = riak.shutdown | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment