MINOR: Clean up core server classes#15272
Conversation
| case Some(partition) => | ||
| if (!partition.replicas.contains(brokerId)) { | ||
| info(s"Found stray log dir $log: the current replica assignment ${partition.replicas} " + | ||
| info(s"Found stray log dir $log: the current replica assignment ${partition.replicas.mkString("Array(", ", ", ")")} " + |
There was a problem hiding this comment.
This actually should have printed the memory reference and not the contents. With the current version, it prints the contents.
| val configProps = conf.dynamicConfig.fromPersistentProps(persistentProps, perBrokerConfig) | ||
| val alterConfigOps = resource.configs().asScala.map { | ||
| case config => | ||
| config => |
There was a problem hiding this comment.
Previous code was the standard in really old version of Scala, since then anonymous function style is preferred.
| ): AlterConfigsResponseData = { | ||
| val response = new AlterConfigsResponseData() | ||
| val responsesByResource = persistentResponses.responses().iterator().asScala.map { | ||
| case r => (r.resourceName(), r.resourceType()) -> new ApiError(r.errorCode(), r.errorMessage()) |
There was a problem hiding this comment.
Previous code was the standard in really old version of Scala, since then anonymous function style is preferred.
| def describeConfigs(resourceToConfigNames: List[DescribeConfigsResource], | ||
| includeSynonyms: Boolean, | ||
| includeDocumentation: Boolean): List[DescribeConfigsResponseData.DescribeConfigsResult] = { | ||
| resourceToConfigNames.map { case resource => |
There was a problem hiding this comment.
Previous code was the standard in really old version of Scala, since then anonymous function style is preferred.
| } | ||
| quotaDelta.changes().entrySet().forEach { e => | ||
| handleUserClientQuotaChange(userClientEntity, e.getKey, e.getValue.asScala.map(_.toDouble)) | ||
| handleUserClientQuotaChange(userClientEntity, e.getKey, e.getValue.asScala) |
There was a problem hiding this comment.
The map to Double wasn't needed as it was already a double
|
@showuon if you have some time, this is a follow up of the one you reviewed already. |
mimaison
left a comment
There was a problem hiding this comment.
LGTM, pending a good CI result
206fc68 to
96d67cd
Compare
|
Needed to rebase because of merge conflicts |
Mark methods and fields private where possible Annotate public methods and fields Remove unused classes and methods Make sure Arrays are not printed with .toString Optimize minor warnings
Signed-off-by: Josep Prat <josep.prat@aiven.io>
96d67cd to
7f08216
Compare
|
Rebased again to contain #15290 |
|
I checked that all tests pass locally, and the failures in CI seem all unrelated to the changes. |
* MINOR: Clean up core server classes Mark methods and fields private where possible Annotate public methods and fields Remove unused classes and methods Make sure Arrays are not printed with .toString Optimize minor warnings Remove unused apply method Signed-off-by: Josep Prat <josep.prat@aiven.io> Reviewers: Mickael Maison <mickael.maison@gmail.com>
* MINOR: Clean up core server classes Mark methods and fields private where possible Annotate public methods and fields Remove unused classes and methods Make sure Arrays are not printed with .toString Optimize minor warnings Remove unused apply method Signed-off-by: Josep Prat <josep.prat@aiven.io> Reviewers: Mickael Maison <mickael.maison@gmail.com>
* MINOR: Clean up core server classes Mark methods and fields private where possible Annotate public methods and fields Remove unused classes and methods Make sure Arrays are not printed with .toString Optimize minor warnings Remove unused apply method Signed-off-by: Josep Prat <josep.prat@aiven.io> Reviewers: Mickael Maison <mickael.maison@gmail.com>
Follow up from #15252
Mark methods and fields private where possible:
Committer Checklist (excluded from commit message)