This repository was archived by the owner on Oct 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
sansa-examples-spark/src/main/scala/net/sansa_stack/examples/spark/ml/clustering Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ package net .sansa_stack .examples .spark .ml .clustering
2+
3+ import scala .collection .mutable
4+ import org .apache .spark .sql .SparkSession
5+ import org .apache .log4j .{ Level , Logger }
6+ import net .sansa_stack .ml .spark .clustering .BorderFlow
7+
8+ object BorderFlowClustering {
9+ def main (args : Array [String ]) = {
10+ if (args.length < 1 ) {
11+ System .err.println(
12+ " Usage: BorderFlow <input> " )
13+ System .exit(1 )
14+ }
15+ val input = args(0 ) // "src/main/resources/BorderFlow_Sample1.txt"
16+ val optionsList = args.drop(1 ).map { arg =>
17+ arg.dropWhile(_ == '-' ).split('=' ) match {
18+ case Array (opt, v) => (opt -> v)
19+ case _ => throw new IllegalArgumentException (" Invalid argument: " + arg)
20+ }
21+ }
22+ val options = mutable.Map (optionsList : _* )
23+
24+ options.foreach {
25+ case (opt, _) => throw new IllegalArgumentException (" Invalid option: " + opt)
26+ }
27+ println(" ============================================" )
28+ println(" | Border Flow example |" )
29+ println(" ============================================" )
30+
31+ val spark = SparkSession .builder
32+ .master(" local[*]" )
33+ .appName(" BorderFlow example (" + input + " )" )
34+ .getOrCreate()
35+ Logger .getRootLogger.setLevel(Level .ERROR )
36+
37+ BorderFlow (spark, input)
38+
39+ spark.stop
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments