Last active
May 14, 2020 13:12
Revisions
-
ceteri revised this gist
May 18, 2014 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +0,0 @@ -
ceteri renamed this gist
May 18, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Tuple2 pair = new Tuple2(a, b); pair._1 // => a pair._2 // => b -
ceteri revised this gist
May 18, 2014 . 2 changed files with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +0,0 @@ This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ val pair = (a, b) pair._1 // => a pair._2 // => b -
ceteri revised this gist
May 18, 2014 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ pair = (a, b) pair[0] # => a pair[1] # => b -
ceteri revised this gist
May 18, 2014 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ scala> messages.toDebugString res5: String = MappedRDD[4] at map at <console>:16 (1 partitions) MappedRDD[3] at map at <console>:16 (1 partitions) FilteredRDD[2] at filter at <console>:14 (1 partitions) MappedRDD[1] at textFile at <console>:12 (1 partitions) HadoopRDD[0] at textFile at <console>:12 (1 partitions) -
ceteri revised this gist
May 18, 2014 . 1 changed file with 5 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,17 +2,16 @@ // then interactively search for various patterns // base RDD val lines = sc.textFile("log.txt") // transformed RDDs val errors = lines.filter(_.startsWith("ERROR")) val messages = errors.map(_.split("\t")).map(r => r(1)) messages.cache() // actions messages.filter(_.contains("mysql")).count() messages.filter(_.contains("php")).count() -
ceteri revised this gist
May 18, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ // then interactively search for various patterns // base RDD val lines = sc.textFile("logtxt") // transformed RDDs val errors = lines.filter(_.startsWith("ERROR") ) -
ceteri revised this gist
May 18, 2014 . 2 changed files with 16 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,13 +2,22 @@ // then interactively search for various patterns // base RDD val lines = sc.textFile("logftxt") // transformed RDDs val errors = lines.filter(_.startsWith("ERROR") ) errors = lines.filter(lambda s: s.startswith("ERROR")) messages = errors.map(lambda s: s.split("\t")[2]) messages.cache() // actions messages.filter(lambda s: "mysql" in s).count() messages.filter(lambda s: "php" in s).count() val messages = errors.map(_.split("\t")).map(r => r(1)) messages.cache() messages.filter(_.contains("mysql")).count() messages.filter(_.contains("php")).count() This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ ERROR php: dying for unknown reasons WARN dave, are you angry at me? ERROR did mysql just barf? WARN xylons approaching ERROR mysql cluster: replace with spark cluster -
ceteri revised this gist
May 18, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ // load error messages from a log into memory // then interactively search for various patterns // base RDD lines = spark.textFile("hdfs://…") -
ceteri created this gist
May 5, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ // base RDD lines = spark.textFile("hdfs://…") // transformed RDDs errors = lines.filter(lambda s: s.startswith("ERROR")) messages = errors.map(lambda s: s.split("\t")[2]) messages.cache() // actions messages.filter(lambda s: "mysql" in s).count() messages.filter(lambda s: "php" in s).count()