Flink SQL FileSystem Connector 分区提交与自定义小文件合并策略

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Flink SQL 的 FileSystem Connector 为了与 Flink-Hive 集成的大环境适配,做了很多改进,而其中最为明显的就是分区提交(partition commit)机制。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"本文先通过源码简单过一下分区提交机制的两个要素——即触发(trigger)和策略(policy)的实现,然后用合并小文件的实例说一下自定义分区提交策略的方法。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"PartitionCommitTrigger"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"path\n└── datetime=2019-08-25\n └── hour=11\n ├── part-0.parquet\n ├── part-1.parquet\n └── hour=12\n ├── part-0.parquet\n└── datetime=2019-08-26\n └── hour=6\n ├── part-0.parquet"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"那么,已经写入的分区数据何时才能对下游可见呢?这就涉及到如何触发分区提交的问题。根据官方文档,触发参数有以下两个:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"sink.partition-commit.trigger"},{"type":"text","text":":可选 process-time(根据处理时间触发)和 partition-time(根据从事件时间中提取的分区时间触发)。"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"sink.partition-commit.delay"},{"type":"text","text":":分区提交的时延。如果 trigger 是 process-time,则以分区创建时的系统时间戳为准,经过此时延后提交;如果 trigger 是 partition-time,则以分区创建时本身携带的事件时间戳为准,当水印时间戳经过此时延后提交。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"可见,process-time trigger 无法应对处理过程中出现的抖动,一旦数据迟到或者程序失败重启,数据就不能按照事件时间被归入正确的分区了。所以在实际应用中,我们几乎总是选用 partition-time trigger,并自己生成水印。当然我们也需要通过 partition.time-extractor.*一系列参数来指定抽取分区时间的规则(PartitionTimeExtractor),官方文档说得很清楚,不再赘述。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在源码中,PartitionCommitTrigger 的类图如下。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/e8/e8628dd73fb5cfba75c08cc46016cec4.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下面以分区时间触发的 PartitionTimeCommitTrigger 为例,简单看看它的思路。直接上该类的完整代码。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"public class PartitionTimeCommitTigger implements PartitionCommitTrigger {\n private static final ListStateDescriptor> PENDING_PARTITIONS_STATE_DESC =\n new ListStateDescriptor<>(\n \"pending-partitions\",\n new ListSerializer<>(StringSerializer.INSTANCE));\n\n private static final ListStateDescriptor> WATERMARKS_STATE_DESC =\n new ListStateDescriptor<>(\n \"checkpoint-id-to-watermark\",\n new MapSerializer<>(LongSerializer.INSTANCE, LongSerializer.INSTANCE));\n\n private final ListState> pendingPartitionsState;\n private final Set pendingPartitions;\n\n private final ListState> watermarksState;\n private final TreeMap watermarks;\n private final PartitionTimeExtractor extractor;\n private final long commitDelay;\n private final List partitionKeys;\n\n public PartitionTimeCommitTigger(\n boolean isRestored,\n OperatorStateStore stateStore,\n Configuration conf,\n ClassLoader cl,\n List partitionKeys) throws Exception {\n this.pendingPartitionsState = stateStore.getListState(PENDING_PARTITIONS_STATE_DESC);\n this.pendingPartitions = new HashSet<>();\n if (isRestored) {\n pendingPartitions.addAll(pendingPartitionsState.get().iterator().next());\n }\n\n this.partitionKeys = partitionKeys;\n this.commitDelay = conf.get(SINK_PARTITION_COMMIT_DELAY).toMillis();\n this.extractor = PartitionTimeExtractor.create(\n cl,\n conf.get(PARTITION_TIME_EXTRACTOR_KIND),\n conf.get(PARTITION_TIME_EXTRACTOR_CLASS),\n conf.get(PARTITION_TIME_EXTRACTOR_TIMESTAMP_PATTERN));\n\n this.watermarksState = stateStore.getListState(WATERMARKS_STATE_DESC);\n this.watermarks = new TreeMap<>();\n if (isRestored) {\n watermarks.putAll(watermarksState.get().iterator().next());\n }\n }\n\n @Override\n public void addPartition(String partition) {\n if (!StringUtils.isNullOrWhitespaceOnly(partition)) {\n this.pendingPartitions.add(partition);\n }\n }\n\n @Override\n public List committablePartitions(long checkpointId) {\n if (!watermarks.containsKey(checkpointId)) {\n throw new IllegalArgumentException(String.format(\n \"Checkpoint(%d) has not been snapshot. The watermark information is: %s.\",\n checkpointId, watermarks));\n }\n\n long watermark = watermarks.get(checkpointId);\n watermarks.headMap(checkpointId, true).clear();\n\n List needCommit = new ArrayList<>();\n Iterator iter = pendingPartitions.iterator();\n while (iter.hasNext()) {\n String partition = iter.next();\n LocalDateTime partTime = extractor.extract(\n partitionKeys, extractPartitionValues(new Path(partition)));\n if (watermark > toMills(partTime) + commitDelay) {\n needCommit.add(partition);\n iter.remove();\n }\n }\n return needCommit;\n }\n\n @Override\n public void snapshotState(long checkpointId, long watermark) throws Exception {\n pendingPartitionsState.clear();\n pendingPartitionsState.add(new ArrayList<>(pendingPartitions));\n\n watermarks.put(checkpointId, watermark);\n watermarksState.clear();\n watermarksState.add(new HashMap<>(watermarks));\n }\n\n @Override\n public List endInput() {\n ArrayList partitions = new ArrayList<>(pendingPartitions);\n pendingPartitions.clear();\n return partitions;\n }\n}"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"注意到该类中维护了两对必要的信息:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"pendingPartitions/pendingPartitionsState"},{"type":"text","text":":等待提交的分区以及对应的状态;"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"watermarks/watermarksState"},{"type":"text","text":":的映射关系(用 TreeMap 存储以保证有序)以及对应的状态。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这也说明开启检查点是分区提交机制的前提。snapshotState() 方法用于将这些信息保存到状态中。这样在程序 failover 时,也能够保证分区数据的完整和正确。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"那么 PartitionTimeCommitTigger 是如何知道该提交哪些分区的呢?来看 committablePartitions() 方法:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"numberedlist","attrs":{"start":null,"normalizeStart":1},"content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":1,"align":null,"origin":null},"content":[{"type":"text","text":"检查 checkpoint ID 是否合法;"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":2,"align":null,"origin":null},"content":[{"type":"text","text":"取出当前 checkpoint ID 对应的水印,并调用 TreeMap的headMap() 和 clear() 方法删掉早于当前 checkpoint ID 的水印数据(没用了);"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":3,"align":null,"origin":null},"content":[{"type":"text","text":"遍历等待提交的分区,调用之前定义的 PartitionTimeExtractor(比如${year}-${month}-${day} ${hour}:00:00)抽取分区时间。如果水印时间已经超过了分区时间加上上述 sink.partition-commit.delay 参数,说明可以提交,并返回它们。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"PartitionCommitTrigger 的逻辑会在负责真正提交分区的 StreamingFileCommitter 组件中用到(注意 StreamingFileCommitter 的并行度固定为 1,之前有人问过这件事)。StreamingFileCommitter 和 StreamingFileWriter(即 SQL 版 StreamingFileSink)的细节相对比较复杂,本文不表,之后会详细说明。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"PartitionCommitPolicy"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"metastore"},{"type":"text","text":":向 Hive Metastore 更新分区信息(仅在使用 HiveCatalog 时有效);"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"success-file"},{"type":"text","text":":向分区目录下写一个表示成功的文件,文件名可以通过 sink.partition-commit.success-file.name 参数自定义,默认为_SUCCESS;"}]}]},{"type":"listitem","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"custom"},{"type":"text","text":":自定义的提交策略,需要通过 sink.partition-commit.policy.class 参数来指定策略的类名。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"PartitionCommitPolicy 的内部实现就简单多了,类图如下。策略的具体逻辑通过覆写 commit() 方法实现。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/d5/d591b80fc4ded00ab0842e2faf510dd7.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"两个默认实现 MetastoreCommitPolicy 和 SuccessFileCommitPolicy 如下,都非常容易理解。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"public class MetastoreCommitPolicy implements PartitionCommitPolicy {\n private static final Logger LOG = LoggerFactory.getLogger(MetastoreCommitPolicy.class);\n\n private TableMetaStore metaStore;\n\n public void setMetastore(TableMetaStore metaStore) {\n this.metaStore = metaStore;\n }\n\n @Override\n public void commit(Context context) throws Exception {\n LinkedHashMap partitionSpec = context.partitionSpec();\n metaStore.createOrAlterPartition(partitionSpec, context.partitionPath());\n LOG.info(\"Committed partition {} to metastore\", partitionSpec);\n }\n}"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"public class SuccessFileCommitPolicy implements PartitionCommitPolicy {\n private static final Logger LOG = LoggerFactory.getLogger(SuccessFileCommitPolicy.class);\n\n private final String fileName;\n private final FileSystem fileSystem;\n\n public SuccessFileCommitPolicy(String fileName, FileSystem fileSystem) {\n this.fileName = fileName;\n this.fileSystem = fileSystem;\n }\n\n @Override\n public void commit(Context context) throws Exception {\n fileSystem.create(\n new Path(context.partitionPath(), fileName),\n FileSystem.WriteMode.OVERWRITE).close();\n LOG.info(\"Committed partition {} with success file\", context.partitionSpec());\n }\n}"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":1},"content":[{"type":"text","text":"Customize PartitionCommitPolicy"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/05/05393014ee52cf8152936540614e0647.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"由上图可见,在写入比较频繁或者并行度比较大时,每个分区内都会出现很多细碎的小文件,这是我们不乐意看到的。下面尝试自定义 PartitionCommitPolicy,实现在分区提交时将它们顺便合并在一起(存储格式为 Parquet)。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/f3/f3e2a8a0bc0bc41110cb32b8df909977.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Parquet 格式与普通的TextFile等行存储格式不同,它是自描述(自带 schema 和 metadata)的列存储,数据结构按照 Google Dremel 的标准格式来组织,与 Protobuf 相同。所以,我们应该先检测写入文件的 schema,再按照 schema 分别读取它们,并拼合在一起。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下面贴出合并分区内所有小文件的完整策略 ParquetFileMergingCommitPolicy。为了保证依赖不冲突,Parquet 相关的组件全部采用 Flink shade 过的版本。窃以为代码写得还算工整易懂,所以偷懒不写注释了。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"package me.lmagics.flinkexp.hiveintegration.util;\n\nimport org.apache.flink.hive.shaded.parquet.example.data.Group;\nimport org.apache.flink.hive.shaded.parquet.hadoop.ParquetFileReader;\nimport org.apache.flink.hive.shaded.parquet.hadoop.ParquetFileWriter.Mode;\nimport org.apache.flink.hive.shaded.parquet.hadoop.ParquetReader;\nimport org.apache.flink.hive.shaded.parquet.hadoop.ParquetWriter;\nimport org.apache.flink.hive.shaded.parquet.hadoop.example.ExampleParquetWriter;\nimport org.apache.flink.hive.shaded.parquet.hadoop.example.GroupReadSupport;\nimport org.apache.flink.hive.shaded.parquet.hadoop.metadata.CompressionCodecName;\nimport org.apache.flink.hive.shaded.parquet.hadoop.metadata.ParquetMetadata;\nimport org.apache.flink.hive.shaded.parquet.hadoop.util.HadoopInputFile;\nimport org.apache.flink.hive.shaded.parquet.schema.MessageType;\nimport org.apache.flink.table.filesystem.PartitionCommitPolicy;\nimport org.apache.hadoop.conf.Configuration;\nimport org.apache.hadoop.fs.FileSystem;\nimport org.apache.hadoop.fs.LocatedFileStatus;\nimport org.apache.hadoop.fs.Path;\nimport org.apache.hadoop.fs.RemoteIterator;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class ParquetFileMergingCommitPolicy implements PartitionCommitPolicy {\n private static final Logger LOGGER = LoggerFactory.getLogger(ParquetFileMergingCommitPolicy.class);\n\n @Override\n public void commit(Context context) throws Exception {\n Configuration conf = new Configuration();\n FileSystem fs = FileSystem.get(conf);\n String partitionPath = context.partitionPath().getPath();\n\n List files = listAllFiles(fs, new Path(partitionPath), \"part-\");\n LOGGER.info(\"{} files in path {}\", files.size(), partitionPath);\n\n MessageType schema = getParquetSchema(files, conf);\n if (schema == null) {\n return;\n }\n LOGGER.info(\"Fetched parquet schema: {}\", schema.toString());\n\n Path result = merge(partitionPath, schema, files, fs);\n LOGGER.info(\"Files merged into {}\", result.toString());\n }\n\n private List listAllFiles(FileSystem fs, Path dir, String prefix) throws IOException {\n List result = new ArrayList<>();\n\n RemoteIterator dirIterator = fs.listFiles(dir, false);\n while (dirIterator.hasNext()) {\n LocatedFileStatus fileStatus = dirIterator.next();\n Path filePath = fileStatus.getPath();\n if (fileStatus.isFile() && filePath.getName().startsWith(prefix)) {\n result.add(filePath);\n }\n }\n\n return result;\n }\n\n private MessageType getParquetSchema(List files, Configuration conf) throws IOException {\n if (files.size() == 0) {\n return null;\n }\n\n HadoopInputFile inputFile = HadoopInputFile.fromPath(files.get(0), conf);\n ParquetFileReader reader = ParquetFileReader.open(inputFile);\n ParquetMetadata metadata = reader.getFooter();\n MessageType schema = metadata.getFileMetaData().getSchema();\n\n reader.close();\n return schema;\n }\n\n private Path merge(String partitionPath, MessageType schema, List files, FileSystem fs) throws IOException {\n Path mergeDest = new Path(partitionPath + \"/result-\" + System.currentTimeMillis() + \".parquet\");\n ParquetWriter writer = ExampleParquetWriter.builder(mergeDest)\n .withType(schema)\n .withConf(fs.getConf())\n .withWriteMode(Mode.CREATE)\n .withCompressionCodec(CompressionCodecName.SNAPPY)\n .build();\n\n for (Path file : files) {\n ParquetReader reader = ParquetReader.builder(new GroupReadSupport(), file)\n .withConf(fs.getConf())\n .build();\n Group data;\n while((data = reader.read()) != null) {\n writer.write(data);\n }\n reader.close();\n }\n writer.close();\n\n for (Path file : files) {\n fs.delete(file, false);\n }\n\n return mergeDest;\n }\n}"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"别忘了修改分区提交策略相关的参数:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"'sink.partition-commit.policy.kind' = 'metastore,success-file,custom', \n'sink.partition-commit.policy.class' = 'me.lmagics.flinkexp.hiveintegration.util.ParquetFileMergingCommitPolicy'"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"重新跑一遍之前的 Hive Streaming 程序,观察日志输出:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"codeblock","attrs":{"lang":null},"content":[{"type":"text","text":"20-08-04 22:15:00 INFO me.lmagics.flinkexp.hiveintegration.util.ParquetFileMergingCommitPolicy - 14 files in path /user/hive/warehouse/hive_tmp.db/analytics_access_log_hive/ts_date=2020-08-04/ts_hour=22/ts_minute=13\n\n// 如果看官熟悉Protobuf的话,可以发现这里的schema风格是完全一致的\n20-08-04 22:15:00 INFO me.lmagics.flinkexp.hiveintegration.util.ParquetFileMergingCommitPolicy - Fetched parquet schema: \nmessage hive_schema {\n optional int64 ts;\n optional int64 user_id;\n optional binary event_type (UTF8);\n optional binary from_type (UTF8);\n optional binary column_type (UTF8);\n optional int64 site_id;\n optional int64 groupon_id;\n optional int64 partner_id;\n optional int64 merchandise_id;\n}\n\n20-08-04 22:15:04 INFO me.lmagics.flinkexp.hiveintegration.util.ParquetFileMergingCommitPolicy - Files merged into /user/hive/warehouse/hive_tmp.db/analytics_access_log_hive/ts_date=2020-08-04/ts_hour=22/ts_minute=13/result-1596550500950.parquet\n"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"最后来验证一下,合并成功。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/7b/7bccd5f037bb36e24e41767b81e9d4e5.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"以上。感兴趣的同学也可以动手测试~"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"原文链接:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"https://www.jianshu.com/p/fb7d29abfa14"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章