我正在尝试创建一个名为 Incident 的自定义对象的空 PCollection
public class Incident implements Serializable {
private Integer incidentId;
private String appId;
private Long minutes;
// getter setter
}
我正在尝试以下操作:
PCollection<KV<String, Incident>> incidents = pipeline.apply("Create Empty Collection", Create.empty(TypeDescriptor.of(KV.class)))
.setTypeDescriptor(TypeDescriptor.of(KV.class, String.class, Incident.class));
但它给了我编译错误:
Cannot resolve method 'of(Class<KV>, Class<String>, Class<Incident>)'