-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsupercomputer-alerts-demo.txt
More file actions
68 lines (51 loc) · 1.81 KB
/
supercomputer-alerts-demo.txt
File metadata and controls
68 lines (51 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
SuperComputerAlerts
Data file: text of supercomputer log data:
30G tbird-tagged
Using 2 slave nodes, both with 8 cores and 28 GB memory
Spark configured to use 25GB memory per node
950 partitions
slows down around 344
Hangs for minutes around 650
Gets too slow to complete
Why does this never complete? Too much data?
-Hostname problem on some nodes. Fixed now.
- searching for messages within a particular time window or from a
particular source
- looking for time buckets with abnormally large numbers of messages
- alert detection
- alert prediction (are there patterns of non-alert messages that
tend to precede alerts?)
Panics only completes in 400sec.
*/
import spark._
import spark.SparkContext._
import spark.timeseries._
//val sc = TimeSeriesSpark.init("mesos://master@86.50.22.12:5050", "default")
def alerts(sc: SparkContext, fileName: String) = {
val file = sc.textFile(fileName)
val mapped = file.map(x => {
// max no. fields
val arr = x.split(" ", 8)
new Message(arr(0), arr(1) toLong,arr(2),arr(3),arr(4),arr(5) toInt, arr(6),arr(7))
})
}
def bucketMessages(sc: SparkContext, fileName: String){
val messages = alerts(sc,fileName)
messages.map(x => {
var list = new ArrayBuffer[Message]
})
}
val hdfsDir = "hdfs://server.com:54310/user/username/"
val filename = "tbird-tagged"
val splitAlerts = alerts(sc, hdfsDir+filename)
val all = splitAlerts.count()
val panics = splitAlerts.filter(_.msg.toUpperCase().contains("PANIC"))
// Here, it fails with an exception:
val cc = panics.collect()
//val panics = splitAlerts.count()
// up to this point, with panics only, completes in 400 sec.
// After caching the 16 messages with panic, the following is fast:
//val msgs = splitAlerts.collect()
//for (k <- msgs)
// println(k(7))