showuon commented on code in PR #13923:
URL: https://github.com/apache/kafka/pull/13923#discussion_r1247591766


##########
storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteStorageManager.java:
##########
@@ -107,20 +110,26 @@ InputStream fetchLogSegment(RemoteLogSegmentMetadata 
remoteLogSegmentMetadata,
      * @param endPosition              end position of log segment to be read, 
inclusive.
      * @return input stream of the requested log segment data.
      * @throws RemoteStorageException          if there are any errors while 
fetching the desired segment.
-     * @throws RemoteResourceNotFoundException when there are no resources 
associated with the given remoteLogSegmentMetadata.
+     * @throws RemoteResourceNotFoundException the requested log segment is 
not found in the remote storage.
      */
     InputStream fetchLogSegment(RemoteLogSegmentMetadata 
remoteLogSegmentMetadata,
                                 int startPosition,
                                 int endPosition) throws RemoteStorageException;
 
     /**
      * Returns the index for the respective log segment of {@link 
RemoteLogSegmentMetadata}.
+     * <p>
+     * If the index is not present (e.g. Transaction index may not exist 
because segments create prior to
+     * version 2.8.0 will not have transaction index associated with them.),
+     * throws {@link RemoteResourceNotFoundException}
      *
      * @param remoteLogSegmentMetadata metadata about the remote log segment.
      * @param indexType                type of the index to be fetched for the 
segment.
      * @return input stream of the requested index.
      * @throws RemoteStorageException          if there are any errors while 
fetching the index.
-     * @throws RemoteResourceNotFoundException when there are no resources 
associated with the given remoteLogSegmentMetadata.
+     * @throws RemoteResourceNotFoundException the requested index is not 
found in the remote storage.
+     * The caller of this function are encouraged to re-create the indexes 
from the segment
+     * as the suggested way of handling this error.

Review Comment:
   This is confused because transactionIndex should be expected to be 
non-existed. Maybe we can put it this way:
   `The caller of this function are encouraged to re-create the indexes from 
the segment as the suggested way of handling this error if the index is 
expected to be existed.`
   
   WDYT?



##########
storage/api/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteStorageManager.java:
##########
@@ -107,20 +110,26 @@ InputStream fetchLogSegment(RemoteLogSegmentMetadata 
remoteLogSegmentMetadata,
      * @param endPosition              end position of log segment to be read, 
inclusive.
      * @return input stream of the requested log segment data.
      * @throws RemoteStorageException          if there are any errors while 
fetching the desired segment.
-     * @throws RemoteResourceNotFoundException when there are no resources 
associated with the given remoteLogSegmentMetadata.
+     * @throws RemoteResourceNotFoundException the requested log segment is 
not found in the remote storage.
      */
     InputStream fetchLogSegment(RemoteLogSegmentMetadata 
remoteLogSegmentMetadata,
                                 int startPosition,
                                 int endPosition) throws RemoteStorageException;
 
     /**
      * Returns the index for the respective log segment of {@link 
RemoteLogSegmentMetadata}.
+     * <p>
+     * If the index is not present (e.g. Transaction index may not exist 
because segments create prior to
+     * version 2.8.0 will not have transaction index associated with them.),

Review Comment:
   I think this line should be put below:
   
   `* @throws RemoteResourceNotFoundException the requested index is not found 
in the remote storage (e.g. Transaction index may not exist because segments 
create prior to version 2.8.0 will not have transaction index associated with 
them.).`
   
   WDYT?



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to