本文整理汇总了Java中org.apache.beam.sdk.options.ValueProvider.isAccessible方法的典型用法代码示例。如果您正苦于以下问题:Java ValueProvider.isAccessible方法的具体用法?Java ValueProvider.isAccessible怎么用?Java ValueProvider.isAccessible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.beam.sdk.options.ValueProvider
的用法示例。
在下文中一共展示了ValueProvider.isAccessible方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: item
import org.apache.beam.sdk.options.ValueProvider; //导入方法依赖的package包/类
/**
* Create a display item for the specified key and {@link ValueProvider}.
*/
public static ItemSpec<?> item(String key, @Nullable ValueProvider<?> value) {
if (value == null) {
return item(key, Type.STRING, null);
}
if (value.isAccessible()) {
Object got = value.get();
if (got == null) {
return item(key, Type.STRING, null);
}
Type type = inferType(got);
if (type != null) {
return item(key, type, got);
}
}
// General case: not null and type not inferable. Fall back to toString of the VP itself.
return item(key, Type.STRING, String.valueOf(value));
}
示例2: getTableWithDefaultProject
import org.apache.beam.sdk.options.ValueProvider; //导入方法依赖的package包/类
/**
* Returns the table to write, or {@code null} if writing with {@code tableFunction}.
*
* <p>If the table's project is not specified, use the executing project.
*/
@Nullable
ValueProvider<TableReference> getTableWithDefaultProject(BigQueryOptions bqOptions) {
ValueProvider<TableReference> table = getTable();
if (table == null) {
return table;
}
if (!table.isAccessible()) {
LOG.info("Using a dynamic value for table input. This must contain a project"
+ " in the table reference: {}", table);
return table;
}
if (Strings.isNullOrEmpty(table.get().getProjectId())) {
// If user does not specify a project we assume the table to be located in
// the default project.
TableReference tableRef = table.get();
tableRef.setProjectId(bqOptions.getProject());
return NestedValueProvider.of(StaticValueProvider.of(
BigQueryHelpers.toJsonString(tableRef)), new JsonTableRefToTableRef());
}
return table;
}
示例3: ConstantTimePartitioningDestinations
import org.apache.beam.sdk.options.ValueProvider; //导入方法依赖的package包/类
ConstantTimePartitioningDestinations(
DynamicDestinations<T, TableDestination> inner,
ValueProvider<String> jsonTimePartitioning) {
super(inner);
checkArgument(jsonTimePartitioning != null, "jsonTimePartitioning provider can not be null");
if (jsonTimePartitioning.isAccessible()) {
checkArgument(jsonTimePartitioning.get() != null, "jsonTimePartitioning can not be null");
}
this.jsonTimePartitioning = jsonTimePartitioning;
}
示例4: fromSubscription
import org.apache.beam.sdk.options.ValueProvider; //导入方法依赖的package包/类
/**
* Like {@code subscription()} but with a {@link ValueProvider}.
*/
public Read<T> fromSubscription(ValueProvider<String> subscription) {
if (subscription.isAccessible()) {
// Validate.
PubsubSubscription.fromPath(subscription.get());
}
return toBuilder()
.setSubscriptionProvider(
NestedValueProvider.of(subscription, new SubscriptionTranslator()))
.build();
}
示例5: fromTopic
import org.apache.beam.sdk.options.ValueProvider; //导入方法依赖的package包/类
/**
* Like {@code topic()} but with a {@link ValueProvider}.
*/
public Read<T> fromTopic(ValueProvider<String> topic) {
if (topic.isAccessible()) {
// Validate.
PubsubTopic.fromPath(topic.get());
}
return toBuilder()
.setTopicProvider(NestedValueProvider.of(topic, new TopicTranslator()))
.build();
}
示例6: withLiteralGqlQuery
import org.apache.beam.sdk.options.ValueProvider; //导入方法依赖的package包/类
/**
* Same as {@link Read#withLiteralGqlQuery(String)} but with a {@link ValueProvider}.
*/
@Experimental(Kind.SOURCE_SINK)
public DatastoreV1.Read withLiteralGqlQuery(ValueProvider<String> gqlQuery) {
checkArgument(gqlQuery != null, "gqlQuery can not be null");
if (gqlQuery.isAccessible()) {
checkArgument(gqlQuery.get() != null, "gqlQuery can not be null");
}
return toBuilder().setLiteralGqlQuery(gqlQuery).build();
}