showuon commented on code in PR #18888:
URL: https://github.com/apache/kafka/pull/18888#discussion_r1958995928
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteIndexCache.java:
##########
@@ -267,8 +267,9 @@ private void init() throws IOException {
// Delete any .deleted or .tmp files remained from the earlier run of
the broker.
try (Stream<Path> paths = Files.list(cacheDir.toPath())) {
paths.forEach(path -> {
- if (path.endsWith(LogFileUtils.DELETED_FILE_SUFFIX) ||
- path.endsWith(TMP_FILE_SUFFIX)) {
+ String filename = path.getFileName().toString();
+ if (filename.endsWith(LogFileUtils.DELETED_FILE_SUFFIX) ||
+ filename.endsWith(TMP_FILE_SUFFIX)) {
Review Comment:
Could you explain more why the `Path.endsWith` doesn't work well?
--
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]