知识卡片
三点扫描判定的是中间记录
有序扫描中保留前两条记录,当新记录到来时,比较lastRecord与其前后值,输出被判断的中间点;切换uniqueId要清空上下文,避免跨序列比较。示例PivotPoint保存点的时间和值,但position使用当前扫描计数,不能把该计数误当lastRecord的原始位置。
结构图:
classDiagram
class PivotPoint {
String uniqueId
Int position
Long eventTime
Int eventValue
Boolean isPeak
+PivotPoint(String uniqueId, Int position, Long eventTime, Int eventValue, Boolean isPeak)
}
note for PivotPoint "时间和值取被判定的中间点;原例计数位置存在错位"
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第 4 章 Hadoop 数据处理通用范式 · 查看原书依据
lastRecord != null && lastLastRecord != null) { ➏ if (lastRecord._2 < r._2 && lastRecord._2 < lastLastRecord._2) { results.+=(new PivotPoint
参考来源
- 位置:《Hadoop应用架构》第04章《第 4 章 Hadoop 数据处理通用范式》4.2.2 代码示例:使用Spark分析数据的高峰和低谷;来源项目book-sources,extracted/Hadoop应用架构/_epub-src/OEBPS/text00001.html。
- 结论依据:原文滑动状态与new PivotPoint实际参数支持中间点和位置不一致边界,未运行。
- 原始内容:lastRecord != null && lastLastRecord != null) { ➏ if (lastRecord._2 < r._2 && lastRecord._2 < lastLastRecord._2) { results.+=(new PivotPoint