
com.google.cloud.dataflow.sdk.runners.worker.SideInputUtils Maven / Gradle / Ivy
/*******************************************************************************
* 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.runners.worker;
import static com.google.cloud.dataflow.sdk.util.Structs.getString;
import com.google.api.services.dataflow.model.SideInputInfo;
import com.google.api.services.dataflow.model.Source;
import com.google.cloud.dataflow.sdk.options.PipelineOptions;
import com.google.cloud.dataflow.sdk.util.CloudObject;
import com.google.cloud.dataflow.sdk.util.ExecutionContext;
import com.google.cloud.dataflow.sdk.util.PropertyNames;
import com.google.cloud.dataflow.sdk.util.common.worker.Reader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Observer;
/**
* Utilities for working with side inputs.
*/
public class SideInputUtils {
static final String SINGLETON_KIND = "singleton";
static final String COLLECTION_KIND = "collection";
/**
* Reads the given side input, producing the contents associated
* with a a {@link PCollectionView}.
*
* @throws Exception anything thrown by the delegate {@link Reader}
*/
public static Object readSideInput(
PipelineOptions options,
SideInputInfo sideInputInfo,
Observer observer,
ExecutionContext executionContext)
throws Exception {
Iterable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy