Как создать пустую PCollection>JAVA

Программисты JAVA общаются здесь
Anonymous
Как создать пустую PCollection>

Сообщение Anonymous »

Я пытаюсь создать пустую PCollection пользовательского объекта с именем Incident

Код: Выделить всё

public class Incident implements Serializable {
private Integer incidentId;
private String appId;
private Long minutes;

// getter setter
}
Я пробовал следующее:

Код: Выделить всё

PCollection 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, Class, Class)'


Подробнее здесь: https://stackoverflow.com/questions/784 ... ing-object

Вернуться в «JAVA»