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的连接方式

  • 相关阅读:
    WPF PasswordBox不支持绑定解决方法
    获取当前日期是第几个星期
    WPF 事件触发命令
    EntityFramework使用动态Lambda表达式筛选数据
    C#发邮件
    Entity Framework 多对多查询的写法
    获取WPF窗口句柄
    C#调整图片亮度和对比度
    oracle 批量修改数据
    react前端自动化测试: jest + enzyme
  • 原文地址:https://www.cnblogs.com/deemoo/p/15771710.html
Copyright © 2011-2022 走看看