Java 有没有一种方法可以在数据流中创建从pubsub主题读取的批处理作业?

Java 有没有一种方法可以在数据流中创建从pubsub主题读取的批处理作业?,java,google-cloud-dataflow,apache-beam,google-cloud-pubsub,Java,Google Cloud Dataflow,Apache Beam,Google Cloud Pubsub,我有一个流模式的数据流管道,因为它从pubsub主题读取数据。我希望将其修改为批处理模式。我需要这样才能使用FlexRS,因为它只支持批处理模式。 Beam版本:2.13.0您可以研究如何使用BoundedReadFromUnbounded源,该源允许将无界集合转换为有界集合 UnboundedSource<String> unboundedSource = ...; PCollection<String> boundedCollection= p.apply

我有一个流模式的数据流管道,因为它从pubsub主题读取数据。我希望将其修改为批处理模式。我需要这样才能使用FlexRS,因为它只支持批处理模式。
Beam版本:2.13.0

您可以研究如何使用BoundedReadFromUnbounded源,该源允许将无界集合转换为有界集合

UnboundedSource<String> unboundedSource  = ...;
PCollection<String> boundedCollection=
     p.apply(Read.from(unboundedSource).withMaxNumRecords(10));
unbounddsource unbounddsource=。。。;
PCollection boundedCollection=
p、 应用(从(无界数据源)读取).withMaxNumRecords(10));
您还可以利用