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


Java ValueProvider.isAccessible方法代码示例

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

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

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

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

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

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


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