{"id":83001,"date":"2026-07-25T15:49:10","date_gmt":"2026-07-25T07:49:10","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/83001.html"},"modified":"2026-07-25T15:49:10","modified_gmt":"2026-07-25T07:49:10","slug":"%e5%8d%81%e4%ba%94%e3%80%81flink-%e6%a0%b8%e5%bf%83%e5%8e%9f%e7%90%86%e4%b8%8e%e6%9e%b6%e6%9e%84%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/83001.html","title":{"rendered":"\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3"},"content":{"rendered":"<h3>\u6982\u8ff0<\/h3>\n<p>Apache Flink \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u6d41\u5904\u7406\u6846\u67b6&#xff0c;\u88ab\u8bbe\u8ba1\u7528\u4e8e\u5728\u6709\u754c\u548c\u65e0\u754c\u6570\u636e\u6d41\u4e0a\u8fdb\u884c\u6709\u72b6\u6001\u7684\u8ba1\u7b97\u3002\u4e0e\u4f20\u7edf\u7684\u5fae\u6279\u5904\u7406&#xff08;Micro-Batch&#xff09;\u5f15\u64ce\u4e0d\u540c&#xff0c;Flink \u4ece\u5e95\u5c42\u5c31\u5c06\u6d41\u5904\u7406\u4f5c\u4e3a\u4e00\u7b49\u516c\u6c11\u2014\u2014\u6279\u5904\u7406\u4ec5\u4ec5\u662f\u6709\u754c\u6d41\u7684\u7279\u4f8b\u3002\u8fd9\u79cd&#034;\u6d41\u6279\u4e00\u4f53&#034;\u7684\u8bbe\u8ba1\u54f2\u5b66\u4f7f Flink \u80fd\u591f\u5728\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u541e\u5410\u548c\u7cbe\u786e\u4e00\u6b21&#xff08;Exactly-Once&#xff09;\u8bed\u4e49\u4e4b\u95f4\u53d6\u5f97\u5353\u8d8a\u7684\u5e73\u8861\u3002<\/p>\n<p>Flink \u7684\u6838\u5fc3\u80fd\u529b\u5305\u62ec&#xff1a;\u6709\u72b6\u6001\u8ba1\u7b97\u3001\u4e8b\u4ef6\u65f6\u95f4\u5904\u7406\u3001\u8f7b\u91cf\u7ea7\u5bb9\u9519\u3001\u9ad8\u541e\u5410\u4f4e\u5ef6\u8fdf\u3001\u4ee5\u53ca\u7075\u6d3b\u7684\u7a97\u53e3\u548c\u72b6\u6001\u7ba1\u7406\u3002\u76ee\u524d\u5df2\u88ab\u963f\u91cc\u5df4\u5df4\u3001Uber\u3001Netflix\u3001LinkedIn \u7b49\u516c\u53f8\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u5927\u89c4\u6a21\u4f7f\u7528&#xff0c;\u662f\u5b9e\u65f6\u8ba1\u7b97\u9886\u57df\u7684\u4e8b\u5b9e\u6807\u51c6\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u6574\u4f53\u67b6\u6784\u5206\u5c42<\/h3>\n<p>Flink \u7684\u8f6f\u4ef6\u67b6\u6784\u662f\u4e00\u4e2a\u5206\u5c42\u3001\u5206\u5e03\u5f0f\u3001\u4e3b\u4ece\u5f0f\u7684\u8bbe\u8ba1&#xff0c;\u4ece\u4e0a\u5230\u4e0b\u53ef\u4ee5\u5206\u4e3a\u56db\u5c42&#xff1a;<\/p>\n<h4>1.1 \u90e8\u7f72\u5c42&#xff08;Deployment Layer&#xff09;<\/h4>\n<p>Flink \u53ef\u4ee5\u8fd0\u884c\u5728\u591a\u79cd\u73af\u5883\u4e2d&#xff1a;<\/p>\n<ul>\n<li>Standalone \u6a21\u5f0f&#xff1a;Flink \u81ea\u5e26\u8d44\u6e90\u7ba1\u7406&#xff0c;\u4e0d\u4f9d\u8d56\u5916\u90e8\u7cfb\u7edf<\/li>\n<li>Flink on YARN&#xff1a;\u5229\u7528 Hadoop YARN \u4f5c\u4e3a\u8d44\u6e90\u8c03\u5ea6\u5668<\/li>\n<li>Flink on Kubernetes&#xff1a;\u539f\u751f\u4e91\u539f\u751f\u90e8\u7f72&#xff0c;\u652f\u6301\u5f39\u6027\u4f38\u7f29<\/li>\n<li>\u672c\u5730\u6a21\u5f0f&#xff1a;\u5355\u8fdb\u7a0b\u8fd0\u884c&#xff0c;\u7528\u4e8e\u5f00\u53d1\u548c\u8c03\u8bd5<\/li>\n<\/ul>\n<h4>1.2 \u7f16\u7a0b\u63a5\u53e3\u5c42&#xff08;API Layer&#xff09;<\/h4>\n<p>Flink \u63d0\u4f9b\u4e09\u5c42 API&#xff0c;\u62bd\u8c61\u7a0b\u5ea6\u4ece\u9ad8\u5230\u4f4e&#xff1a;<\/p>\n<table>\n<tr>\u5c42\u7ea7API\u9002\u7528\u4eba\u7fa4\u7279\u70b9<\/tr>\n<tbody>\n<tr>\n<td>\u6700\u9ad8\u5c42<\/td>\n<td>SQL &amp; Table API<\/td>\n<td>\u6570\u636e\u5206\u6790\u5e08<\/td>\n<td>\u58f0\u660e\u5f0f&#xff0c;\u81ea\u52a8\u4f18\u5316&#xff0c;\u6d41\u6279\u7edf\u4e00\u8bed\u4e49<\/td>\n<\/tr>\n<tr>\n<td>\u4e2d\u95f4\u5c42<\/td>\n<td>DataStream API<\/td>\n<td>\u5e94\u7528\u5f00\u53d1\u8005<\/td>\n<td>\u7cbe\u7ec6\u63a7\u5236\u6d41\u5904\u7406\u903b\u8f91&#xff0c;\u6838\u5fc3\u7f16\u7a0b\u6a21\u578b<\/td>\n<\/tr>\n<tr>\n<td>\u6700\u5e95\u5c42<\/td>\n<td>Stateful ProcessFunction<\/td>\n<td>\u9ad8\u7ea7\u5f00\u53d1\u8005<\/td>\n<td>\u76f4\u63a5\u64cd\u4f5c\u72b6\u6001\u548c\u5b9a\u65f6\u5668&#xff0c;\u6700\u7075\u6d3b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>SQL &amp; Table API \u662f\u6700\u5e38\u7528\u7684\u63a5\u53e3&#xff0c;\u652f\u6301\u6807\u51c6 SQL \u8bed\u6cd5&#xff0c;Flink \u5185\u90e8\u5c06\u5176\u7f16\u8bd1\u4f18\u5316\u4e3a DataStream \u7a0b\u5e8f\u6267\u884c\u3002DataStream API \u63d0\u4f9b\u4e86 map\u3001filter\u3001keyBy\u3001window\u3001join\u3001process \u7b49\u4e30\u5bcc\u7684\u7b97\u5b50&#xff0c;\u662f\u6784\u5efa\u590d\u6742\u6d41\u5904\u7406\u5e94\u7528\u7684\u57fa\u7840\u3002<\/p>\n<h4>1.3 \u8fd0\u884c\u65f6\u5c42&#xff08;Runtime Layer&#xff09;<\/h4>\n<p>\u8fd0\u884c\u65f6\u5c42\u662f Flink \u7684\u6838\u5fc3\u5f15\u64ce&#xff0c;\u8d1f\u8d23\u4f5c\u4e1a\u8c03\u5ea6\u3001\u8d44\u6e90\u7ba1\u7406\u548c\u5206\u5e03\u5f0f\u6267\u884c\u3002<\/p>\n<h4>1.4 \u5b58\u50a8\u5c42&#xff08;Storage Layer&#xff09;<\/h4>\n<p>\u5305\u62ec\u72b6\u6001\u540e\u7aef&#xff08;RocksDB\/Heap&#xff09;\u3001Checkpoint \u5b58\u50a8&#xff08;HDFS\/S3\/OSS&#xff09;\u548c\u9ad8\u53ef\u7528\u5b58\u50a8&#xff08;ZooKeeper\/K8s&#xff09;\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u6838\u5fc3\u7ec4\u4ef6\u8be6\u89e3<\/h3>\n<h4>2.1 JobManager&#xff08;Master \u8282\u70b9&#xff09;<\/h4>\n<p>JobManager \u662f Flink \u96c6\u7fa4\u7684&#034;\u5927\u8111&#034;&#xff0c;\u8d1f\u8d23\u6574\u4e2a\u4f5c\u4e1a\u7684\u751f\u547d\u5468\u671f\u7ba1\u7406\u3002\u5176\u5185\u90e8\u5305\u542b\u56db\u4e2a\u6838\u5fc3\u5b50\u7ec4\u4ef6&#xff1a;<\/p>\n<table>\n<tr>\u5b50\u7ec4\u4ef6\u804c\u8d23<\/tr>\n<tbody>\n<tr>\n<td>Dispatcher<\/td>\n<td>\u63a5\u6536\u7528\u6237\u63d0\u4ea4\u7684\u4f5c\u4e1a&#xff0c;\u6301\u4e45\u5316 JobGraph&#xff0c;\u4e3a\u6bcf\u4e2a\u4f5c\u4e1a\u521b\u5efa\u72ec\u7acb\u7684 JobMaster<\/td>\n<\/tr>\n<tr>\n<td>JobMaster<\/td>\n<td>\u8d1f\u8d23\u5355\u4e2a\u4f5c\u4e1a\u7684\u5168\u751f\u547d\u5468\u671f\u7ba1\u7406&#xff0c;\u5c06 JobGraph \u5c55\u5f00\u4e3a ExecutionGraph \u5e76\u8c03\u5ea6\u6267\u884c<\/td>\n<\/tr>\n<tr>\n<td>CheckpointCoordinator<\/td>\n<td>\u5468\u671f\u6027\u89e6\u53d1\u5206\u5e03\u5f0f\u5feb\u7167&#xff0c;\u534f\u8c03\u6240\u6709 TaskManager \u5b8c\u6210 Checkpoint<\/td>\n<\/tr>\n<tr>\n<td>ResourceManager<\/td>\n<td>\u7ba1\u7406 TaskManager \u53ca\u5176 Task Slot&#xff0c;\u4e0e\u5916\u90e8\u8d44\u6e90\u7cfb\u7edf&#xff08;YARN\/K8s&#xff09;\u4ea4\u4e92\u7533\u8bf7\u8d44\u6e90<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5728\u9ad8\u53ef\u7528&#xff08;HA&#xff09;\u6a21\u5f0f\u4e0b&#xff0c;\u96c6\u7fa4\u53ef\u4ee5\u90e8\u7f72\u591a\u4e2a JobManager&#xff0c;\u901a\u8fc7 ZooKeeper \u6216 Kubernetes \u8fdb\u884c Leader \u9009\u4e3e&#xff0c;\u786e\u4fdd\u53ea\u6709\u4e00\u4e2a Active JobManager&#xff0c;\u5176\u4f59\u4e3a Standby\u3002<\/p>\n<h4>2.2 TaskManager&#xff08;Worker \u8282\u70b9&#xff09;<\/h4>\n<p>TaskManager \u662f Flink \u7684&#034;\u5de5\u4eba&#034;&#xff0c;\u6240\u6709\u5b9e\u9645\u8ba1\u7b97\u5728\u6b64\u53d1\u751f\u3002\u6bcf\u4e2a TaskManager \u7ba1\u7406\u82e5\u5e72 Task Slot&#xff08;\u4efb\u52a1\u69fd&#xff09;&#xff1a;<\/p>\n<ul>\n<li>Task Slot \u662f\u8d44\u6e90\u8c03\u5ea6\u7684\u57fa\u672c\u5355\u4f4d&#xff0c;\u4ee3\u8868 TaskManager \u5185\u5b58\u7684\u4e00\u4e2a\u56fa\u5b9a\u5b50\u96c6<\/li>\n<li>\u6bcf\u4e2a Slot \u8fd0\u884c\u4e00\u4e2a Task&#xff08;\u53ef\u5305\u542b\u591a\u4e2a\u901a\u8fc7\u7b97\u5b50\u94fe\u878d\u5408\u7684 Subtask&#xff09;<\/li>\n<li>\u4e00\u4e2a Subtask \u662f\u4e00\u4e2a\u7b97\u5b50\u7684\u4e00\u4e2a\u5e76\u884c\u5b9e\u4f8b<\/li>\n<\/ul>\n<p>TaskManager \u7684\u5173\u952e\u6a21\u5757&#xff1a;<\/p>\n<ul>\n<li>Operator Chain&#xff1a;\u5c06\u591a\u4e2a\u7b97\u5b50\u878d\u5408\u5728\u540c\u4e00\u7ebf\u7a0b\u4e2d\u6267\u884c&#xff0c;\u51cf\u5c11\u5e8f\u5217\u5316\/\u7f51\u7edc\u5f00\u9500<\/li>\n<li>Network Stack&#xff1a;\u57fa\u4e8e Netty &#043; Credit-based \u6d41\u63a7&#xff0c;\u7ba1\u7406 Task \u95f4\u6570\u636e\u4f20\u8f93<\/li>\n<li>Memory Manager&#xff1a;\u7ba1\u7406 Managed Memory&#xff08;\u7528\u4e8e\u6392\u5e8f\u3001\u54c8\u5e0c\u3001\u72b6\u6001\u5b58\u50a8\u7b49&#xff09;<\/li>\n<li>State Backend&#xff1a;\u5b58\u50a8\u548c\u7ba1\u7406\u7b97\u5b50\u72b6\u6001<\/li>\n<\/ul>\n<h4>2.3 Client&#xff08;\u5ba2\u6237\u7aef&#xff09;<\/h4>\n<p>Client \u4e0d\u662f\u8fd0\u884c\u65f6\u7684\u7ec4\u6210\u90e8\u5206&#xff0c;\u5b83\u8d1f\u8d23&#xff1a;<\/p>\n<ul>\n<li>\u89e3\u6790\u7528\u6237\u4ee3\u7801&#xff0c;\u6784\u5efa StreamGraph<\/li>\n<li>\u4f18\u5316\u4e3a JobGraph&#xff08;\u7b97\u5b50\u94fe\u5408\u5e76&#xff09;<\/li>\n<li>\u901a\u8fc7 HTTP REST \u63a5\u53e3\u63d0\u4ea4\u7ed9 Dispatcher<\/li>\n<li>\u652f\u6301 CLI \/ REST API \/ Web UI \u4e09\u79cd\u64cd\u4f5c\u65b9\u5f0f<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e09\u3001\u4f5c\u4e1a\u6267\u884c\u6d41\u7a0b<\/h3>\n<p>Flink \u4f5c\u4e1a\u4ece\u63d0\u4ea4\u5230\u8fd0\u884c&#xff0c;\u7ecf\u5386\u56db\u5c42\u56fe\u8f6c\u5316&#xff1a;<\/p>\n<p>\u7528\u6237\u4ee3\u7801<br \/>\n   \u2193<br \/>\nStreamGraph&#xff08;\u903b\u8f91\u62d3\u6251&#xff0c;\u5305\u542b\u6240\u6709\u7b97\u5b50\u8282\u70b9\u548c\u8fb9&#xff09;<br \/>\n   \u2193 \u7b97\u5b50\u94fe\u5408\u5e76\u4f18\u5316<br \/>\nJobGraph&#xff08;\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u5e8f\u5217\u5316\/\u53cd\u5e8f\u5217\u5316&#xff09;<br \/>\n   \u2193 \u63d0\u4ea4\u5230 Dispatcher<br \/>\nExecutionGraph&#xff08;\u7269\u7406\u6267\u884c\u8ba1\u5212&#xff0c;\u5305\u542b\u5e76\u884c\u5b9e\u4f8b\u548c\u7f51\u7edc\u62d3\u6251&#xff09;<br \/>\n   \u2193 \u8c03\u5ea6\u6267\u884c<br \/>\nTask \u5728 TaskManager \u7684 Slot \u4e2d\u8fd0\u884c<\/p>\n<p>\u8be6\u7ec6\u6d41\u7a0b&#xff1a;<\/p>\n<li>\u5ba2\u6237\u7aef\u6784\u5efa StreamGraph&#xff1a;\u7528\u6237\u901a\u8fc7 DataStream API \u6216 SQL \u7f16\u5199\u4f5c\u4e1a\u903b\u8f91&#xff0c;Client \u89e3\u6790\u7b97\u5b50 DAG&#xff0c;\u6784\u5efa\u7eaf\u903b\u8f91\u7684 StreamGraph<\/li>\n<li>\u4f18\u5316\u4e3a JobGraph&#xff1a;Client \u5bf9 StreamGraph \u8fdb\u884c\u7b97\u5b50\u94fe&#xff08;Operator Chain&#xff09;\u5408\u5e76\u4f18\u5316&#xff0c;\u751f\u6210\u53ef\u63d0\u4ea4\u7684 JobGraph<\/li>\n<li>\u63d0\u4ea4\u7ed9 Dispatcher&#xff1a;JobGraph &#043; \u7528\u6237 Jar \u5305\u901a\u8fc7 HTTP REST \u63a5\u53e3\u53d1\u9001\u81f3 Dispatcher<\/li>\n<li>\u521b\u5efa JobMaster&#xff1a;Dispatcher \u5c06 JobGraph \u6301\u4e45\u5316\u5230 HA \u5b58\u50a8&#xff0c;\u521b\u5efa\u4e13\u5c5e JobMaster<\/li>\n<li>\u5c55\u5f00\u4e3a ExecutionGraph&#xff1a;JobMaster \u5c06 JobGraph \u5c55\u5f00\u4e3a ExecutionGraph&#xff0c;\u5305\u542b\u6240\u6709\u5e76\u884c\u5b9e\u4f8b\u548c\u7f51\u7edc\u8fde\u63a5<\/li>\n<li>\u8c03\u5ea6\u6267\u884c&#xff1a;JobMaster \u5411 ResourceManager \u7533\u8bf7 Slot \u8d44\u6e90&#xff0c;\u5c06 Task \u8c03\u5ea6\u5230 TaskManager \u6267\u884c<\/li>\n<li>\u6570\u636e\u6d41\u5904\u7406&#xff1a;Task \u4e4b\u95f4\u901a\u8fc7 Pipeline \u6570\u636e\u4ea4\u6362\u6a21\u5f0f\u8fdb\u884c\u5b9e\u65f6\u6570\u636e\u4f20\u8f93<\/li>\n<li>\u72b6\u6001\u76d1\u63a7\u4e0e\u5bb9\u9519&#xff1a;CheckpointCoordinator \u5b9a\u671f\u89e6\u53d1\u5feb\u7167&#xff0c;TaskManager \u6301\u7eed\u4e0a\u62a5\u5fc3\u8df3<\/li>\n<hr \/>\n<h3>\u56db\u3001\u6838\u5fc3\u673a\u5236<\/h3>\n<h4>4.1 \u7b97\u5b50\u94fe&#xff08;Operator Chain&#xff09;<\/h4>\n<p>Flink \u4e3a\u4e86\u4f18\u5316\u6027\u80fd&#xff0c;\u4f1a\u5c06\u591a\u4e2a\u6ee1\u8db3\u6761\u4ef6\u7684\u7b97\u5b50\u878d\u5408\u4e3a\u4e00\u4e2a Task&#xff0c;\u5728\u540c\u4e00\u4e2a\u7ebf\u7a0b\u4e2d\u6267\u884c\u3002\u8fd9\u79f0\u4e3a\u7b97\u5b50\u94fe&#xff08;Operator Chaining&#xff09;\u3002<\/p>\n<p>\u878d\u5408\u6761\u4ef6&#xff08;\u5fc5\u987b\u540c\u65f6\u6ee1\u8db3&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u7b97\u5b50\u4e4b\u95f4\u662f One-to-One \u8fde\u63a5&#xff08;\u5982 map \u2192 filter \u2192 keyBy \u4e2d\u7684 map \u2192 filter&#xff09;<\/li>\n<li>\u7b97\u5b50\u5177\u6709\u76f8\u540c\u7684\u5e76\u884c\u5ea6<\/li>\n<li>\u7b97\u5b50\u5c5e\u4e8e\u76f8\u540c\u7684 Slot \u5171\u4eab\u7ec4<\/li>\n<li>\u6ca1\u6709\u88ab\u7528\u6237\u901a\u8fc7 disableChaining() \u663e\u5f0f\u7981\u7528<\/li>\n<\/ul>\n<p>\u597d\u5904&#xff1a; \u907f\u514d\u4e0d\u5fc5\u8981\u7684\u5e8f\u5217\u5316\/\u53cd\u5e8f\u5217\u5316\u548c\u7f51\u7edc\u4f20\u8f93\u5f00\u9500&#xff0c;\u663e\u8457\u964d\u4f4e\u5ef6\u8fdf\u3002<\/p>\n<h4>4.2 \u5e76\u884c\u5ea6&#xff08;Parallelism&#xff09;<\/h4>\n<p>Flink \u7684\u6bcf\u4e2a\u7b97\u5b50\u90fd\u53ef\u4ee5\u72ec\u7acb\u8bbe\u7f6e\u5e76\u884c\u5ea6\u3002\u4e00\u4e2a\u7b97\u5b50\u7684\u591a\u4e2a\u5e76\u884c\u5b9e\u4f8b\u79f0\u4e3a Subtask&#xff08;\u5b50\u4efb\u52a1&#xff09;&#xff0c;\u5b83\u4eec\u53ef\u4ee5\u8fd0\u884c\u5728\u4e0d\u540c\u7684 TaskManager \u4e0a\u3002<\/p>\n<p>Source&#xff08;\u5e76\u884c\u5ea6&#061;3&#xff09;\u2192 Map&#xff08;\u5e76\u884c\u5ea6&#061;3&#xff09;\u2192 KeyBy\/Window&#xff08;\u5e76\u884c\u5ea6&#061;2&#xff09;\u2192 Sink&#xff08;\u5e76\u884c\u5ea6&#061;1&#xff09;<\/p>\n<p>    Source-0  \u2500\u2500\u2510<br \/>\n    Source-1  \u2500\u2500\u253c\u2500\u2500 Map-0 \u2500\u2500\u2510<br \/>\n    Source-2  \u2500\u2500\u2518   Map-1 \u2500\u2500\u253c\u2500\u2500 Window-0 \u2500\u2500 Sink-0<br \/>\n                Map-2 \u2500\u2500\u2518   Window-1 \u2500\u2500\u2518<\/p>\n<ul>\n<li>\u5e76\u884c\u5ea6\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u8bbe\u7f6e&#xff0c;\u4e5f\u53ef\u4ee5\u5728\u5168\u5c40\u914d\u7f6e\u4e2d\u6307\u5b9a<\/li>\n<li>Flink 2.0 \u8fdb\u4e00\u6b65\u652f\u6301\u4e86\u52a8\u6001\u5e76\u884c\u5ea6\u8c03\u6574&#xff08;Adaptive Scheduler&#xff09;&#xff0c;\u6839\u636e\u8fd0\u884c\u65f6\u8d1f\u8f7d\u81ea\u52a8\u4f18\u5316<\/li>\n<\/ul>\n<h4>4.3 \u6570\u636e\u4ea4\u6362\u6a21\u5f0f<\/h4>\n<p>Flink \u5728 Task \u4e4b\u95f4\u91c7\u7528 Pipeline \u6570\u636e\u4ea4\u6362\u6a21\u5f0f&#xff1a;<\/p>\n<ul>\n<li>One-to-One&#xff08;Forwarding&#xff09;&#xff1a;\u6570\u636e\u5728\u4e0a\u4e0b\u6e38 Subtask \u4e4b\u95f4\u4e00\u4e00\u5bf9\u5e94\u4f20\u8f93&#xff0c;\u4fdd\u6301\u5206\u533a\u4e0d\u53d8<\/li>\n<li>Redistributing&#xff08;Shuffle&#xff09;&#xff1a;\u6570\u636e\u7ecf\u8fc7\u91cd\u5206\u533a\u540e\u4f20\u8f93&#xff0c;\u5305\u62ec&#xff1a;\n<ul>\n<li>Hash \u5206\u533a&#xff08;keyBy \u540e\u7684\u9ed8\u8ba4\u65b9\u5f0f&#xff09;<\/li>\n<li>Broadcast&#xff08;\u5e7f\u64ad\u5230\u6240\u6709\u4e0b\u6e38&#xff09;<\/li>\n<li>Global&#xff08;\u5168\u90e8\u53d1\u5f80\u4e0b\u6e38\u7b2c\u4e00\u4e2a Subtask&#xff09;<\/li>\n<li>Rescale&#xff08;\u5728\u5c40\u90e8\u8303\u56f4\u5185\u8f6e\u8be2\u5206\u53d1&#xff09;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Pipeline \u4ea4\u6362\u7684\u6838\u5fc3\u4f18\u52bf&#xff1a;\u6570\u636e\u4ea7\u751f\u540e\u7acb\u5373\u63a8\u9001\u7ed9\u4e0b\u6e38&#xff0c;\u5b9e\u73b0\u771f\u6b63\u7684\u6d41\u5f0f\u5904\u7406&#xff0c;\u5ef6\u8fdf\u6781\u4f4e\u3002<\/p>\n<hr \/>\n<h3>\u4e94\u3001\u72b6\u6001\u7ba1\u7406<\/h3>\n<p>\u72b6\u6001\u7ba1\u7406\u662f Flink \u6700\u6838\u5fc3\u7684\u80fd\u529b\u4e4b\u4e00&#xff0c;\u4f7f\u6d41\u5f0f\u5e94\u7528\u80fd\u591f&#034;\u8bb0\u4f4f\u8fc7\u53bb\u7684\u4e8b\u4ef6&#034;\u5e76\u5f71\u54cd\u672a\u6765\u5904\u7406\u3002<\/p>\n<h4>5.1 \u72b6\u6001\u7c7b\u578b<\/h4>\n<table>\n<tr>\u7c7b\u578b\u4f5c\u7528\u57df\u8bf4\u660e\u5178\u578b\u573a\u666f<\/tr>\n<tbody>\n<tr>\n<td>Keyed State<\/td>\n<td>\u6309 Key \u5206\u533a<\/td>\n<td>\u6bcf\u4e2a Key \u7ef4\u62a4\u72ec\u7acb\u7684\u72b6\u6001\u5b9e\u4f8b<\/td>\n<td>\u7528\u6237\u7d2f\u8ba1\u6d88\u8d39\u91d1\u989d<\/td>\n<\/tr>\n<tr>\n<td>Operator State<\/td>\n<td>\u7b97\u5b50\u7ea7\u522b<\/td>\n<td>\u6574\u4e2a\u7b97\u5b50\u5171\u4eab\u4e00\u4efd\u72b6\u6001<\/td>\n<td>Kafka Consumer \u7684 offset<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Keyed State \u7684\u5b50\u7c7b\u578b&#xff1a;<\/p>\n<ul>\n<li>ValueState&#xff1a;\u5b58\u50a8\u5355\u4e2a\u503c<\/li>\n<li>ListState&#xff1a;\u5b58\u50a8\u4e00\u4e2a\u5217\u8868<\/li>\n<li>MapState&#xff1a;\u5b58\u50a8\u952e\u503c\u5bf9\u6620\u5c04<\/li>\n<li>ReducingState&#xff1a;\u901a\u8fc7 ReduceFunction \u805a\u5408<\/li>\n<li>AggregatingState&#xff1a;\u901a\u8fc7 AggregateFunction \u805a\u5408<\/li>\n<\/ul>\n<h4>5.2 \u72b6\u6001\u540e\u7aef<\/h4>\n<table>\n<tr>\u540e\u7aef\u5b58\u50a8\u4f4d\u7f6e\u9002\u7528\u573a\u666f\u7279\u70b9<\/tr>\n<tbody>\n<tr>\n<td>HashMapStateBackend<\/td>\n<td>JVM \u5806\u5185\u5b58<\/td>\n<td>\u72b6\u6001\u8f83\u5c0f\u3001\u5bf9\u5ef6\u8fdf\u654f\u611f<\/td>\n<td>\u8bbf\u95ee\u5feb&#xff0c;\u4f46\u53d7\u5185\u5b58\u9650\u5236<\/td>\n<\/tr>\n<tr>\n<td>EmbeddedRocksDBStateBackend&#xff08;Flink 1.x&#xff09;<\/td>\n<td>\u672c\u5730\u78c1\u76d8&#xff08;\u5d4c\u5165\u5f0f RocksDB&#xff09;<\/td>\n<td>\u72b6\u6001\u8f83\u5927&#xff08;GB~TB \u7ea7&#xff09;<\/td>\n<td>\u4e0d\u53d7\u5185\u5b58\u9650\u5236&#xff0c;\u4f46\u8bbf\u95ee\u6709\u78c1\u76d8 I\/O \u5f00\u9500<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>5.3 \u72b6\u6001 TTL<\/h4>\n<p>\u53ef\u4ee5\u4e3a\u72b6\u6001\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4&#xff08;Time-To-Live&#xff09;&#xff0c;\u81ea\u52a8\u6e05\u7406\u4e0d\u518d\u4f7f\u7528\u7684\u72b6\u6001\u6570\u636e&#xff0c;\u9632\u6b62\u72b6\u6001\u65e0\u9650\u81a8\u80c0&#xff1a;<\/p>\n<p><span class=\"token class-name\">StateTtlConfig<\/span> ttlConfig <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">StateTtlConfig<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">newBuilder<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Time<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">hours<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">24<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">setUpdateType<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">StateTtlConfig<span class=\"token punctuation\">.<\/span>UpdateType<span class=\"token punctuation\">.<\/span>OnCreateAndWrite<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">setStateVisibility<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">StateTtlConfig<span class=\"token punctuation\">.<\/span>StateVisibility<span class=\"token punctuation\">.<\/span>NeverReturnExpired<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">cleanupInRocksdbCompactFilter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1000<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">build<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<hr \/>\n<h3>\u516d\u3001\u65f6\u95f4\u8bed\u4e49\u4e0e\u7a97\u53e3<\/h3>\n<h4>6.1 \u4e09\u79cd\u65f6\u95f4\u8bed\u4e49<\/h4>\n<table>\n<tr>\u65f6\u95f4\u7c7b\u578b\u542b\u4e49\u7279\u70b9<\/tr>\n<tbody>\n<tr>\n<td>Event Time<\/td>\n<td>\u4e8b\u4ef6\u53d1\u751f\u7684\u65f6\u95f4&#xff08;\u6570\u636e\u81ea\u5e26&#xff09;<\/td>\n<td>\u6700\u7cbe\u786e&#xff0c;\u80fd\u5904\u7406\u4e71\u5e8f\u6570\u636e&#xff0c;\u4f9d\u8d56 Watermark<\/td>\n<\/tr>\n<tr>\n<td>Processing Time<\/td>\n<td>\u6570\u636e\u5230\u8fbe\u7b97\u5b50\u65f6\u7684\u7cfb\u7edf\u65f6\u95f4<\/td>\n<td>\u6700\u7b80\u5355&#xff0c;\u5ef6\u8fdf\u6700\u4f4e&#xff0c;\u4f46\u7ed3\u679c\u4e0d\u786e\u5b9a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>6.2 Watermark&#xff08;\u6c34\u4f4d\u7ebf&#xff09;\u673a\u5236<\/h4>\n<p>Watermark \u662f Flink \u5904\u7406\u4e71\u5e8f\u6570\u636e\u7684\u6838\u5fc3\u673a\u5236&#xff0c;\u7528\u4e8e\u8861\u91cf\u4e8b\u4ef6\u65f6\u95f4\u7684\u8fdb\u5c55&#xff1a;<\/p>\n<p>\u6570\u636e\u6d41&#xff1a;  [t&#061;10] [t&#061;12] [t&#061;11] [t&#061;15] [W(t&#061;13)] [t&#061;14] [t&#061;16] [W(t&#061;15)]<br \/>\n                                    \u2191                        \u2191<br \/>\n                              Watermark&#061;13             Watermark&#061;15<\/p>\n<ul>\n<li>Watermark &#061; \u5f53\u524d\u6700\u5927\u4e8b\u4ef6\u65f6\u95f4 &#8211; \u5141\u8bb8\u7684\u6700\u5927\u4e71\u5e8f\u65f6\u95f4<\/li>\n<li>\u5f53 Watermark \u8fbe\u5230\u6216\u8d85\u8fc7\u7a97\u53e3\u7ed3\u675f\u65f6\u95f4\u65f6&#xff0c;\u89e6\u53d1\u7a97\u53e3\u8ba1\u7b97<\/li>\n<li>\u665a\u4e8e Watermark \u7684\u6570\u636e\u88ab\u89c6\u4e3a\u8fdf\u5230\u6570\u636e&#xff0c;\u53ef\u901a\u8fc7\u4fa7\u8f93\u51fa\u6d41&#xff08;Side Output&#xff09;\u5904\u7406<\/li>\n<\/ul>\n<p>Watermark \u751f\u6210\u7b56\u7565&#xff1a;<\/p>\n<ul>\n<li>BoundedOutOfOrderness&#xff1a;\u5141\u8bb8\u56fa\u5b9a\u65f6\u95f4\u7684\u4e71\u5e8f&#xff08;\u6700\u5e38\u7528&#xff09;<\/li>\n<li>Monotonous Timestamps&#xff1a;\u5047\u8bbe\u65f6\u95f4\u6233\u5355\u8c03\u9012\u589e&#xff08;\u65e0\u4e71\u5e8f&#xff09;<\/li>\n<li>\u81ea\u5b9a\u4e49\u7b56\u7565&#xff1a;\u6839\u636e\u4e1a\u52a1\u7279\u70b9\u81ea\u5b9a\u4e49 Watermark \u751f\u6210\u903b\u8f91<\/li>\n<\/ul>\n<h4>6.3 \u7a97\u53e3\u7c7b\u578b<\/h4>\n<table>\n<tr>\u7a97\u53e3\u7c7b\u578b\u7279\u70b9\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>\u6eda\u52a8\u7a97\u53e3&#xff08;Tumbling&#xff09;<\/td>\n<td>\u56fa\u5b9a\u5927\u5c0f\u3001\u65e0\u91cd\u53e0<\/td>\n<td>\u6bcf5\u5206\u949f\u7edf\u8ba1\u4e00\u6b21<\/td>\n<\/tr>\n<tr>\n<td>\u6ed1\u52a8\u7a97\u53e3&#xff08;Sliding&#xff09;<\/td>\n<td>\u56fa\u5b9a\u5927\u5c0f\u3001\u6709\u91cd\u53e0<\/td>\n<td>\u6bcf1\u5206\u949f\u7edf\u8ba1\u6700\u8fd15\u5206\u949f\u7684\u6570\u636e<\/td>\n<\/tr>\n<tr>\n<td>\u4f1a\u8bdd\u7a97\u53e3&#xff08;Session&#xff09;<\/td>\n<td>\u57fa\u4e8e\u6d3b\u52a8\u95f4\u9699\u52a8\u6001\u5212\u5206<\/td>\n<td>\u7528\u6237\u65e0\u64cd\u4f5c\u8d85\u8fc730\u5206\u949f\u5219\u5173\u95ed\u7a97\u53e3<\/td>\n<\/tr>\n<tr>\n<td>\u5168\u5c40\u7a97\u53e3&#xff08;Global&#xff09;<\/td>\n<td>\u9ed8\u8ba4\u4e0d\u89e6\u53d1&#xff0c;\u9700\u81ea\u5b9a\u4e49 Trigger<\/td>\n<td>\u81ea\u5b9a\u4e49\u89e6\u53d1\u903b\u8f91<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7a97\u53e3\u751f\u547d\u5468\u671f&#xff1a;<\/p>\n<p>\u6570\u636e\u8fdb\u5165 \u2192 \u5206\u914d\u5230\u7a97\u53e3 \u2192 \u89e6\u53d1\u5668&#xff08;Trigger&#xff09;\u51b3\u5b9a\u662f\u5426\u89e6\u53d1\u8ba1\u7b97<br \/>\n    \u2192 \u7a97\u53e3\u51fd\u6570\u6267\u884c \u2192 \u9a71\u9010\u5668&#xff08;Evictor&#xff09;\u53ef\u9009\u6e05\u7406\u6570\u636e \u2192 \u8f93\u51fa\u7ed3\u679c<\/p>\n<hr \/>\n<h3>\u4e03\u3001\u5bb9\u9519\u673a\u5236&#xff08;Checkpoint&#xff09;<\/h3>\n<h4>7.1 Checkpoint \u539f\u7406<\/h4>\n<p>Flink \u7684\u5bb9\u9519\u57fa\u4e8e Chandy-Lamport \u5206\u5e03\u5f0f\u5feb\u7167\u7b97\u6cd5\u7684\u53d8\u4f53\u2014\u2014\u5f02\u6b65\u5c4f\u969c\u5feb\u7167&#xff08;Asynchronous Barrier Snapshotting&#xff09;\u3002<\/p>\n<p>\u6838\u5fc3\u6d41\u7a0b&#xff1a;<\/p>\n<li>JobManager \u89e6\u53d1 Checkpoint&#xff1a;CheckpointCoordinator \u5468\u671f\u6027\u5730\u5411\u6240\u6709 Source \u7b97\u5b50\u6ce8\u5165 Barrier&#xff08;\u5c4f\u969c\u6807\u8bb0&#xff09;<\/li>\n<li>Barrier \u968f\u6570\u636e\u6d41\u4f20\u9012&#xff1a;Barrier \u4f5c\u4e3a\u6570\u636e\u6d41\u4e2d\u7684\u7279\u6b8a\u6807\u8bb0&#xff0c;\u968f\u6570\u636e\u4e00\u8d77\u6d41\u5411\u4e0b\u6e38<\/li>\n<li>\u7b97\u5b50\u6536\u5230 Barrier \u540e\u6301\u4e45\u5316\u72b6\u6001&#xff1a;\u6bcf\u4e2a\u7b97\u5b50\u6536\u5230 Barrier \u540e&#xff0c;\u5c06\u5f53\u524d\u72b6\u6001\u5feb\u7167\u5f02\u6b65\u5199\u5165\u540e\u7aef\u5b58\u50a8&#xff08;HDFS\/S3&#xff09;<\/li>\n<li>Barrier \u5bf9\u9f50&#xff08;Exactly-Once \u6a21\u5f0f&#xff09;&#xff1a;\u5f53\u7b97\u5b50\u6709\u591a\u4e2a\u8f93\u5165\u65f6&#xff0c;\u9700\u7b49\u5f85\u6240\u6709\u8f93\u5165\u7684 Barrier \u5230\u8fbe\u540e\u624d\u6267\u884c\u5feb\u7167<\/li>\n<li>\u786e\u8ba4\u5b8c\u6210&#xff1a;\u6240\u6709\u7b97\u5b50\u5b8c\u6210\u5feb\u7167\u540e&#xff0c;JobManager \u6536\u5230\u786e\u8ba4&#xff0c;\u8be5 Checkpoint \u5b8c\u6210<\/li>\n<h4>7.2 Checkpoint vs Savepoint<\/h4>\n<table>\n<tr>\u7279\u6027CheckpointSavepoint<\/tr>\n<tbody>\n<tr>\n<td>\u89e6\u53d1\u65b9\u5f0f<\/td>\n<td>\u81ea\u52a8\u5468\u671f\u6027\u89e6\u53d1<\/td>\n<td>\u7528\u6237\u624b\u52a8\u89e6\u53d1<\/td>\n<\/tr>\n<tr>\n<td>\u7528\u9014<\/td>\n<td>\u6545\u969c\u6062\u590d<\/td>\n<td>\u4f5c\u4e1a\u5347\u7ea7\/\u8fc1\u79fb\/\u7248\u672c\u53d8\u66f4<\/td>\n<\/tr>\n<tr>\n<td>\u5b58\u50a8\u4f4d\u7f6e<\/td>\n<td>\u7531 Flink \u7ba1\u7406<\/td>\n<td>\u7531\u7528\u6237\u7ba1\u7406&#xff08;\u5916\u90e8\u5b58\u50a8&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u683c\u5f0f<\/td>\n<td>\u8f7b\u91cf\u7ea7&#xff0c;\u4f18\u5316\u6027\u80fd<\/td>\n<td>\u6807\u51c6\u5316&#xff0c;\u652f\u6301\u8de8\u7248\u672c\u517c\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>\u751f\u547d\u5468\u671f<\/td>\n<td>\u65e7 Checkpoint \u81ea\u52a8\u6e05\u7406<\/td>\n<td>\u6c38\u4e45\u4fdd\u7559\u76f4\u5230\u624b\u52a8\u5220\u9664<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>7.3 \u975e\u5bf9\u9f50 Checkpoint&#xff08;Unaligned Checkpoint&#xff09;<\/h4>\n<p>\u4f20\u7edf\u5bf9\u9f50 Checkpoint \u7684\u95ee\u9898&#xff1a;\u5f53\u5b58\u5728**\u53cd\u538b&#xff08;Backpressure&#xff09;**\u65f6&#xff0c;Barrier \u5728\u53cd\u538b\u8282\u70b9\u5806\u79ef&#xff0c;\u5bfc\u81f4 Checkpoint \u8d85\u65f6\u3002<\/p>\n<p>\u975e\u5bf9\u9f50 Checkpoint \u7684\u89e3\u51b3\u65b9\u6848&#xff1a;<\/p>\n<ul>\n<li>Barrier \u4e0d\u518d\u7b49\u5f85\u6240\u6709\u8f93\u5165\u5bf9\u9f50<\/li>\n<li>\u672a\u5bf9\u9f50\u7684\u6570\u636e\u4e5f\u88ab\u5305\u542b\u5728\u72b6\u6001\u5feb\u7167\u4e2d<\/li>\n<li>\u4ee3\u4ef7&#xff1a;\u72b6\u6001\u5feb\u7167\u66f4\u5927&#xff0c;\u4f46 Checkpoint \u65f6\u95f4\u4e0e\u53cd\u538b\u65e0\u5173<\/li>\n<\/ul>\n<hr \/>\n<h3>\u516b\u3001\u7a97\u53e3\u51fd\u6570\u4e0e\u805a\u5408<\/h3>\n<h4>8.1 \u589e\u91cf\u805a\u5408\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>ReduceFunction<\/td>\n<td>\u6bcf\u6b21\u8f93\u5165\u4e0e\u5f53\u524d\u7d2f\u79ef\u503c\u5408\u5e76&#xff0c;\u8f93\u51fa\u65b0\u7684\u7d2f\u79ef\u503c<\/td>\n<\/tr>\n<tr>\n<td>AggregateFunction<\/td>\n<td>\u66f4\u7075\u6d3b\u7684\u805a\u5408&#xff0c;\u652f\u6301\u7d2f\u52a0\u5668&#xff08;Accumulator&#xff09;\u7c7b\u578b<\/td>\n<\/tr>\n<tr>\n<td>FoldFunction<\/td>\n<td>\u7c7b\u4f3c ReduceFunction&#xff0c;\u4f46\u8f93\u5165\u548c\u7d2f\u52a0\u5668\u7c7b\u578b\u53ef\u4ee5\u4e0d\u540c&#xff08;\u5df2\u5e9f\u5f03&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>8.2 \u5168\u91cf\u7a97\u53e3\u51fd\u6570<\/h4>\n<table>\n<tr>\u51fd\u6570\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>ProcessWindowFunction<\/td>\n<td>\u63a5\u6536\u7a97\u53e3\u5185\u6240\u6709\u6570\u636e&#xff0c;\u63d0\u4f9b\u5168\u5c40\u4e0a\u4e0b\u6587&#xff08;\u7a97\u53e3\u8d77\u6b62\u65f6\u95f4\u3001\u72b6\u6001\u3001\u5b9a\u65f6\u5668\u7b49&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>ApplyWindowFunction<\/td>\n<td>\u7b80\u5316\u7248\u7684 ProcessWindowFunction<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>8.3 \u7ec4\u5408\u4f7f\u7528\u793a\u4f8b<\/h4>\n<p>dataStream<br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">keyBy<\/span><span class=\"token punctuation\">(<\/span>event <span class=\"token operator\">-&gt;<\/span> event<span class=\"token punctuation\">.<\/span><span class=\"token function\">getUserId<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">window<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">TumblingEventTimeWindows<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">of<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Time<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">minutes<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">aggregate<\/span><span class=\"token punctuation\">(<\/span><br \/>\n        <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">CountAgg<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>          <span class=\"token comment\">\/\/ \u589e\u91cf\u805a\u5408&#xff1a;\u5feb\u901f\u8ba1\u7b97\u4e2d\u95f4\u7ed3\u679c<\/span><br \/>\n        <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">WindowResultFunction<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token comment\">\/\/ \u5168\u91cf\u51fd\u6570&#xff1a;\u9644\u52a0\u7a97\u53e3\u5143\u4fe1\u606f<\/span><br \/>\n    <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<hr \/>\n<h3>\u4e5d\u3001Connector \u4e0e\u6570\u636e\u6e90<\/h3>\n<p>Flink \u901a\u8fc7 Connector \u4e0e\u5916\u90e8\u7cfb\u7edf\u96c6\u6210&#xff1a;<\/p>\n<table>\n<tr>Connector\u65b9\u5411\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>Kafka<\/td>\n<td>Source &#043; Sink<\/td>\n<td>\u6700\u5e38\u7528\u7684\u6d88\u606f\u961f\u5217 Connector&#xff0c;\u652f\u6301 Exactly-Once<\/td>\n<\/tr>\n<tr>\n<td>JDBC<\/td>\n<td>Source &#043; Sink<\/td>\n<td>\u5173\u7cfb\u578b\u6570\u636e\u5e93\u8bfb\u5199<\/td>\n<\/tr>\n<tr>\n<td>Elasticsearch<\/td>\n<td>Sink<\/td>\n<td>\u5199\u5165 ES \u7d22\u5f15<\/td>\n<\/tr>\n<tr>\n<td>HDFS<\/td>\n<td>Source &#043; Sink<\/td>\n<td>\u6587\u4ef6\u7cfb\u7edf\u8bfb\u5199&#xff0c;\u652f\u6301 Parquet\/ORC \u7b49\u683c\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>Redis<\/td>\n<td>Source &#043; Sink<\/td>\n<td>\u952e\u503c\u5b58\u50a8\u4ea4\u4e92<\/td>\n<\/tr>\n<tr>\n<td>CDC&#xff08;Change Data Capture&#xff09;<\/td>\n<td>Source<\/td>\n<td>\u5b9e\u65f6\u6355\u83b7\u6570\u636e\u5e93\u53d8\u66f4&#xff08;MySQL\/PostgreSQL\/Oracle&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Paimon<\/td>\n<td>Source &#043; Sink<\/td>\n<td>\u6d41\u5f0f\u6e56\u5b58\u50a8&#xff0c;\u4e0e Flink \u6df1\u5ea6\u96c6\u6210<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Flink CDC \u662f\u4e00\u4e2a\u91cd\u8981\u7684 Connector&#xff0c;\u57fa\u4e8e Debezium \u5b9e\u73b0&#xff0c;\u652f\u6301&#xff1a;<\/p>\n<ul>\n<li>\u5168\u91cf &#043; \u589e\u91cf\u4e00\u4f53\u5316\u8bfb\u53d6\u6570\u636e\u5e93\u53d8\u66f4<\/li>\n<li>Schema Evolution&#xff08;DDL \u53d8\u66f4\u81ea\u52a8\u540c\u6b65&#xff09;<\/li>\n<li>\u591a\u8868\u6574\u5e93\u540c\u6b65<\/li>\n<li>\u652f\u6301\u5199\u5165 Paimon\u3001Iceberg \u7b49\u6e56\u683c\u5f0f<\/li>\n<\/ul>\n<hr \/>\n<h3>\u5341\u3001\u5178\u578b\u5e94\u7528\u573a\u666f<\/h3>\n<h4>10.1 \u5b9e\u65f6\u6570\u4ed3&#xff08;Real-time Data Warehouse&#xff09;<\/h4>\n<p>Flink \u662f\u5b9e\u65f6\u6570\u4ed3\u7684\u6838\u5fc3\u8ba1\u7b97\u5f15\u64ce&#xff1a;<\/p>\n<ul>\n<li>\u5b9e\u65f6 ETL&#xff1a;\u4ece Kafka \u6d88\u8d39\u539f\u59cb\u6570\u636e&#xff0c;\u6e05\u6d17\u8f6c\u6362\u540e\u5199\u5165 DWD \u5c42<\/li>\n<li>\u5b9e\u65f6\u805a\u5408&#xff1a;\u5728 DWD \u5c42\u57fa\u7840\u4e0a\u8ba1\u7b97 DWS \u6c47\u603b\u6307\u6807<\/li>\n<li>\u5b9e\u65f6\u62a5\u8868&#xff1a;\u5c06\u8ba1\u7b97\u7ed3\u679c\u5199\u5165 Doris\/ClickHouse&#xff0c;\u4f9b BI \u770b\u677f\u67e5\u8be2<\/li>\n<\/ul>\n<h4>10.2 \u5b9e\u65f6\u98ce\u63a7<\/h4>\n<ul>\n<li>\u5b9e\u65f6\u4ea4\u6613\u76d1\u63a7&#xff1a;\u6beb\u79d2\u7ea7\u68c0\u6d4b\u5f02\u5e38\u4ea4\u6613\u6a21\u5f0f<\/li>\n<li>\u53cd\u6b3a\u8bc8&#xff1a;\u57fa\u4e8e\u89c4\u5219\u5f15\u64ce\u548c CEP&#xff08;\u590d\u6742\u4e8b\u4ef6\u5904\u7406&#xff09;\u5b9e\u65f6\u8bc6\u522b\u6b3a\u8bc8\u884c\u4e3a<\/li>\n<li>\u4fe1\u7528\u8bc4\u4f30&#xff1a;\u7ed3\u5408\u7528\u6237\u5386\u53f2\u884c\u4e3a\u548c\u5b9e\u65f6\u4ea4\u6613\u8fdb\u884c\u52a8\u6001\u8bc4\u5206<\/li>\n<\/ul>\n<h4>10.3 \u5b9e\u65f6\u76d1\u63a7\u4e0e\u544a\u8b66<\/h4>\n<ul>\n<li>\u7cfb\u7edf\u76d1\u63a7&#xff1a;\u5b9e\u65f6\u91c7\u96c6\u548c\u5206\u6790\u7cfb\u7edf\u6307\u6807<\/li>\n<li>\u4e1a\u52a1\u76d1\u63a7&#xff1a;\u5b9e\u65f6\u76d1\u63a7 GMV\u3001DAU \u7b49\u6838\u5fc3\u4e1a\u52a1\u6307\u6807<\/li>\n<li>\u5f02\u5e38\u68c0\u6d4b&#xff1a;\u57fa\u4e8e\u6ed1\u52a8\u7a97\u53e3\u548c CEP \u8bc6\u522b\u5f02\u5e38\u6a21\u5f0f<\/li>\n<\/ul>\n<h4>10.4 \u5b9e\u65f6\u63a8\u8350<\/h4>\n<ul>\n<li>\u7528\u6237\u884c\u4e3a\u5b9e\u65f6\u5206\u6790&#xff1a;\u57fa\u4e8e\u7528\u6237\u6700\u8fd1\u7684\u884c\u4e3a\u5e8f\u5217\u66f4\u65b0\u63a8\u8350\u6a21\u578b<\/li>\n<li>\u7279\u5f81\u5de5\u7a0b&#xff1a;\u5b9e\u65f6\u8ba1\u7b97\u7528\u6237\u753b\u50cf\u7279\u5f81<\/li>\n<li>A\/B \u6d4b\u8bd5&#xff1a;\u5b9e\u65f6\u5206\u6d41\u548c\u6548\u679c\u8bc4\u4f30<\/li>\n<\/ul>\n<h4>10.5 \u6570\u636e\u96c6\u6210\u4e0e CDC<\/h4>\n<ul>\n<li>\u6570\u636e\u5e93\u5b9e\u65f6\u540c\u6b65&#xff1a;\u901a\u8fc7 Flink CDC \u5c06 MySQL \u53d8\u66f4\u5b9e\u65f6\u540c\u6b65\u5230\u6570\u4ed3<\/li>\n<li>\u5f02\u6784\u7cfb\u7edf\u6570\u636e\u8fc1\u79fb&#xff1a;\u5728\u4e0d\u540c\u5b58\u50a8\u7cfb\u7edf\u4e4b\u95f4\u5b9e\u65f6\u540c\u6b65\u6570\u636e<\/li>\n<li>Schema Evolution&#xff1a;\u6e90\u8868 DDL \u53d8\u66f4\u65f6\u81ea\u52a8\u540c\u6b65\u5230\u76ee\u6807\u7cfb\u7edf<\/li>\n<\/ul>\n<hr \/>\n<h3>\u5341\u4e00\u3001\u5b89\u88c5\u90e8\u7f72<\/h3>\n<h4>11.1 \u73af\u5883\u8981\u6c42<\/h4>\n<table>\n<tr>\u7ec4\u4ef6\u7248\u672c\u8981\u6c42<\/tr>\n<tbody>\n<tr>\n<td>Java<\/td>\n<td>JDK 8 \u6216 JDK 11&#xff08;Flink 2.0 \u8981\u6c42 JDK 11&#043;&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>Hadoop<\/td>\n<td>2.x \u6216 3.x&#xff08;\u4f7f\u7528 HDFS \u65f6\u9700\u8981&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>11.2 \u4e0b\u8f7d\u4e0e\u89e3\u538b<\/h4>\n<p>\u4e0b\u8f7d\u5730\u5740&#xff1a;https:\/\/archive.apache.org\/dist\/flink\/flink-1.17.1\/ <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725074908-6a646a7410627.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4e0b\u8f7d\u5b8c\u540e\u4e0a\u4f20\u5230 hadoop1 \u7684 \/opt\/software\/ \u76ee\u5f55\u4e0b&#xff0c;\u7136\u540e\u4f7f\u7528 tar \u547d\u4ee4\u89e3\u538b\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725074908-6a646a74a6fe0.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6 flink-conf.yaml<\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> \/opt\/module\/flink-1.17.1\/conf<br \/>\n<span class=\"token function\">vim<\/span> flink-conf.yaml<\/p>\n<p>\u4fee\u6539\u4e0b\u9762\u7684\u6761\u76ee<\/p>\n<p><span class=\"token comment\"># JobManager\u8282\u70b9\u5730\u5740.<\/span><br \/>\njobmanager.rpc.address: hadoop1<br \/>\njobmanager.bind-host: <span class=\"token number\">0.0<\/span>.0.0<br \/>\nrest.address: hadoop1<br \/>\nrest.bind-address: <span class=\"token number\">0.0<\/span>.0.0<br \/>\n<span class=\"token comment\"># TaskManager\u8282\u70b9\u5730\u5740.\u9700\u8981\u914d\u7f6e\u4e3a\u5f53\u524d\u673a\u5668\u540d<\/span><br \/>\ntaskmanager.bind-host: <span class=\"token number\">0.0<\/span>.0.0<br \/>\ntaskmanager.host: hadoop1<\/p>\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6 workers \u4e3a\u5982\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p>hadoop1<br \/>\nhadoop2<br \/>\nhadoop3<\/p>\n<p>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6 masters<\/p>\n<p>hadoop1:8081<\/p>\n<h4>11.3 \u5206\u53d1\u5230\u5176\u5b83\u673a\u5668<\/h4>\n<p><span class=\"token builtin class-name\">cd<\/span> \/opt\/module\/<br \/>\nxsync flink-1.17.1<\/p>\n<p>\u5728\u5176\u5b83\u673a\u5668\u4e0a\u4fee\u6539 flink-conf.yaml \u6587\u4ef6\u4e2d\u7684 taskmanager.host \u4e3a\u81ea\u5df1\u7684\u4e3b\u673a\u540d&#xff1a;hadoop2\u3001hadoop3<\/p>\n<h4>11.4 \u542f\u52a8\u96c6\u7fa4<\/h4>\n<p>\u5728 hadoop1 \u4e0a\u6267\u884c\u547d\u4ee4 Flink \u96c6\u7fa4<\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> \/opt\/module\/flink-1.17.1<br \/>\nbin\/start-cluster.sh<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725074908-6a646a74cc4b7.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>11.5 \u8bbf\u95ee Web UI<\/h4>\n<p>\u542f\u52a8\u6210\u529f\u540e&#xff0c;\u53ef\u4ee5\u8bbf\u95ee http:\/\/hadoop1:8081 \u5bf9flink\u96c6\u7fa4\u548c\u4efb\u52a1\u8fdb\u884c\u76d1\u63a7\u7ba1\u7406<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725074908-6a646a74e29d6.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h3>\u5341\u4e8c\u3001\u4e0e Spark Streaming \u5bf9\u6bd4<\/h3>\n<table>\n<tr>\u7ef4\u5ea6Apache FlinkSpark Streaming<\/tr>\n<tbody>\n<tr>\n<td>\u5904\u7406\u6a21\u578b<\/td>\n<td>\u771f\u6b63\u7684\u6d41\u5904\u7406&#xff08;\u9010\u6761\u5904\u7406&#xff09;<\/td>\n<td>\u5fae\u6279\u5904\u7406&#xff08;Micro-Batch&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5ef6\u8fdf<\/td>\n<td>\u6beb\u79d2\u7ea7<\/td>\n<td>\u79d2~\u5206\u949f\u7ea7<\/td>\n<\/tr>\n<tr>\n<td>\u5bb9\u9519\u673a\u5236<\/td>\n<td>Checkpoint &#043; Barrier&#xff08;Chandy-Lamport&#xff09;<\/td>\n<td>\u57fa\u4e8e RDD \u8840\u7f18\u91cd\u7b97<\/td>\n<\/tr>\n<tr>\n<td>\u72b6\u6001\u7ba1\u7406<\/td>\n<td>\u539f\u751f\u652f\u6301&#xff0c;\u591a\u79cd\u540e\u7aef<\/td>\n<td>\u4f9d\u8d56\u5916\u90e8\u5b58\u50a8&#xff08;\u5982 HBase&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u65f6\u95f4\u8bed\u4e49<\/td>\n<td>Event Time &#043; Watermark<\/td>\n<td>\u652f\u6301\u4f46\u5b9e\u73b0\u8f83\u590d\u6742<\/td>\n<\/tr>\n<tr>\n<td>\u7a97\u53e3\u6a21\u578b<\/td>\n<td>\u4e30\u5bcc\u7684\u7a97\u53e3\u7c7b\u578b&#xff0c;\u539f\u751f\u652f\u6301<\/td>\n<td>\u6709\u9650\u7684\u7a97\u53e3\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>\u6279\u5904\u7406<\/td>\n<td>\u6709\u754c\u6d41&#xff08;\u7edf\u4e00\u5f15\u64ce&#xff09;<\/td>\n<td>\u539f\u751f\u6279\u5904\u7406\u5f15\u64ce<\/td>\n<\/tr>\n<tr>\n<td>SQL \u80fd\u529b<\/td>\n<td>\u5b8c\u5584&#xff0c;\u6d41\u6279\u7edf\u4e00<\/td>\n<td>\u6210\u719f&#xff0c;\u751f\u6001\u4e30\u5bcc<\/td>\n<\/tr>\n<tr>\n<td>\u751f\u6001\u6210\u719f\u5ea6<\/td>\n<td>\u5feb\u901f\u6210\u957f\u4e2d<\/td>\n<td>\u975e\u5e38\u6210\u719f&#xff0c;\u793e\u533a\u5e9e\u5927<\/td>\n<\/tr>\n<tr>\n<td>\u9002\u7528\u573a\u666f<\/td>\n<td>\u5b9e\u65f6\u8ba1\u7b97\u3001\u4f4e\u5ef6\u8fdf\u3001\u6709\u72b6\u6001\u6d41\u5904\u7406<\/td>\n<td>\u6279\u5904\u7406\u3001ETL\u3001\u5bf9\u5ef6\u8fdf\u8981\u6c42\u4e0d\u9ad8\u7684\u573a\u666f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>\u5173\u952e\u8981\u70b9\u603b\u7ed3<\/h3>\n<li>\u67b6\u6784\u8bbe\u8ba1&#xff1a;\u5206\u5c42\u67b6\u6784&#xff08;API \u2192 Runtime \u2192 Storage&#xff09;&#xff0c;\u4e3b\u4ece\u5f0f\u5206\u5e03\u5f0f\u96c6\u7fa4&#xff08;JobManager &#043; TaskManager&#xff09;<\/li>\n<li>\u6d41\u6279\u4e00\u4f53&#xff1a;\u6279\u5904\u7406\u662f\u6709\u754c\u6d41\u7684\u7279\u4f8b&#xff0c;\u7edf\u4e00\u5f15\u64ce\u3001\u7edf\u4e00\u8bed\u4e49\u3001\u7edf\u4e00 API<\/li>\n<li>\u72b6\u6001\u7ba1\u7406&#xff1a;\u6838\u5fc3\u80fd\u529b&#xff0c;\u652f\u6301 Keyed State \u548c Operator State&#xff0c;\u591a\u79cd\u72b6\u6001\u540e\u7aef\u53ef\u9009<\/li>\n<li>\u5bb9\u9519\u673a\u5236&#xff1a;\u57fa\u4e8e Chandy-Lamport \u7b97\u6cd5\u7684 Checkpoint&#xff0c;\u652f\u6301 Exactly-Once \u8bed\u4e49<\/li>\n<li>\u65f6\u95f4\u8bed\u4e49&#xff1a;Event Time &#043; Watermark \u673a\u5236\u7cbe\u786e\u5904\u7406\u4e71\u5e8f\u6570\u636e<\/li>\n<li>\u7a97\u53e3\u6a21\u578b&#xff1a;\u6eda\u52a8\u3001\u6ed1\u52a8\u3001\u4f1a\u8bdd\u3001\u5168\u5c40\u7a97\u53e3&#xff0c;\u7075\u6d3b\u8986\u76d6\u5404\u7c7b\u65f6\u5e8f\u8ba1\u7b97\u573a\u666f<\/li>\n<li>\u7b97\u5b50\u94fe\u4f18\u5316&#xff1a;\u878d\u5408\u7b97\u5b50\u51cf\u5c11\u5e8f\u5217\u5316\/\u7f51\u7edc\u5f00\u9500&#xff0c;\u964d\u4f4e\u5ef6\u8fdf<\/li>\n<li>Connector \u751f\u6001&#xff1a;\u4e30\u5bcc\u7684\u6570\u636e\u6e90\u8fde\u63a5&#xff0c;Kafka\/CDC\/Paimon \u662f\u6570\u4ed3\u573a\u666f\u7684\u6838\u5fc3<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0<br \/>\nApache Flink \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u6d41\u5904\u7406\u6846\u67b6&#xff0c;\u88ab\u8bbe\u8ba1\u7528\u4e8e\u5728\u6709\u754c\u548c\u65e0\u754c\u6570\u636e\u6d41\u4e0a\u8fdb\u884c\u6709\u72b6\u6001\u7684\u8ba1\u7b97\u3002\u4e0e\u4f20\u7edf\u7684\u5fae\u6279\u5904\u7406&#xff08;Micro-Batch&#xff09;\u5f15\u64ce\u4e0d\u540c&#xff0c;Flink \u4ece\u5e95\u5c42\u5c31\u5c06\u6d41\u5904\u7406\u4f5c\u4e3a\u4e00\u7b49\u516c\u6c11\u2014\u2014\u6279\u5904\u7406\u4ec5\u4ec5\u662f\u6709\u754c\u6d41\u7684\u7279\u4f8b\u3002\u8fd9\u79cd\\&#8221;\u6d41\u6279\u4e00\u4f53\\&#8221;\u7684\u8bbe\u8ba1\u54f2\u5b66\u4f7f Flink \u80fd\u591f\u5728\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u541e\u5410\u548c\u7cbe\u786e\u4e00\u6b21&#xff08;Exactly-Once&#xff09;\u8bed\u4e49\u4e4b\u95f4\u53d6\u5f97\u5353\u8d8a\u7684\u5e73\u8861\u3002<br \/>\nFlink \u7684\u6838\u5fc3\u80fd\u529b\u5305\u62ec&amp;#xf<\/p>\n","protected":false},"author":2,"featured_media":82997,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1138,323,2330,188],"topic":[],"class_list":["post-83001","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-flink","tag-323","tag-2330","tag-188"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/83001.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6982\u8ff0 Apache Flink \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u6d41\u5904\u7406\u6846\u67b6&#xff0c;\u88ab\u8bbe\u8ba1\u7528\u4e8e\u5728\u6709\u754c\u548c\u65e0\u754c\u6570\u636e\u6d41\u4e0a\u8fdb\u884c\u6709\u72b6\u6001\u7684\u8ba1\u7b97\u3002\u4e0e\u4f20\u7edf\u7684\u5fae\u6279\u5904\u7406&#xff08;Micro-Batch&#xff09;\u5f15\u64ce\u4e0d\u540c&#xff0c;Flink \u4ece\u5e95\u5c42\u5c31\u5c06\u6d41\u5904\u7406\u4f5c\u4e3a\u4e00\u7b49\u516c\u6c11\u2014\u2014\u6279\u5904\u7406\u4ec5\u4ec5\u662f\u6709\u754c\u6d41\u7684\u7279\u4f8b\u3002\u8fd9\u79cd&quot;\u6d41\u6279\u4e00\u4f53&quot;\u7684\u8bbe\u8ba1\u54f2\u5b66\u4f7f Flink \u80fd\u591f\u5728\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u541e\u5410\u548c\u7cbe\u786e\u4e00\u6b21&#xff08;Exactly-Once&#xff09;\u8bed\u4e49\u4e4b\u95f4\u53d6\u5f97\u5353\u8d8a\u7684\u5e73\u8861\u3002 Flink \u7684\u6838\u5fc3\u80fd\u529b\u5305\u62ec&amp;#xf\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/83001.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-25T07:49:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725074908-6a646a7410627.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83001.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/83001.html\",\"name\":\"\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-25T07:49:10+00:00\",\"dateModified\":\"2026-07-25T07:49:10+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/83001.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/83001.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/83001.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/83001.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6982\u8ff0 Apache Flink \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5206\u5e03\u5f0f\u6d41\u5904\u7406\u6846\u67b6&#xff0c;\u88ab\u8bbe\u8ba1\u7528\u4e8e\u5728\u6709\u754c\u548c\u65e0\u754c\u6570\u636e\u6d41\u4e0a\u8fdb\u884c\u6709\u72b6\u6001\u7684\u8ba1\u7b97\u3002\u4e0e\u4f20\u7edf\u7684\u5fae\u6279\u5904\u7406&#xff08;Micro-Batch&#xff09;\u5f15\u64ce\u4e0d\u540c&#xff0c;Flink \u4ece\u5e95\u5c42\u5c31\u5c06\u6d41\u5904\u7406\u4f5c\u4e3a\u4e00\u7b49\u516c\u6c11\u2014\u2014\u6279\u5904\u7406\u4ec5\u4ec5\u662f\u6709\u754c\u6d41\u7684\u7279\u4f8b\u3002\u8fd9\u79cd\"\u6d41\u6279\u4e00\u4f53\"\u7684\u8bbe\u8ba1\u54f2\u5b66\u4f7f Flink \u80fd\u591f\u5728\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u541e\u5410\u548c\u7cbe\u786e\u4e00\u6b21&#xff08;Exactly-Once&#xff09;\u8bed\u4e49\u4e4b\u95f4\u53d6\u5f97\u5353\u8d8a\u7684\u5e73\u8861\u3002 Flink \u7684\u6838\u5fc3\u80fd\u529b\u5305\u62ec&amp;#xf","og_url":"https:\/\/www.wsisp.com\/helps\/83001.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-25T07:49:10+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/07\/20260725074908-6a646a7410627.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/83001.html","url":"https:\/\/www.wsisp.com\/helps\/83001.html","name":"\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-25T07:49:10+00:00","dateModified":"2026-07-25T07:49:10+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/83001.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/83001.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/83001.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5341\u4e94\u3001Flink \u6838\u5fc3\u539f\u7406\u4e0e\u67b6\u6784\u8be6\u89e3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=83001"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/83001\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/82997"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=83001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=83001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=83001"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=83001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}