-
Notifications
You must be signed in to change notification settings - Fork 135
IGNITE-23484 Do not use ByteUtils#toBytes in zones management #4594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| assertThat(metastore.get(new ByteArray(dataNodeKey[0])).thenApply(Entry::tombstone), willBe(true)); | ||
| } | ||
|
|
||
| private static Map<Node, Integer> deserializeDataNodesMap(byte[] bytes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we use DistributionZonesUtil#deserializeDataNodesMap? The same with deserializeLogicalTopologySet, I see that you have several copies of this method in different test classes, could we us general method? We could add it to this class as well.
| puts[i++] = put(zoneTopologyAugmentation(zoneId), toBytes(zonesState.get(zoneId).topologyAugmentationMap())); | ||
| puts[i++] = put( | ||
| zoneTopologyAugmentation(zoneId), | ||
| VersionedSerialization.toBytes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constructions like
VersionedSerialization.toBytes(
zonesState.get(zoneId).topologyAugmentationMap(),
TopologyAugmentationMapSerializer.INSTANCE
)
look a bit overloaded.
Maybe, we could hide it inside TopologyAugmentationMapSerializer, so it could look like
TopologyAugmentationMapSerializer.toBytes(zonesState.get(zoneId).topologyAugmentationMap())
?
WDYT? Could this idea be adapted to all Serializers/Deserializers in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied this approach where it makes sense
| : "Initial value of nodes' attributes was changed after initialization from the Meta Storage manager."; | ||
| } | ||
|
|
||
| private static Map<UUID, NodeWithAttributes> deserializeNodesAttributes(byte[] bytes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets place it in DistributionZonesUtil as well
https://issues.apache.org/jira/browse/IGNITE-23484