bruno-roustant commented on code in PR #2012:
URL: https://github.com/apache/solr/pull/2012#discussion_r1363599215


##########
solr/core/src/java/org/apache/solr/update/TransactionLog.java:
##########
@@ -987,4 +1022,28 @@ public String toString() {
           + position();
     }
   }
+
+  /** Opens {@link OutputStream} from {@link FileChannel}. */
+  protected interface OutputStreamOpener {
+
+    /**
+     * Opens an {@link OutputStream} to write in a {@link FileChannel}.
+     *
+     * @param position The initial write position of the {@link OutputStream} 
view of the {@link
+     *     FileChannel}.
+     */
+    OutputStream open(FileChannel channel, long position) throws IOException;
+  }
+
+  /** Opens {@link ChannelFastInputStream} from {@link FileChannel}. */
+  protected interface ChannelInputStreamOpener {
+
+    /**
+     * Opens a {@link ChannelFastInputStream} to read a {@link FileChannel}.
+     *
+     * @param position The initial read position of the {@link OutputStream} 
view of the {@link
+     *     FileChannel}.
+     */
+    ChannelFastInputStream open(FileChannel channel, long position) throws 
IOException;

Review Comment:
   I added `throws IOException` to `getReader()` and `getSortedReader()` first 
for consistency with `getReverseReader()` which already throws IOE. I want the 
caller to know if there is an issue when creating a reader, and up to the 
caller to decide what to do.
   Then, in `UpdateLog.doReplay()`, we have the choice of either catch and log 
and return, or throw an unchecked exception which is caught anyway in 
`UpdateLog.run()` to log it.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to