[
https://issues.apache.org/jira/browse/IGNITE-27906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vyacheslav Koptilin updated IGNITE-27906:
-----------------------------------------
Description:
{code:java}
Set<UUID> nodeIds =
currentTopologySnapshot.nodes().stream().map(LogicalNode::id).collect(toSet());
if (!nodeIds.contains(lease.getLeaseholderId())) {
LOG.info("Lease was not negotiated because the node has left the logical
topology [node={}, nodeId={}, group={}]",
lease.getLeaseholder(), lease.getLeaseholderId(), groupId);
responseFut.complete(null);
}{code}
It is not needed to create a new collection `nodeIds` to check that the given
`lease` is a part of the current logical topology.
was:
{code:java}
Set<UUID> nodeIds =
currentTopologySnapshot.nodes().stream().map(LogicalNode::id).collect(toSet());
if (!nodeIds.contains(lease.getLeaseholderId())) {
LOG.info("Lease was not negotiated because the node has left
the logical topology [node={}, nodeId={}, group={}]",
lease.getLeaseholder(), lease.getLeaseholderId(),
groupId); responseFut.complete(null);
}
{code}
> Avoid creating redundant copies of logical topology nodes.
> ----------------------------------------------------------
>
> Key: IGNITE-27906
> URL: https://issues.apache.org/jira/browse/IGNITE-27906
> Project: Ignite
> Issue Type: Improvement
> Reporter: Vyacheslav Koptilin
> Assignee: Vyacheslav Koptilin
> Priority: Trivial
>
> {code:java}
> Set<UUID> nodeIds =
> currentTopologySnapshot.nodes().stream().map(LogicalNode::id).collect(toSet());
> if (!nodeIds.contains(lease.getLeaseholderId())) {
> LOG.info("Lease was not negotiated because the node has left the logical
> topology [node={}, nodeId={}, group={}]",
> lease.getLeaseholder(), lease.getLeaseholderId(), groupId);
> responseFut.complete(null);
> }{code}
> It is not needed to create a new collection `nodeIds` to check that the given
> `lease` is a part of the current logical topology.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)