Skip to content

Conversation

@rpuch
Copy link
Contributor

@rpuch rpuch commented Oct 18, 2024

assertThat(metastore.get(new ByteArray(dataNodeKey[0])).thenApply(Entry::tombstone), willBe(true));
}

private static Map<Node, Integer> deserializeDataNodesMap(byte[] bytes) {
Copy link
Contributor

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(
Copy link
Contributor

@alievmirza alievmirza Oct 28, 2024

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?

Copy link
Contributor Author

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) {
Copy link
Contributor

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

@rpuch rpuch merged commit 7ff9534 into apache:main Oct 28, 2024
@rpuch rpuch deleted the ignite-23484 branch October 28, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants