我有两个话题的数量变化很大(对于右边主题中的每个事件,左边话题中可能会发出1000个事件)。
我正在尝试将这两个主题<div>
<label for="jogador1">Player 1</label>
<input type="text" id="jogador1">
</div>
<div>
<label for="jogador2">Player 2</label>
<input type="text" id="jogador2">
</div>
<button id="button">JOGAR</button>
<p id="output"></p>
一起使用,给人的印象是联接窗口是根据处理时间而不是摄取时间来计算的,从而导致较小的流过早地“耗尽”
是否可以指定流-流加入到摄取时间(或事件时间)的时间语义?
我可以理解为什么使用摄取时间并不是一件容易的事,但是在处理历史流时这似乎是必需的。
答案 0 :(得分:2)
Kafka Streams连接基于事件时间,即,无论$conn = new mysqli("localhost:3306", "MyUsername", "MyPassword", "MyDataBase");
返回什么(默认情况下,存储在主题中的消息时间戳),您都不能对其进行修改(只能使用其他时间戳提取器间接进行)修改结果)。
但是请注意,连接是“急切地”执行的,因此对于所有左侧记录,立即在右侧流中进行查找,这可能导致额外的import 'dart:convert';
YourModelClassName yourModelClassNameFromJson(String str) => YourModelClassName.fromJson(json.decode(str));
String yourModelClassNameToJson(YourModelClassName data) => json.encode(data.toJson());
class YourModelClassName {
Result result;
YourModelClassName({
this.result,
});
factory YourModelClassName.fromJson(Map<String, dynamic> json) => YourModelClassName(
result: Result.fromJson(json["result"]),
);
Map<String, dynamic> toJson() => {
"result": result.toJson(),
};
}
class Result {
String name;
List<Page> pages;
String creatorUserName;
int id;
Result({
this.name,
this.pages,
this.creatorUserName,
this.id,
});
factory Result.fromJson(Map<String, dynamic> json) => Result(
name: json["name"],
pages: List<Page>.from(json["pages"].map((x) => Page.fromJson(x))),
creatorUserName: json["creatorUserName"],
id: json["id"],
);
Map<String, dynamic> toJson() => {
"name": name,
"pages": List<dynamic>.from(pages.map((x) => x.toJson())),
"creatorUserName": creatorUserName,
"id": id,
};
}
class Page {
List<Zone> zones;
int id;
Page({
this.zones,
this.id,
});
factory Page.fromJson(Map<String, dynamic> json) => Page(
zones: List<Zone>.from(json["zones"].map((x) => Zone.fromJson(x))),
id: json["id"],
);
Map<String, dynamic> toJson() => {
"zones": List<dynamic>.from(zones.map((x) => x.toJson())),
"id": id,
};
}
class Zone {
String title;
Zone({
this.title,
});
factory Zone.fromJson(Map<String, dynamic> json) => Zone(
title: json["title"],
);
Map<String, dynamic> toJson() => {
"title": title,
};
}
结果。
这还取决于尽力而为基于事件时间的处理顺序。 TimestampExtractor
版本中的保证得到了改善,使用配置参数<key, (left-value,null)>
可能有助于缓解此问题。
在中期路线图中,可以改善左联接和外联接的行为,从而避免那些额外的结果记录。由于Kafka是一个开源项目,您希望将其提取,请帮助尽快解决此问题:)
唯一的替代方法是通过Processor API实现自定义联接运算符。