0
나는 mapreduce 코드의 일부로 try catch를 사용했습니다. 아래 코드에서 COUNT를 기준으로 값을 줄입니다. 내가 어떻게스칼라 프로그램 종료 중?
class RepReducer extends Reducer[NullWritable, Text, Text, IntWritable] {
override def reduce(key: NullWritable, values: Iterable[Text], context: Reducer[NullWritable, Text, Text, IntWritable]#Context): Unit = {
val count = values.toList.length
if (count == 0){
try {
context.write(new Text("Number of tables with less than 40% coverage"), new IntWritable(count))
} catch {
case e: Exception =>
Console.err.println(" ")
e.printStackTrace()
}
}
else
{
System.out.println("terminate job") //here i want to terminate if count is not equal to 0
}
}
}
'sys.exit()' http://www.scala-lang.org/api/current/index.html#[email protected](status:Int):Nothing – lea
'sys.exit()', 기술적으로 질문에 대한 대답은 거의 올바른 행동이 아닙니다. 아마 하둡 (Hadoop)에있는 것이지만, 이것이 XY 문제인지 아닌지를 파악하기 위해서는 더 자세한 정보가 필요하다고 생각합니다. –