MINOR: MetaProperties refactor, part 1#14678
Conversation
Since we have added directory.id to MetaProperties, it is no longer safe to assume that all directories on a node contain the same MetaProperties. Therefore, we should get rid of places where we are using a single MetaProperties object to represent the settings of an entire cluster. This PR removes a few such cases. In each case, it is sufficient just to pass cluster ID. The second part of this change refactors KafkaClusterTestKit so that we convert paths to absolute before creating BrokerNode and ControllerNode objects, rather than after. This prepares the way for storing an ensemble of MetaProperties objects in BrokerNode and ControllerNode, which we will do in a follow-up change.
1ac9fd6 to
114f92f
Compare
rondagostino
left a comment
There was a problem hiding this comment.
LGTM in general, just left a couple of nits/small questions. Could potentially merge as-is, but let me know what you think.
The JDK 11 and JDK 17 tests were clean!
| bootstrapMetadataVersion, | ||
| controllerNodes, | ||
| brokerNodes); | ||
| } catch (Exception e) { |
There was a problem hiding this comment.
nit: can be catch (RuntimeException e) { since the code doesn't throw any checked exceptions and the signature of this method does not declare any checked exceptions as being potentially thrown.
There was a problem hiding this comment.
Yeah, that's fair. We can only have RuntimException here. Still, I can see no logical reason why we wouldn't do the deletion if the code was restructured to throw checked exceptions here. So it seems clearer this way.
| metaProperties, | ||
| Uuid.ZERO_UUID.toString, |
There was a problem hiding this comment.
Do we want Uuid.randomUuid.toString instead, which is what we use in RaftManagerTest?
There was a problem hiding this comment.
It's a good question. I don't know why this test chose Uuid.ZERO_UUID. But I figured changing it here was out of scope.
Since we have added directory.id to MetaProperties, it is no longer safe to assume that all directories on a node contain the same MetaProperties. Therefore, we should get rid of places where we are using a single MetaProperties object to represent the settings of an entire cluster. This PR removes a few such cases. In each case, it is sufficient just to pass cluster ID. The second part of this change refactors KafkaClusterTestKit so that we convert paths to absolute before creating BrokerNode and ControllerNode objects, rather than after. This prepares the way for storing an ensemble of MetaProperties objects in BrokerNode and ControllerNode, which we will do in a follow-up change. Reviewers: Ron Dagostino <rndgstn@gmail.com>
Since we have added directory.id to MetaProperties, it is no longer safe to assume that all directories on a node contain the same MetaProperties. Therefore, we should get rid of places where we are using a single MetaProperties object to represent the settings of an entire cluster. This PR removes a few such cases. In each case, it is sufficient just to pass cluster ID. The second part of this change refactors KafkaClusterTestKit so that we convert paths to absolute before creating BrokerNode and ControllerNode objects, rather than after. This prepares the way for storing an ensemble of MetaProperties objects in BrokerNode and ControllerNode, which we will do in a follow-up change. Reviewers: Ron Dagostino <rndgstn@gmail.com>
Since we have added directory.id to MetaProperties, it is no longer safe
to assume that all directories on a node contain the same MetaProperties.
Therefore, we should get rid of places where we are using a single
MetaProperties object to represent the settings of an entire cluster.
This PR removes a few such cases. In each case, it is sufficient just to
pass cluster ID.
The second part of this change refactors KafkaClusterTestKit so that we
convert paths to absolute before creating BrokerNode and ControllerNode
objects, rather than after. This prepares the way for storing an
ensemble of MetaProperties objects in BrokerNode and ControllerNode,
which we will do in a follow-up change.