本文整理汇总了Java中org.apache.beam.sdk.Pipeline.applyTransform方法的典型用法代码示例。如果您正苦于以下问题:Java Pipeline.applyTransform方法的具体用法?Java Pipeline.applyTransform怎么用?Java Pipeline.applyTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.beam.sdk.Pipeline
的用法示例。
在下文中一共展示了Pipeline.applyTransform方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expand
import org.apache.beam.sdk.Pipeline; //导入方法依赖的package包/类
@Override
public PCollection<T> expand(PBegin input) {
try {
Coder<T> coder;
if (elementCoder.isPresent()) {
coder = elementCoder.get();
} else if (typeDescriptor.isPresent()) {
coder = input.getPipeline().getCoderRegistry().getCoder(typeDescriptor.get());
} else {
Iterable<T> rawElements =
Iterables.transform(
timestampedElements,
new Function<TimestampedValue<T>, T>() {
@Override
public T apply(TimestampedValue<T> timestampedValue) {
return timestampedValue.getValue();
}
});
coder = getDefaultCreateCoder(input.getPipeline().getCoderRegistry(), rawElements);
}
PCollection<TimestampedValue<T>> intermediate = Pipeline.applyTransform(input,
Create.of(timestampedElements).withCoder(TimestampedValueCoder.of(coder)));
PCollection<T> output = intermediate.apply(ParDo.of(new ConvertTimestamps<T>()));
output.setCoder(coder);
return output;
} catch (CannotProvideCoderException e) {
throw new IllegalArgumentException("Unable to infer a coder and no Coder was specified. "
+ "Please set a coder by invoking CreateTimestamped.withCoder() explicitly.", e);
}
}
示例2: apply
import org.apache.beam.sdk.Pipeline; //导入方法依赖的package包/类
/**
* Like {@link #apply(String, PTransform)} but defaulting to the name
* provided by the {@link PTransform}.
*/
public <OutputT extends POutput> OutputT apply(
PTransform<KeyedPCollectionTuple<K>, OutputT> transform) {
return Pipeline.applyTransform(this, transform);
}
示例3: apply
import org.apache.beam.sdk.Pipeline; //导入方法依赖的package包/类
/**
* Like {@link #apply(String, PTransform)} but defaulting to the name of the {@link PTransform}.
*/
public <OutputT extends POutput> OutputT apply(PTransform<? super PBegin, OutputT> t) {
return Pipeline.applyTransform(this, t);
}
示例4: apply
import org.apache.beam.sdk.Pipeline; //导入方法依赖的package包/类
/**
* Like {@link #apply(String, PTransform)} but defaulting to the name
* of the {@code PTransform}.
*/
public <OutputT extends POutput> OutputT apply(
PTransform<PCollectionList<T>, OutputT> t) {
return Pipeline.applyTransform(this, t);
}
示例5: apply
import org.apache.beam.sdk.Pipeline; //导入方法依赖的package包/类
/**
* Like {@link IsBounded#apply(String, PTransform)} but defaulting to the name
* of the {@link PTransform}.
*
* @return the output of the applied {@link PTransform}
*/
public <OutputT extends POutput> OutputT apply(PTransform<? super PCollection<T>, OutputT> t) {
return Pipeline.applyTransform(this, t);
}
示例6: apply
import org.apache.beam.sdk.Pipeline; //导入方法依赖的package包/类
/**
* Like {@link #apply(String, PTransform)} but defaulting to the name
* of the {@link PTransform}.
*
* @return the output of the applied {@link PTransform}
*/
public <OutputT extends POutput> OutputT apply(
PTransform<PCollectionTuple, OutputT> t) {
return Pipeline.applyTransform(this, t);
}