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


Java PipelineOptionsFactory.as方法代码示例

本文整理汇总了Java中com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory.as方法的典型用法代码示例。如果您正苦于以下问题:Java PipelineOptionsFactory.as方法的具体用法?Java PipelineOptionsFactory.as怎么用?Java PipelineOptionsFactory.as使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory的用法示例。


在下文中一共展示了PipelineOptionsFactory.as方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: pipelineOptions

import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; //导入方法依赖的package包/类
/**
 * Create Dataflow Pipeline options from the standard command-line options, "--project=",
 * "--runner=" and "--stagingLocation="
 *
 * @param args
 * @return
 * @throws IOException
 */
public static DataflowPipelineOptions pipelineOptions(String[] args) throws IOException {
  LOG.info("Set up Dataflow options");
  DataflowPipelineOptions o = PipelineOptionsFactory.as(DataflowPipelineOptions.class);

  Map<String, String> m = StringUtils.parseArgs(args);
  o.setProject(m.get(PROJECT));
  if (m.containsKey(STAGING)) {
    o.setStagingLocation(m.get(STAGING));
  } else if (m.containsKey(STAGING_LOCATION)) {
    o.setStagingLocation(m.get(STAGING_LOCATION));
  } else if (m.containsKey(WORKSPACE)) {
    o.setStagingLocation(m.get(WORKSPACE) + "/staging");
  }
  o.setRunner(runner(m.get(RUNNER)));
  o.setMaxNumWorkers(m.get(MAX_WORKERS) == null ? 1 : Integer.parseInt(m.get(MAX_WORKERS)));
  if (m.containsKey(MACHINE_TYPE)) {
    o.setWorkerMachineType(m.get(MACHINE_TYPE));
  } else {
    o.setWorkerMachineType(DEFAULT_MACHINE_TYPE);
  }
  return o;
}
 
开发者ID:googlegenomics,项目名称:dockerflow,代码行数:31,代码来源:DataflowFactory.java

示例2: setupPipeline

import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; //导入方法依赖的package包/类
private Pipeline setupPipeline(final String inputPath, final String outputPath, boolean enableGcs, boolean enableCloudExec) {
    final GATKGCSOptions options = PipelineOptionsFactory.as(GATKGCSOptions.class);
    if (enableCloudExec) {
        options.setStagingLocation(getGCPTestStaging());
        options.setProject(getGCPTestProject());
        options.setRunner(BlockingDataflowPipelineRunner.class);
    } else if (BucketUtils.isHadoopUrl(inputPath) || BucketUtils.isHadoopUrl(outputPath)) {
        options.setRunner(SparkPipelineRunner.class);
    } else {
        options.setRunner(DirectPipelineRunner.class);
    }
    if (enableGcs) {
        options.setApiKey(getGCPTestApiKey());
    }
    final Pipeline p = Pipeline.create(options);
    DataflowUtils.registerGATKCoders(p);
    return p;
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:19,代码来源:SmallBamWriterTest.java

示例3: getCloudExecutionOptions

import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; //导入方法依赖的package包/类
private PipelineOptions getCloudExecutionOptions(String stagingLocation) {
  DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
  options.setProject(Constants.PROJECT_ID);
  options.setStagingLocation(stagingLocation);
  options.setRunner(BlockingDataflowPipelineRunner.class);
  return options;
}
 
开发者ID:GoogleCloudPlatform,项目名称:policyscanner,代码行数:8,代码来源:LiveStateCheckerApp.java

示例4: getCloudExecutionOptions

import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; //导入方法依赖的package包/类
private PipelineOptions getCloudExecutionOptions(String stagingLocation) {
  DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
  options.setProject(SystemProperty.applicationId.get());
  options.setStagingLocation(stagingLocation);
  options.setRunner(BlockingDataflowPipelineRunner.class);
  return options;
}
 
开发者ID:GoogleCloudPlatform,项目名称:policyscanner,代码行数:8,代码来源:UserManagedKeysApp.java

示例5: getCloudExecutionOptions

import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; //导入方法依赖的package包/类
private static PipelineOptions getCloudExecutionOptions(String stagingLocation) {
  DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
  options.setProject(SystemProperty.applicationId.get());
  options.setStagingLocation(stagingLocation);
  options.setRunner(BlockingDataflowPipelineRunner.class);
  return options;
}
 
开发者ID:GoogleCloudPlatform,项目名称:policyscanner,代码行数:8,代码来源:LiveStateCheckerRunner.java

示例6: setup

import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; //导入方法依赖的package包/类
public static Pipeline setup() {

    FXTimeSeriesPipelineOptions options =
        PipelineOptionsFactory.as(FXTimeSeriesPipelineOptions.class);


    // Setup the windowing variables for the test run
    options.setCandleResolution(BAR_SIZE_SEC);
    options.setCorrelationWindowSize(WINDOW_SIZE_SECS);
    options.setCorrelationWindowPeriod(SLIDING_WINDOW_PERIOD_SECS);

    // Set Runner to use
    options.setRunner(InProcessPipelineRunner.class);

    Pipeline pipeline = Pipeline.create(options);

    // Register all of the coders used within the Pipeline
    TimeSeriesCoders.registerCoders(pipeline);

    // Create WorkPacket SideInput

    return pipeline;
  }
 
开发者ID:GoogleCloudPlatform,项目名称:data-timeseries-java,代码行数:24,代码来源:FXTimeSeriesPipelineSRGTests.java

示例7: create

import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; //导入方法依赖的package包/类
public static SparkPipelineOptions create() {
  return PipelineOptionsFactory.as(SparkPipelineOptions.class);
}
 
开发者ID:shakamunyi,项目名称:spark-dataflow,代码行数:4,代码来源:SparkPipelineOptionsFactory.java

示例8: create

import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; //导入方法依赖的package包/类
public static SparkStreamingPipelineOptions create() {
  return PipelineOptionsFactory.as(SparkStreamingPipelineOptions.class);
}
 
开发者ID:shakamunyi,项目名称:spark-dataflow,代码行数:4,代码来源:SparkStreamingPipelineOptionsFactory.java


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