zoukankan      html  css  js  c++  java
  • spark streaming 监听器执行顺序

    trait StreamingListener {
    
      /** Called when the streaming has been started */
      def onStreamingStarted(streamingStarted: StreamingListenerStreamingStarted) { }
    
      /** Called when a receiver has been started */
      def onReceiverStarted(receiverStarted: StreamingListenerReceiverStarted) { }
    
      /** Called when a receiver has reported an error */
      def onReceiverError(receiverError: StreamingListenerReceiverError) { }
    
      /** Called when a receiver has been stopped */
      def onReceiverStopped(receiverStopped: StreamingListenerReceiverStopped) { }
    
      /** Called when a batch of jobs has been submitted for processing. */
      def onBatchSubmitted(batchSubmitted: StreamingListenerBatchSubmitted) { }
    
      /** Called when processing of a batch of jobs has started.  */
      def onBatchStarted(batchStarted: StreamingListenerBatchStarted) { }
    
      /** Called when processing of a batch of jobs has completed. */
      def onBatchCompleted(batchCompleted: StreamingListenerBatchCompleted) { }
    
      /** Called when processing of a job of a batch has started. */
      def onOutputOperationStarted(
          outputOperationStarted: StreamingListenerOutputOperationStarted) { }
    
      /** Called when processing of a job of a batch has completed. */
      def onOutputOperationCompleted(
          outputOperationCompleted: StreamingListenerOutputOperationCompleted) { }
    }
    

    顺序如下

    • 1.onStreamingStarted
    • 2.onBatchSubmitted
    • 3.onBatchStarted
    • 4.onOutputOperationStarted
    • your action operator
    • 5.onOutputOperationCompleted
    • 6.onBatchCompleted

    此处少了 onReceiverStarted() onReceiverError() onReceiverStopped() 是因为测试使用的kafka版本为0.10.x,没有receiver的连接方式

  • 相关阅读:
    LinQ&EF任我行(一)LinQ to SQL (转)
    WPF数据模板和控件模板
    Sql优化
    SQL锁表语句
    js动态创建dom
    js实现等待n秒后按钮可用
    js关于事件冒泡
    工作流学习(个人总结)
    sql常用函数
    将Datatable序列化为Json对象返回到客户端
  • 原文地址:https://www.cnblogs.com/deemoo/p/15771710.html
Copyright © 2011-2022 走看看