Search in sources :

Example 1 with IOTestPipelineOptions

use of org.apache.beam.sdk.io.common.IOTestPipelineOptions in project beam by apache.

the class ElasticsearchTestDataSet method main.

/**
   * Use this to create the index for reading before IT read tests.
   *
   * <p>To invoke this class, you can use this command line from elasticsearch io module directory:
   *
   * <pre>
   * mvn test-compile exec:java \
   * -Dexec.mainClass=org.apache.beam.sdk.io.elasticsearch.ElasticsearchTestDataSet \
   *   -Dexec.args="--elasticsearchServer=1.2.3.4 \
   *  --elasticsearchHttpPort=9200 \
   *  --elasticsearchTcpPort=9300" \
   *   -Dexec.classpathScope=test
   *   </pre>
   *
   * @param args Please pass options from ElasticsearchTestOptions used for connection to
   *     Elasticsearch as shown above.
   */
public static void main(String[] args) throws Exception {
    PipelineOptionsFactory.register(IOTestPipelineOptions.class);
    IOTestPipelineOptions options = PipelineOptionsFactory.fromArgs(args).as(IOTestPipelineOptions.class);
    createAndPopulateIndex(getClient(options), ReadOrWrite.READ);
}
Also used : IOTestPipelineOptions(org.apache.beam.sdk.io.common.IOTestPipelineOptions)

Example 2 with IOTestPipelineOptions

use of org.apache.beam.sdk.io.common.IOTestPipelineOptions in project beam by apache.

the class JdbcIOIT method setup.

@BeforeClass
public static void setup() throws SQLException {
    PipelineOptionsFactory.register(IOTestPipelineOptions.class);
    IOTestPipelineOptions options = TestPipeline.testingPipelineOptions().as(IOTestPipelineOptions.class);
    // We do dataSource set up in BeforeClass rather than Before since we don't need to create a new
    // dataSource for each test.
    dataSource = JdbcTestDataSet.getDataSource(options);
}
Also used : IOTestPipelineOptions(org.apache.beam.sdk.io.common.IOTestPipelineOptions) BeforeClass(org.junit.BeforeClass)

Example 3 with IOTestPipelineOptions

use of org.apache.beam.sdk.io.common.IOTestPipelineOptions in project beam by apache.

the class JdbcTestDataSet method main.

/**
   * Use this to create the read tables before IT read tests.
   *
   * <p>To invoke this class, you can use this command line:
   * (run from the jdbc root directory)
   * mvn test-compile exec:java -Dexec.mainClass=org.apache.beam.sdk.io.jdbc.JdbcTestDataSet \
   *   -Dexec.args="--postgresServerName=127.0.0.1 --postgresUsername=postgres \
   *   --postgresDatabaseName=myfancydb \
   *   --postgresPassword=yourpassword --postgresSsl=false" \
   *   -Dexec.classpathScope=test
   * @param args Please pass options from IOTestPipelineOptions used for connection to postgres as
   * shown above.
   */
public static void main(String[] args) throws SQLException {
    PipelineOptionsFactory.register(IOTestPipelineOptions.class);
    IOTestPipelineOptions options = PipelineOptionsFactory.fromArgs(args).as(IOTestPipelineOptions.class);
    createReadDataTable(getDataSource(options));
}
Also used : IOTestPipelineOptions(org.apache.beam.sdk.io.common.IOTestPipelineOptions)

Aggregations

IOTestPipelineOptions (org.apache.beam.sdk.io.common.IOTestPipelineOptions)3 BeforeClass (org.junit.BeforeClass)1