本文整理汇总了Java中org.apache.beam.sdk.values.PDone.in方法的典型用法代码示例。如果您正苦于以下问题:Java PDone.in方法的具体用法?Java PDone.in怎么用?Java PDone.in使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.beam.sdk.values.PDone
的用法示例。
在下文中一共展示了PDone.in方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<InputT> teamAndScore) {
teamAndScore
.apply("ConvertToRow", ParDo.of(new BuildRowFn()))
.apply(
BigQueryIO.writeTableRows()
.to(getTable(projectId, datasetId, tableName))
.withSchema(getSchema())
.withCreateDisposition(CreateDisposition.CREATE_IF_NEEDED)
.withWriteDisposition(WriteDisposition.WRITE_APPEND));
return PDone.in(teamAndScore.getPipeline());
}
示例2: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<BeamRecord> input) {
input.apply(ParDo.of(new DoFn<BeamRecord, Void>() {
@ProcessElement
public void processElement(ProcessContext c) {
CONTENT.add(c.element());
}
@Teardown
public void close() {
CONTENT.clear();
}
}));
return PDone.in(input.getPipeline());
}
示例3: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<InputT> teamAndScore) {
if (windowed) {
teamAndScore
.apply("ConvertToRow", ParDo.of(new BuildRowFn()))
.apply(new WriteToText.WriteOneFilePerWindow(filenamePrefix));
} else {
teamAndScore
.apply("ConvertToRow", ParDo.of(new BuildRowFn()))
.apply(TextIO.write().to(filenamePrefix));
}
return PDone.in(teamAndScore.getPipeline());
}
示例4: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<T> input) {
input
.apply("GroupGlobally", new GroupGlobally<T>(rewindowingStrategy))
.apply("GetPane", MapElements.via(paneExtractor))
.setCoder(IterableCoder.of(input.getCoder()))
.apply("RunChecks", ParDo.of(new GroupedValuesCheckerDoFn<>(checkerFn, site)))
.apply("VerifyAssertions", new DefaultConcludeTransform());
return PDone.in(input.getPipeline());
}
示例5: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<KV<String, String>> input) {
checkArgument(connectionConfiguration() != null, "withConnectionConfiguration() is required");
input.apply(ParDo.of(new WriteFn(this)));
return PDone.in(input.getPipeline());
}
示例6: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<Integer> input) {
// Apply an operation so that this is a composite transform.
input.apply(Count.<Integer>perElement());
return PDone.in(input.getPipeline());
}
示例7: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<KV<ByteString, Iterable<Mutation>>> input) {
getBigtableConfig().validate();
input.apply(ParDo.of(new BigtableWriterFn(getBigtableConfig().getTableId(),
new SerializableFunction<PipelineOptions, BigtableService>() {
@Override
public BigtableService apply(PipelineOptions options) {
return getBigtableConfig().getBigtableService(options);
}
})));
return PDone.in(input.getPipeline());
}
示例8: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<PubsubMessage> input) {
input
.apply(
"PubsubUnboundedSink.Window",
Window.<PubsubMessage>into(new GlobalWindows())
.triggering(
Repeatedly.forever(
AfterFirst.of(
AfterPane.elementCountAtLeast(publishBatchSize),
AfterProcessingTime.pastFirstElementInPane().plusDelayOf(maxLatency))))
.discardingFiredPanes())
.apply("PubsubUnboundedSink.Shard", ParDo.of(new ShardFn(numShards, recordIdMethod)))
.setCoder(KvCoder.of(VarIntCoder.of(), CODER))
.apply(GroupByKey.<Integer, OutgoingMessage>create())
.apply(
"PubsubUnboundedSink.Writer",
ParDo.of(
new WriterFn(
pubsubFactory,
topic,
timestampAttribute,
idAttribute,
publishBatchSize,
publishBatchBytes)));
return PDone.in(input.getPipeline());
}
示例9: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<String> input) {
ConnectionConfiguration connectionConfiguration = getConnectionConfiguration();
checkState(connectionConfiguration != null, "withConnectionConfiguration() is required");
input.apply(ParDo.of(new WriteFn(this)));
return PDone.in(input.getPipeline());
}
示例10: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<Mutation> input) {
checkArgument(serializableConfiguration != null, "withConfiguration() is required");
checkArgument(tableId != null && !tableId.isEmpty(), "withTableId() is required");
try (Connection connection =
ConnectionFactory.createConnection(serializableConfiguration.get())) {
Admin admin = connection.getAdmin();
checkArgument(
admin.tableExists(TableName.valueOf(tableId)), "Table %s does not exist", tableId);
} catch (IOException e) {
LOG.warn("Error checking whether table {} exists; proceeding.", tableId, e);
}
input.apply(ParDo.of(new HBaseWriterFn(tableId, serializableConfiguration)));
return PDone.in(input.getPipeline());
}
示例11: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<T> input) {
checkArgument(
getDataSourceConfiguration() != null, "withDataSourceConfiguration() is required");
checkArgument(getStatement() != null, "withStatement() is required");
checkArgument(
getPreparedStatementSetter() != null, "withPreparedStatementSetter() is required");
input.apply(ParDo.of(new WriteFn<T>(this)));
return PDone.in(input.getPipeline());
}
示例12: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<T> teamAndScore) {
teamAndScore
.apply("ConvertToRow", ParDo.of(new BuildRowFn()))
.apply(BigQueryIO.writeTableRows()
.to(getTable(projectId, datasetId, tableName))
.withSchema(getSchema())
.withCreateDisposition(CreateDisposition.CREATE_IF_NEEDED)
.withWriteDisposition(WriteDisposition.WRITE_APPEND));
return PDone.in(teamAndScore.getPipeline());
}
示例13: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<IndexedRecord> in) {
TableReference table = new TableReference();
table.setProjectId(datastore.projectName.getValue());
table.setDatasetId(dataset.bqDataset.getValue());
table.setTableId(dataset.tableName.getValue());
BigQueryIO.Write bigQueryIOPTransform = BigQueryIO.writeTableRows().to(table);
bigQueryIOPTransform = setTableOperation(bigQueryIOPTransform);
bigQueryIOPTransform = setWriteOperation(bigQueryIOPTransform);
in.apply(ParDo.of(new IndexedRecordToTableRowFn())).apply(bigQueryIOPTransform);
return PDone.in(in.getPipeline());
}
示例14: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public PDone expand(PCollection<Message> input) {
input.apply(ParDo.of(new WriteFn(this)));
return PDone.in(input.getPipeline());
}
示例15: expand
import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public POutput expand(PInput input) {
return PDone.in(input.getPipeline());
}