Как исправить эту ошибку в этом коде
trait Processor00 {
def process(oraOptionDfConfig: DataFrameReader, sparkSession: SparkSession ): Unit
}
class BMValsProcessor extends Processor {
def process(oraOptionDfConfig: DataFrameReader, sparkSession: SparkSession ) : Unit ={
println("in BMValsProcessor")///actual business logic
}
}
class BMValsProcessor2 extends Processor {
def process(oraOptionDfConfig: DataFrameReader, sparkSession: SparkSession ) : Unit ={
println("in BMValsProcessor2") //actual business logic
}
}
object ValProcessor {
def main( args : Array[String]):Unit ={
val df : DataFrameReader = null; // initialization of DataFrameReader
val spark: SparkSession = null; // initialization of SparkSession
val procs :Map[String, (DataFrameReader, SparkSession) => Unit] = getAllDefinedProcessors();
procs.values.foreach(
proc => proc(df,spark)
)
}
def getAllDefinedProcessors(): Map[String, (DataFrameReader, SparkSession) => Unit] = {
val myFuncs2 : Map[String, () => Unit]=
Map(
"bm_vals" -> (() => BMValsProcessor().process), //Error
"bm_vals2" -> (() => BMValsProcessor2().process) //Error
)
myFuncs2;
}
}
Ошибка:
не найдено: значение BMValsProcessor