gianm commented on code in PR #13368:
URL: https://github.com/apache/druid/pull/13368#discussion_r1024290996
##########
processing/src/main/java/org/apache/druid/frame/processor/OutputChannelFactory.java:
##########
@@ -31,6 +31,11 @@
*/
OutputChannel openChannel(int partitionNumber) throws IOException;
+ /**
+ * Create a channel pair tagged with a particular name and a flag to delete
the channel data after its read.
+ */
+ PartitionedOutputChannel openChannel(String name, boolean deleteAfterRead)
throws IOException;
Review Comment:
Would be clearer as `openPartitionedChannel`.
##########
processing/src/main/java/org/apache/druid/frame/processor/PartitionedOutputChannel.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * 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.druid.frame.processor;
+
+import com.google.common.base.Preconditions;
+import com.google.common.base.Suppliers;
+import org.apache.druid.frame.allocation.MemoryAllocator;
+import org.apache.druid.frame.channel.PartitionedReadableFrameChannel;
+import org.apache.druid.frame.channel.WritableFrameChannel;
+import org.apache.druid.java.util.common.ISE;
+
+import javax.annotation.Nullable;
+import java.util.function.Function;
+import java.util.function.Supplier;
+
+public class PartitionedOutputChannel
Review Comment:
I wonder if this could be rolled into OutputChannel? i.e. by adding a method
like, `ReadableFrameChannel getReadableChannel(int partitionNumber)`. It would
throw an error for non-partitioned outputs.
##########
processing/src/main/java/org/apache/druid/frame/channel/PartitionedReadableFrameChannel.java:
##########
@@ -0,0 +1,36 @@
+/*
+ * 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.druid.frame.channel;
+
+import java.io.Closeable;
+
+/**
+ * Provides an interface to read a partitioned frame channel. The channel
might have frames with multiple partitions
+ * in it.
+ */
+public interface PartitionedReadableFrameChannel extends Closeable
Review Comment:
This is more of a supplier than an actual channel, so
`PartitionedReadableFrameChannelSupplier`, or something like that, would be a
clearer name.
Javadocs should also describe what happens when this is closed.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]