ahmedabu98 commented on code in PR #29011:
URL: https://github.com/apache/beam/pull/29011#discussion_r1362704559


##########
sdks/java/io/rrio/src/main/java/org/apache/beam/io/requestresponseio/CacheRead.java:
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.beam.io.requestresponseio;
+
+import com.google.auto.value.AutoValue;
+import java.util.Map;
+import org.apache.beam.io.requestresponseio.CacheRead.Result;
+import org.apache.beam.sdk.Pipeline;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.values.KV;
+import org.apache.beam.sdk.values.PCollection;
+import org.apache.beam.sdk.values.PCollectionTuple;
+import org.apache.beam.sdk.values.PInput;
+import org.apache.beam.sdk.values.POutput;
+import org.apache.beam.sdk.values.PValue;
+import org.apache.beam.sdk.values.TupleTag;
+import 
org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableMap;
+
+/**
+ * {@link CacheRead} reads associated {@link ResponseT} types from {@link 
RequestT} types, if any
+ * exist.
+ */
+class CacheRead<RequestT, ResponseT>
+    extends PTransform<PCollection<RequestT>, Result<RequestT, ResponseT>> {
+
+  private static final TupleTag<ApiIOError> FAILURE_TAG = new 
TupleTag<ApiIOError>() {};
+
+  // TODO(damondouglas): remove suppress warnings after instance utilized.
+  @SuppressWarnings({"unused"})
+  private final Configuration<RequestT, ResponseT> configuration;
+
+  private CacheRead(Configuration<RequestT, ResponseT> configuration) {
+    this.configuration = configuration;
+  }
+
+  /** Configuration details for {@link CacheRead}. */
+  @AutoValue
+  abstract static class Configuration<RequestT, ResponseT> {
+
+    static <RequestT, ResponseT> Builder<RequestT, ResponseT> builder() {
+      return new AutoValue_CacheRead_Configuration.Builder<>();
+    }
+
+    abstract Builder<RequestT, ResponseT> toBuilder();
+
+    @AutoValue.Builder
+    abstract static class Builder<RequestT, ResponseT> {
+
+      abstract Configuration<RequestT, ResponseT> build();
+    }
+  }
+
+  @Override
+  public Result<RequestT, ResponseT> expand(PCollection<RequestT> input) {
+    return Result.of(
+        new TupleTag<KV<RequestT, ResponseT>>() {}, 
PCollectionTuple.empty(input.getPipeline()));
+  }
+
+  /**
+   * The {@link Result} of reading RequestT {@link PCollection} elements 
yielding ResponseT {@link
+   * PCollection} elements.
+   */
+  static class Result<RequestT, ResponseT> implements POutput {

Review Comment:
   After talking to other folks, I take back my statement. PDone is the 
problematic class, not POutput so this should be good to go



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to