Permalink
Browse files

Make it easier to turn on/off sniff mode in ES

  • Loading branch information...
1 parent e46a22b commit fa4754e32e8e0ed46d3865c19fea6318954c912b @holdenk holdenk committed May 2, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 build.sbt
  2. +2 −1 src/main/scala/com/foursquare/slashem/Schema.scala
View
@@ -1,6 +1,6 @@
name := "slashem"
-version := "0.9.10b"
+version := "0.9.11"
organization := "com.foursquare"
@@ -211,6 +211,7 @@ trait ElasticMeta[T <: Record[T]] extends SlashemMeta[T] {
val indexName = "testindex"// Override me too
val docType = "slashemdoc"
val useTransport = true// Override if you want to use transport client
+ val sniffMode = false// Override if you want to use sniff mode
def servers: List[String] = List() // Define if your going to use the transport client
def serverInetSockets = servers.map(x => {val h = x.split(":")
val s = h.head
@@ -230,7 +231,7 @@ trait ElasticMeta[T <: Record[T]] extends SlashemMeta[T] {
case _ => {
myClient = Some({
if (useTransport) {
- val settings = ImmutableSettings.settingsBuilder().put("cluster.name",clusterName).put("client.transport.sniff",true)
+ val settings = ImmutableSettings.settingsBuilder().put("cluster.name",clusterName).put("client.transport.sniff",sniffMode)
val tc = new TransportClient(settings)
serverInetSockets.map(tc.addTransportAddress(_))
tc

0 comments on commit fa4754e

Please sign in to comment.