soarez commented on code in PR #16042:
URL: https://github.com/apache/kafka/pull/16042#discussion_r1618883471
##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -1259,12 +1260,18 @@ class ReplicaManager(val config: KafkaConfig,
.setIsFutureKey(log.isFuture)
}.toList.asJava)
}.filterNot(_.partitions().isEmpty).toList.asJava
-
- createDescribeLogDirsResult(absolutePath, totalBytes, usableBytes,
topicInfos)
case None =>
- createDescribeLogDirsResult(absolutePath, totalBytes, usableBytes,
Collections.emptyList())
+ Collections.emptyList[DescribeLogDirsTopic]()
}
+ val describeLogDirsResult = new
DescribeLogDirsResponseData.DescribeLogDirsResult()
+ .setLogDir(absolutePath)
+ .setErrorCode(Errors.NONE.code)
+ .setTotalBytes(totalBytes).setUsableBytes(usableBytes)
+ if (!topicInfos.isEmpty)
Review Comment:
Is this check necessary?
##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -1284,6 +1280,20 @@ class ReplicaManager(val config: KafkaConfig,
}.toList
}
+ private def createDescribeLogDirsResult(absolutePath: String,
+ totalBytes: Long,
+ usableBytes: Long,
+ topics:
util.List[DescribeLogDirsResponseData.DescribeLogDirsTopic]):
DescribeLogDirsResponseData.DescribeLogDirsResult = {
+ val describeLogDirsResult = new
DescribeLogDirsResponseData.DescribeLogDirsResult()
+ .setLogDir(absolutePath)
+ .setErrorCode(Errors.NONE.code)
+ .setTotalBytes(totalBytes).setUsableBytes(usableBytes)
+ if (!topics.isEmpty)
Review Comment:
Is this check necessary?
--
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]