Skip to content

Commit

Permalink
substring feedback error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Liuwenli11 committed Oct 25, 2019
1 parent a5389c9 commit 403b2ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ object FlinkxUtils {
streamId: Long,
errorPattern: String): String = {
val ts: String = null
val errorMaxLength = 2000

val errorMsg = if(error!=null){
val first = if(error.getStackTrace!=null&&error.getStackTrace.nonEmpty) error.getStackTrace.head.toString else ""
error.toString + "\n" + first
val errorAll = error.toString + "\n" + first
errorAll.substring(0, math.min(errorMaxLength, errorAll.length))
} else null
UmsProtocolUtils.feedbackFlowError(sourceNamespace,
streamId, DateUtils.currentDateTime, sinkNamespace, UmsWatermark(ts),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ object SparkxUtils extends EdpLogging{
errorPattern:String): Unit ={

val ts: String = null
val errorMaxLength = 2000
// val tmpJsonArray = new JSONArray()
// val sourceTopicSet = mutable.HashSet.empty[String]
// sourceTopicSet ++= incrementTopicList
Expand All @@ -63,7 +64,8 @@ object SparkxUtils extends EdpLogging{

val errorMsg = if(error!=null){
val first = if(error.getStackTrace!=null&&error.getStackTrace.nonEmpty) error.getStackTrace.head.toString else ""
error.toString + "\n" + first
val errorAll = error.toString + "\n" + first
errorAll.substring(0, math.min(errorMaxLength, errorAll.length))
} else null
WormholeKafkaProducer.sendMessage(config.kafka_output.feedback_topic_name,
FeedbackPriority.feedbackPriority, UmsProtocolUtils.feedbackFlowError(sourceNamespace,
Expand Down

0 comments on commit 403b2ef

Please sign in to comment.