examples/iot-nirvana/pipeline/src/main/java/com/google/cloud/demo/iot/nirvana/pipeline/TemperaturePipeline.java
/** Load the list of cities to be used as a side input */
Load the list of cities to be used as a side input
Load the list of cities to be used as a side input
static PCollectionView<Map<String, City>> loadCitiesSideInput(Pipeline p) throws FormatException {
    final Map<String, City> cities = TemperatureUtils.loadCities();
    PCollection<KV<String, City>> citiesCollection = p.apply("LoadCities", Create.of(cities));
    PCollectionView<Map<String, City>> citiesCollectionView =
        citiesCollection.apply("CitiesToSingleton", View.<String, City>asMap());
    return citiesCollectionView;
  }
static PCollectionView < Map < String , City > > loadCitiesSideInput ( Pipeline p ) throws FormatException { final Map < String , City > cities = TemperatureUtils . loadCities ( ) ; PCollection < KV < String , City > > citiesCollection = p . apply ( "LoadCities" , Create . of ( cities ) ) ; PCollectionView < Map < String , City > > citiesCollectionView = citiesCollection . apply ( "CitiesToSingleton" , View . < String , City > asMap ( ) ) ; return citiesCollectionView ; }
Load the list of cities to be used as a side input
Load the list of cities to be used as a side input