Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
227c3a1
raw
Vladsz83 Feb 18, 2026
1e1dd00
fix
Vladsz83 Feb 18, 2026
43f4267
fix
Vladsz83 Feb 18, 2026
d68b352
fix
Vladsz83 Feb 19, 2026
5ac43ab
Merge branch 'master' into Message-serializer-for-TcpDiscoveryNodeAdd…
Vladsz83 Feb 19, 2026
1064805
refactoring. + dedicated if
Vladsz83 Feb 19, 2026
4adf01a
impl
Vladsz83 Feb 19, 2026
330d359
Revert "impl"
Vladsz83 Feb 19, 2026
1baa2f2
Revert "refactoring. + dedicated if"
Vladsz83 Feb 19, 2026
9067b9b
fix the serialization
Vladsz83 Feb 19, 2026
d4e6b2b
fixes
Vladsz83 Feb 20, 2026
fb52e0e
fixes
Vladsz83 Feb 20, 2026
333185b
fixes
Vladsz83 Feb 21, 2026
31a3d29
lost serialization fix
Vladsz83 Feb 21, 2026
0a2b97e
Merge branch 'master' into TcpDiscoveryNodeAddedMessage
Vladsz83 Feb 21, 2026
7272166
+ master
Vladsz83 Feb 21, 2026
31c46d9
minor
Vladsz83 Feb 21, 2026
e3e7ae2
impl
Vladsz83 Feb 21, 2026
629d051
impl
Vladsz83 Feb 22, 2026
c8a1ac8
fix
Vladsz83 Feb 22, 2026
ff8a9ee
fix
Vladsz83 Feb 22, 2026
15000d1
+ datapacket serr
Vladsz83 Feb 22, 2026
7b1351d
fix
Vladsz83 Feb 23, 2026
c1d3f81
minority
Vladsz83 Feb 23, 2026
0e72fe3
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Feb 24, 2026
ccc0c85
merged master
Vladsz83 Feb 24, 2026
e75a62c
reserach
Vladsz83 Feb 24, 2026
a9b9ed4
Revert "reserach"
Vladsz83 Feb 24, 2026
f47b463
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Feb 24, 2026
d3aa143
impl
Vladsz83 Feb 24, 2026
a1f9eac
+ TcpDiscoveryJoinRequestMessage
Vladsz83 Feb 24, 2026
0b45e48
raw
Vladsz83 Feb 25, 2026
317fc54
cleanup
Vladsz83 Feb 25, 2026
c66b10c
cleanup & fix
Vladsz83 Feb 25, 2026
15d65fc
remove extrnalizable from TcpDiscoveryNode
Vladsz83 Feb 25, 2026
2d708cc
Merge branch 'master' into IGNITE-27556-TcpDiscoveryNodeAddedMessage_…
Vladsz83 Feb 25, 2026
7dcbdcf
- externalizable TcpDiscoveryNode
Vladsz83 Feb 25, 2026
c89a94e
Merge branch 'master' into IGNITE-27899-Make-TcpDiscoveryNode-impleme…
Vladsz83 Feb 28, 2026
4c8073e
+ master
Vladsz83 Feb 28, 2026
890ba23
+ master
Vladsz83 Feb 28, 2026
1131fa7
fixes
Vladsz83 Feb 28, 2026
95f8f83
research
Vladsz83 Feb 28, 2026
cb0e819
minority
Vladsz83 Mar 1, 2026
1c903de
reverting ion progress
Vladsz83 Mar 2, 2026
5f633eb
Merge branch 'master' into IGNITE-27899-Make-TcpDiscoveryNode-impleme…
Vladsz83 Mar 2, 2026
7326421
Merge branch 'master' into IGNITE-27899-Make-TcpDiscoveryNode-impleme…
Vladsz83 Mar 11, 2026
aab1fea
+ master, raw
Vladsz83 Mar 11, 2026
7346b3f
Merge branch 'master' into IGNITE-27899-Make-TcpDiscoveryNode-impleme…
Vladsz83 Mar 17, 2026
6736e85
inProgress
Vladsz83 Mar 17, 2026
eff8e7d
reimpl
Vladsz83 Mar 19, 2026
b684cdb
+master
Vladsz83 Mar 19, 2026
9509474
+master
Vladsz83 Mar 19, 2026
c174ccf
fix
Vladsz83 Mar 20, 2026
19db2d0
fix
Vladsz83 Mar 20, 2026
69060b1
Merge remote-tracking branch 'my/IGNITE-27899-Make-TcpDiscoveryNode-i…
Vladsz83 Mar 20, 2026
530d842
fix
Vladsz83 Mar 21, 2026
5321d67
fixes
Vladsz83 Mar 21, 2026
1d85f57
fixes
Vladsz83 Mar 21, 2026
b479a67
Merge branch 'master' into IGNITE-27899-Make-TcpDiscoveryNode-impleme…
Vladsz83 Mar 22, 2026
31b43b3
+ master
Vladsz83 Mar 22, 2026
683a2d1
fix
Vladsz83 Mar 22, 2026
bb8397f
Merge branch 'master' into IGNITE-27899-Make-TcpDiscoveryNode-impleme…
Vladsz83 Mar 26, 2026
6e4f50e
fix
Vladsz83 Mar 26, 2026
064ac60
reimpl
Vladsz83 Mar 28, 2026
567dfc7
fix
Vladsz83 Mar 29, 2026
2cd7ca2
minor fix
Vladsz83 Mar 30, 2026
e1b6ada
Merge branch 'master' into IGNITE-27899-Make-TcpDiscoveryNode-impleme…
Vladsz83 Mar 30, 2026
57a45ce
minor
Vladsz83 Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ private String messageCollectionItemTypes(VariableElement field, TypeMirror type
String descName = field.getSimpleName() + "CollDesc";
String typeName = desc.substring(desc.indexOf(' ') + 1, desc.indexOf('('));

fields.add("private final static " + typeName + " " + descName + " = " + desc + ";");
fields.add("private static final " + typeName + " " + descName + " = " + desc + ";");

return descName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public ClusterMetricsSnapshot() {
* Creates snapshot based on the handled message.
*/
public ClusterMetricsSnapshot(NodeMetricsMessage m) {
// As in #deserialize().
m.lastUpdateTime = U.currentTimeMillis();

this.m = m;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,17 @@
import org.apache.ignite.internal.util.distributed.FullMessageSerializer;
import org.apache.ignite.internal.util.distributed.InitMessage;
import org.apache.ignite.internal.util.distributed.InitMessageSerializer;
import org.apache.ignite.lang.IgniteProductVersion;
import org.apache.ignite.lang.IgniteProductVersionSerializer;
import org.apache.ignite.marshaller.Marshaller;
import org.apache.ignite.plugin.extensions.communication.MessageFactory;
import org.apache.ignite.plugin.extensions.communication.MessageFactoryProvider;
import org.apache.ignite.spi.communication.tcp.internal.TcpConnectionRequestDiscoveryMessage;
import org.apache.ignite.spi.communication.tcp.internal.TcpConnectionRequestDiscoveryMessageSerializer;
import org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacket;
import org.apache.ignite.spi.discovery.tcp.internal.DiscoveryDataPacketSerializer;
import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNodeMarshallableSerializer;
import org.apache.ignite.spi.discovery.tcp.messages.InetAddressMessage;
import org.apache.ignite.spi.discovery.tcp.messages.InetAddressMessageSerializer;
import org.apache.ignite.spi.discovery.tcp.messages.InetSocketAddressMessage;
Expand Down Expand Up @@ -223,6 +227,8 @@ public DiscoveryMessageFactory(Marshaller marsh, ClassLoader clsLdr) {
factory.register(-200, TcpDiscoveryCollectionMessage::new,
new TcpDiscoveryCollectionMessageMarshallableSerializer(marsh, clsLdr));

factory.register(-117, TcpDiscoveryNode::new, new TcpDiscoveryNodeMarshallableSerializer(marsh, clsLdr));
factory.register(-116, IgniteProductVersion::new, new IgniteProductVersionSerializer());
factory.register(-115, SchemaAlterTableAddColumnOperation::new, new SchemaAlterTableAddColumnOperationSerializer());
factory.register(-114, SchemaIndexCreateOperation::new, new SchemaIndexCreateOperationMarshallableSerializer(marsh, clsLdr));
factory.register(-113, SchemaIndexDropOperation::new, new SchemaIndexDropOperationSerializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public void cleanCachesAndGroups() {
*/
public void addCacheGroup(CacheGroupDescriptor grpDesc, IgnitePredicate<ClusterNode> filter, CacheMode cacheMode) {
CacheGroupAffinity old = registeredCacheGrps.put(grpDesc.groupId(),
new CacheGroupAffinity(grpDesc.cacheOrGroupName(), filter, cacheMode, grpDesc.persistenceEnabled()));
new CacheGroupAffinity(filter, cacheMode, grpDesc.persistenceEnabled()));

assert old == null : old;
}
Expand Down Expand Up @@ -3389,9 +3389,6 @@ private Snapshot(AffinityTopologyVersion topVer, DiscoCache discoCache) {
*
*/
private static class CacheGroupAffinity {
/** */
private final String name;

/** Nodes filter. */
private final IgnitePredicate<ClusterNode> cacheFilter;

Expand All @@ -3402,17 +3399,11 @@ private static class CacheGroupAffinity {
private final boolean persistentCacheGrp;

/**
* @param name Name.
* @param cacheFilter Node filter.
* @param cacheMode Cache mode.
* @param persistentCacheGrp Persistence is configured for cache or not.
*/
CacheGroupAffinity(
String name,
IgnitePredicate<ClusterNode> cacheFilter,
CacheMode cacheMode,
boolean persistentCacheGrp) {
this.name = name;
CacheGroupAffinity(IgnitePredicate<ClusterNode> cacheFilter, CacheMode cacheMode, boolean persistentCacheGrp) {
this.cacheFilter = cacheFilter;
this.cacheMode = cacheMode;
this.persistentCacheGrp = persistentCacheGrp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
import java.util.regex.Pattern;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.IgniteVersionUtils;
import org.apache.ignite.internal.Order;
import org.apache.ignite.internal.managers.discovery.DiscoveryMessageFactory;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.plugin.extensions.communication.Message;
import org.jetbrains.annotations.NotNull;

/**
Expand All @@ -37,7 +40,7 @@
* Two versions are compared in the following order: major number,
* minor number, maintenance number, revision timestamp.
*/
public class IgniteProductVersion implements Comparable<IgniteProductVersion>, Externalizable {
public class IgniteProductVersion implements Comparable<IgniteProductVersion>, Externalizable, Message {
/** */
private static final long serialVersionUID = 0L;

Expand All @@ -52,25 +55,31 @@ public class IgniteProductVersion implements Comparable<IgniteProductVersion>, E
Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)([-.]([^0123456789][^-]+)(-SNAPSHOT)?)?(-(\\d+))?(-([\\da-f]+))?");

/** Major version number. */
private byte major;
@Order(0)
byte major;

/** Minor version number. */
private byte minor;
@Order(1)
byte minor;

/** Maintenance version number. */
private byte maintenance;
@Order(2)
byte maintenance;

/** Stage of development. */
private String stage;
@Order(3)
String stage;

/** Revision timestamp. */
private long revTs;
@Order(4)
long revTs;

/** Revision hash. */
private byte[] revHash;
@Order(5)
byte[] revHash;

/**
* Empty constructor required by {@link Externalizable}.
* Empty constructor required by {@link Externalizable} and {@link DiscoveryMessageFactory}.
*/
public IgniteProductVersion() {
// No-op.
Expand Down Expand Up @@ -265,6 +274,11 @@ public int compareToIgnoreTimestamp(@NotNull IgniteProductVersion o) {
revHash = U.readByteArray(in);
}

/** {@inheritDoc} */
@Override public short directType() {
return -116;
}

/** {@inheritDoc} */
@Override public String toString() {
String revTsStr = IgniteVersionUtils.formatBuildTimeStamp(revTs * 1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2240,7 +2240,7 @@ private void processNodeAddedMessage(TcpDiscoveryNodeAddedMessage msg) {
nodeAdded = true;

if (msg.topologyHistory() != null)
topHist.putAll(msg.topologyHistory());
topHist.putAll(upcast(msg.topologyHistory()));
}
else {
if (log.isDebugEnabled())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,11 @@

processed.add(n);

List<ClusterNode> top = U.arrayList(nodes, F.notIn(processed));
Collection<ClusterNode> top = upcast(U.arrayList(nodes, F.notIn(processed)));

topVer++;

NavigableMap<Long, Collection<ClusterNode>> hist = updateTopologyHistory(topVer,
Collections.unmodifiableList(top));
NavigableMap<Long, Collection<ClusterNode>> hist = updateTopologyHistory(topVer, top);

lsnr.onDiscovery(
new DiscoveryNotification(EVT_NODE_FAILED, topVer, n, top, hist, null, null)
Expand Down Expand Up @@ -1907,7 +1906,7 @@
hist = new TreeMap<>(topHist);
}

nodeAddedMsg.topologyHistory(hist);
nodeAddedMsg.topologyHistory(downcast(hist));
}
}
}
Expand Down Expand Up @@ -2451,6 +2450,31 @@
return spi.ignite() instanceof IgniteEx ? ((IgniteEx)spi.ignite()).context().workersRegistry() : null;
}

/**
* Upcasts collection type.
*
* @param <P> Parent type.
* @param <C> Child type.
* @param c Initial collection.
* @return Resulting collection.
*/
private static <P, C extends P> Collection<P> upcast(Collection<C> c) {
return (Collection<P>)c;
}

/**
* Downcasts type of map's collection value.
*
* @param <K> Map key type.
* @param <P> Parent type.
* @param <C> Child type.
* @param m Initial collections map.
* @return Resulting map.
*/
private static <K, P, C extends P> Map<K, Collection<C>> downcast(Map<K, Collection<P>> m) {
return (Map<K, Collection<C>>)(Map)m;

Check warning on line 2475 in modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unnecessary cast to "Map".

See more on https://sonarcloud.io/project/issues?id=apache_ignite&issues=AZ0_oczVpKYvCGPish3v&open=AZ0_oczVpKYvCGPish3v&pullRequest=12955
}

/**
* Discovery messages history used for client reconnect.
*/
Expand Down Expand Up @@ -5086,7 +5110,7 @@
joiningNodesDiscoDataList = new ArrayList<>();

topHist.clear();
topHist.putAll(msg.topologyHistory());
topHist.putAll(upcast(msg.topologyHistory()));

pendingMsgs.reset(msg.messages());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.apache.ignite.internal.processors.tracing.NoopTracing;
import org.apache.ignite.internal.processors.tracing.Tracing;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.A;
import org.apache.ignite.internal.util.typedef.internal.LT;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.spi.IgniteSpiContext;
Expand Down Expand Up @@ -140,18 +139,6 @@
/** Tracing. */
protected Tracing tracing;

/**
* Upcasts collection type.
*
* @param c Initial collection.
* @return Resulting collection.
*/
protected static <T extends R, R> Collection<R> upcast(Collection<T> c) {
A.notNull(c, "c");

return (Collection<R>)c;
}

/**
* @param spi Adapter.
*/
Expand Down Expand Up @@ -495,6 +482,19 @@
return msg.traceLogLevel() ? traceLog : debugLog;
}

/**
* Upcasts type of map's collection value.
*
* @param <K> Map key type.
* @param <P> Parent type.
* @param <C> Child type.
* @param m Initial map of collections.
* @return Resulting map.
*/
protected static <K, P, C extends P> Map<K, Collection<P>> upcast(Map<K, Collection<C>> m) {
return (Map<K, Collection<P>>)(Map)m;

Check warning on line 495 in modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unnecessary cast to "Map".

See more on https://sonarcloud.io/project/issues?id=apache_ignite&issues=AZ0_ocxSpKYvCGPish3o&open=AZ0_ocxSpKYvCGPish3o&pullRequest=12955
}

/**
*
*/
Expand Down
Loading
Loading