All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.dataflow.sdk.values.PBegin Maven / Gradle / Ivy

Go to download

Google Cloud Dataflow Java SDK provides a simple, Java-based interface for processing virtually any size data using Google cloud resources. This artifact includes entire Dataflow Java SDK.

There is a newer version: 2.5.0
Show newest version
/*
 * Copyright (C) 2015 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.cloud.dataflow.sdk.values;

import com.google.cloud.dataflow.sdk.Pipeline;
import com.google.cloud.dataflow.sdk.io.TextIO.Read;
import com.google.cloud.dataflow.sdk.transforms.Create;
import com.google.cloud.dataflow.sdk.transforms.PTransform;

import java.util.Collection;
import java.util.Collections;

/**
 * {@link PBegin} is the "input" to a root {@link PTransform}, such as {@link Read Read} or
 * {@link Create}.
 *
 * 

Typically created by calling {@link Pipeline#begin} on a Pipeline. */ public class PBegin implements PInput { /** * Returns a {@link PBegin} in the given {@link Pipeline}. */ public static PBegin in(Pipeline pipeline) { return new PBegin(pipeline); } /** * Like {@link #apply(String, PTransform)} but defaulting to the name * of the {@link PTransform}. */ public OutputT apply( PTransform t) { return Pipeline.applyTransform(this, t); } /** * Applies the given {@link PTransform} to this input {@link PBegin}, * using {@code name} to identify this specific application of the transform. * This name is used in various places, including the monitoring UI, logging, * and to stably identify this application node in the job graph. */ public OutputT apply( String name, PTransform t) { return Pipeline.applyTransform(name, this, t); } @Override public Pipeline getPipeline() { return pipeline; } @Override public Collection expand() { // A PBegin contains no PValues. return Collections.emptyList(); } @Override public void finishSpecifying() { // Nothing more to be done. } ///////////////////////////////////////////////////////////////////////////// /** * Constructs a {@link PBegin} in the given {@link Pipeline}. */ protected PBegin(Pipeline pipeline) { this.pipeline = pipeline; } private final Pipeline pipeline; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy