当前位置: 首页>>代码示例>>Java>>正文


Java PDone.in方法代码示例

本文整理汇总了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());
}
 
开发者ID:apache,项目名称:beam,代码行数:13,代码来源:WriteToBigQuery.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:17,代码来源:MockedBoundedTable.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:14,代码来源:WriteToText.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:12,代码来源:PAssert.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:8,代码来源:RedisIO.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:8,代码来源:DataflowPipelineTranslatorTest.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:14,代码来源:BigtableIO.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:28,代码来源:PubsubUnboundedSink.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:8,代码来源:ElasticsearchIO.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:16,代码来源:HBaseIO.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:12,代码来源:JdbcIO.java

示例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());
}
 
开发者ID:GoogleCloudPlatform,项目名称:DataflowSDK-examples,代码行数:12,代码来源:WriteWindowedToBigQuery.java

示例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());
}
 
开发者ID:Talend,项目名称:components,代码行数:16,代码来源:BigQueryOutputRuntime.java

示例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());
}
 
开发者ID:apache,项目名称:beam,代码行数:6,代码来源:AmqpIO.java

示例15: expand

import org.apache.beam.sdk.values.PDone; //导入方法依赖的package包/类
@Override
public POutput expand(PInput input) {
  return PDone.in(input.getPipeline());
}
 
开发者ID:apache,项目名称:beam,代码行数:5,代码来源:TransformInputsTest.java


注:本文中的org.apache.beam.sdk.values.PDone.in方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。