Skip to content

Commit

Permalink
Added lag parameter to MLPPProvisoryMain
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpes committed Nov 16, 2016
1 parent b7469a1 commit 24ea995
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object MLPPProvisoryMain extends Main {

override def appName: String = "MLPPMain"

def runMLPPFeaturing(sqlContext: SQLContext, config: Config) = {
def runMLPPFeaturing(sqlContext: SQLContext, config: Config, params: MLPPWriter.Params) = {
import sqlContext.implicits._

Seq("broad", "narrow").foreach { i =>
Expand All @@ -24,15 +24,16 @@ object MLPPProvisoryMain extends Main {

val flatEvents = flatEventsDF.as[FlatEvent].persist

MLPPWriter().write(flatEvents, s"/shared/mlpp_features/$i/")
MLPPWriter(params).write(flatEvents, s"/shared/mlpp_features/$i/")
}
}

override def main(args: Array[String]): Unit = {
startContext()
val environment = if (args.nonEmpty) args(0) else "test"
val environment = args(0)
val params = MLPPWriter.Params(lagCount = args(1).toInt, bucketSize = args(2).toInt)
val config: Config = ConfigFactory.parseResources("filtering.conf").getConfig(environment)
runMLPPFeaturing(sqlContext, config)
runMLPPFeaturing(sqlContext, config, params)
stopContext()
}
}

0 comments on commit 24ea995

Please sign in to comment.