官术网_书友最值得收藏!

  • Learning Apache Apex
  • Thomas Weise Munagala V. Ramanath David Yan Kenneth Knowles
  • 276字
  • 2021-07-02 22:38:40

CheckpointListener/CheckpointNotificationListener

This interface provides hooks for the operator developer to align behavior with the engine's checkpointing mechanism (which will be covered in detail in the Chapter 5, Fault Tolerance and Reliability). For now, it will be sufficient to understand that during checkpointing the state of the operator is externalized and saved to durable storage. In order to optimize this and align any additional fault tolerance support that the operator requires, the interfaces provide:

  • beforeCheckpoint: This is called before the engine extracts the state from the operator. This is an opportunity to update the state. For example, suppose the operator implementation needs to write state to a write ahead log and needs to remember the file name(s) and offset range(s) so that when there is a need to recover, it knows what to read. In this example, the operator would flush pending data to the file and the update it's state containing the offset information, so that the meta information is checkpointed and available during recovery.
  • checkpointed: This is called immediately after a checkpoint is completed. This could be used to optimize resources or record information about a completed checkpoint. In most cases, the operator or developer would implement beforeCheckpoint, however.
  • committed: This is called with the latest known streaming window interval identifier that was fully processed in the entire DAG and therefore will never need to be replayed during recovery. This is an opportunity for operator implementations to finalize state and make it available to external consumers. For example, a file writer could close intermediate files and move/rename them to the final location. Alternatively, incremental state saving mechanisms can materialize that state and drop recovery logs.
主站蜘蛛池模板: 长春市| 开化县| 大冶市| 武功县| 广州市| 永安市| 乐东| 瓮安县| 靖宇县| 三河市| 拉孜县| 交城县| 嘉义市| 巢湖市| 达州市| 密云县| 东港市| 柳河县| 孙吴县| 滨海县| 体育| 荣昌县| 盐池县| 蓬莱市| 云梦县| 长寿区| 瓮安县| 鹤山市| 楚雄市| 瑞丽市| 炉霍县| 满城县| 开鲁县| 洛隆县| 建瓯市| 山丹县| 册亨县| 长白| 霍城县| 田阳县| 漳浦县|