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
#!/bin/bash | |
hostname=`hostname` | |
regex="${hostname}${hostname},([0-9]+)," | |
out=`/usr/lib/zookeeper/bin/zkCli.sh <<EOF | |
get /hbase/master | |
quit | |
EOF` | |
[[ $out =~ $regex ]] |
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
scala> val m = Map("a" -> 1, "b" -> 2) | |
m: scala.collection.immutable.Map[String,Int] = Map(a -> 1, b -> 2) | |
type StringIntMap = scala.collection.immutable.Map[String, Int] | |
val m: StringIntMap = Map("a" -> 1) | |
val m: Map[String, Int] = Map[String, Int]("a" -> 1) | |
val m: Map[String, Int] = Map("a" -> 1) | |
val m = Map[String, Int]("a" -> 1) | |
val m = Map("a" -> 1) |
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
val m = Map("a" -> 1, "b" -> 2) |
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
m = { :a => 1, :b => 2 } |
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
{:a 1, :b 2} |
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
def m = [a:1, b:2] |
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
import java.util.*; | |
Map<String, Integer> m = new HashMap<String, Integer>(); | |
m.put("a", 1); | |
m.put("b", 2); |
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
val talk = Map( | |
"title" -> "Scala Map Literals are not Syntactic Sugar", | |
"presenter" -> "Zach Cox", | |
"twitter" -> "@zcox", | |
"meetup" -> "iascala", | |
"date" -> "2013-10-09") |
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
val conf = new BaseConfiguration() | |
conf.setProperty("storage.backend","cassandra") | |
conf.setProperty("storage.hostname","127.0.0.1") | |
conf.setProperty("storage.index.search.backend", "elasticsearch") | |
conf.setProperty("storage.index.search.hostname", "127.0.0.1") | |
val graph = TitanFactory.open(conf) |
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
val conf = new BaseConfiguration() | |
conf.setProperty("storage.backend","cassandra") | |
conf.setProperty("storage.hostname","127.0.0.1") | |
conf.setProperty("storage.index.search.backend", "elasticsearch") | |
conf.setProperty("storage.index.search.hostname", "127.0.0.1:9200") | |
conf.setProperty("storage.index.search.client-only", true) | |
conf.setProperty("storage.index.search.local-mode", false) | |
val graph = TitanFactory.open(conf) |