static Read create() { BigtableConfig config = BigtableConfig.builder() .setTableId(ValueProvider.StaticValueProvider.of("")) .setValidate(true) .build(); return new AutoValue_BigtableIO_Read.Builder() .setBigtableConfig(config) .setKeyRanges(Arrays.asList(ByteKeyRange.ALL_KEYS)) .build(); }
@Test public void testValueProviderTopic() { StaticValueProvider<String> provider = StaticValueProvider.of("projects/project/topics/topic"); Read<String> pubsubRead = PubsubIO.readStrings().fromTopic(provider); Pipeline.create().apply(pubsubRead); assertThat(pubsubRead.getTopicProvider(), not(nullValue())); assertThat(pubsubRead.getTopicProvider().isAccessible(), is(true)); assertThat(pubsubRead.getTopicProvider().get().asPath(), equalTo(provider.get())); }
/** Specifies the Cloud Spanner database. */ public Write withDatabaseId(String databaseId) { return withDatabaseId(ValueProvider.StaticValueProvider.of(databaseId)); }
/** Specifies the Cloud Spanner instance. */ public Write withInstanceId(String instanceId) { return withInstanceId(ValueProvider.StaticValueProvider.of(instanceId)); }
/** Specifies the Cloud Spanner project. */ public Write withProjectId(String projectId) { return withProjectId(ValueProvider.StaticValueProvider.of(projectId)); }
/** Specifies the Cloud Spanner database. */ public CreateTransaction withDatabaseId(String databaseId) { return withDatabaseId(ValueProvider.StaticValueProvider.of(databaseId)); }
/** Writes to the given table, specified as a {@link TableReference}. */ public Write<T> to(TableReference table) { return to(StaticValueProvider.of(BigQueryHelpers.toTableSpec(table))); }
/** See {@link Read#from(String)}. */ public TypedRead<T> from(String tableSpec) { return from(StaticValueProvider.of(tableSpec)); }
/** Like {@link #from(ValueProvider)}. */ public Read<T> from(String filepattern) { return from(StaticValueProvider.of(filepattern)); }
public ReadAll withHost(String host) { return withHost(ValueProvider.StaticValueProvider.of(host)); }
/** * Creates and returns a transform for reading from a Cloud Pub/Sub topic. Mutually exclusive * with {@link #fromSubscription(String)}. * * <p>See {@link PubsubIO.PubsubTopic#fromPath(String)} for more details on the format of the * {@code topic} string. * * <p>The Beam runner will start reading data published on this topic from the time the pipeline * is started. Any data published on the topic before the pipeline is started will not be read * by the runner. */ public Read<T> fromTopic(String topic) { return fromTopic(StaticValueProvider.of(topic)); }
public static SpannerConfig create() { return builder().setHost(ValueProvider.StaticValueProvider.of(DEFAULT_HOST)).build(); }
/** Specifies the Cloud Spanner project. */ public CreateTransaction withProjectId(String projectId) { return withProjectId(ValueProvider.StaticValueProvider.of(projectId)); }
@Test public void testReadTopicDisplayData() { String topic = "projects/project/topics/topic"; PubsubIO.Read<String> read = PubsubIO.readStrings() .fromTopic(StaticValueProvider.of(topic)) .withTimestampAttribute("myTimestamp") .withIdAttribute("myId"); DisplayData displayData = DisplayData.from(read); assertThat(displayData, hasDisplayItem("topic", topic)); assertThat(displayData, hasDisplayItem("timestampAttribute", "myTimestamp")); assertThat(displayData, hasDisplayItem("idAttribute", "myId")); }
/** See {@link Read#from(TableReference)}. */ public TypedRead<T> from(TableReference table) { return from(StaticValueProvider.of(BigQueryHelpers.toTableSpec(table))); }
public ByteSource(String fileOrPatternSpec, long minBundleSize) { super(StaticValueProvider.of(fileOrPatternSpec), minBundleSize); }
/** * Specifies the AppProfile to use. */ public Builder withAppProfileId(String appProfileId) { return withAppProfileId(StaticValueProvider.of(appProfileId)); }
/** * Specifies the Cloud Bigtable instanceId. * @param instanceId The Cloud Bigtable instanceId. * @return The {@link CloudBigtableConfiguration.Builder} for chaining convenience. */ public Builder withInstanceId(String instanceId) { return withInstanceId(StaticValueProvider.of(instanceId)); }
public Read<T> withQuery(String query) { checkArgument(query != null, "query can not be null"); return withQuery(ValueProvider.StaticValueProvider.of(query)); }
/** Specifies the Cloud Spanner instance. */ public Read withInstanceId(String instanceId) { return withInstanceId(ValueProvider.StaticValueProvider.of(instanceId)); }