一、Flink DataStream API
1、读取数据源
1)定义 POJO 类
public static class UserBehavior {
public String userId;
public String itemId;
public String categoryId;
public String behaviorType;
public Long timestamp;
public UserBehavior() {
}
public UserBehavior(String userId, String itemId, String categoryId, String behaviorType, Long timestamp) {
this.userId = userId;
this.itemId = itemId;
this.categoryId = categoryId;
this.behaviorType = behaviorType;
this.timestamp = timestamp;
}
@Override
public String toString() {
return "UserBehavior{" +
"userId='" + userId + '\'' +