All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hydrosphere.mist.api.StreamingSupport.scala Maven / Gradle / Ivy

package io.hydrosphere.mist.api

import org.apache.spark.streaming._

trait StreamingSupport extends ContextSupport {

  private[mist] var _ssc: StreamingContext = _

  def streamingContext: StreamingContext = _ssc

  override private[mist] def setup(conf: SetupConfiguration): Unit = {
    super.setup(conf)
    _ssc = StreamingContext.getActiveOrCreate(() => {
      new StreamingContext(conf.context, conf.streamingDuration)
    })
  }

  override private[mist] def stop(): Unit = {
    super.stop()
    _ssc.stop(stopSparkContext = false, stopGracefully = true)
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy