Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -30,6 +30,7 @@
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.cache.CacheMetrics;
import org.apache.ignite.cluster.ClusterMetrics;
import org.apache.ignite.cluster.ClusterNode;
Expand Down Expand Up @@ -590,7 +591,6 @@ public TcpDiscoveryNode clientReconnectNode(Map<String, Object> nodeAttrs) {
out.writeLong(intOrder);
out.writeObject(ver);
U.writeUuid(out, clientRouterNodeId);
out.writeObject(dcId);
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -628,7 +628,7 @@ public TcpDiscoveryNode clientReconnectNode(Map<String, Object> nodeAttrs) {
else
consistentId = consistentIdAttr != null ? consistentIdAttr : U.consistentId(addrs, discPort);

dcId = (String)in.readObject();
dcId = (String)attrs.get(IgniteSystemProperties.IGNITE_DATA_CENTER_ID);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ public class MultiDataCenterDeploymentTest extends GridCommonAbstractTest {
return cfg;
}

/** {@inheritDoc} */
@Override protected IgniteConfiguration optimize(IgniteConfiguration cfg) throws IgniteCheckedException {
// super.optimize() method sets includeProperties to a non-null value which later leads to
// IgniteSystemProperties not being added to node attributes.
// This test relies on the presence of IgniteSystemProperties in node attributes so we need set includeProperties to null.
return super.optimize(cfg).setIncludeProperties((String[])null);
}

/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
super.afterTest();
Expand All @@ -68,8 +76,11 @@ public void testAttributeSetLocallyFromSystemProperty() throws Exception {
String dcId = testGrid.localNode().dataCenterId();

assertNotNull("Data Center ID of the node should not be null", dcId);

assertEquals(DC_ID_0, dcId);

String dcIdFromSysProp = testGrid.localNode().attribute(IgniteSystemProperties.IGNITE_DATA_CENTER_ID);
assertNotNull("Data Center ID of the node should not be null", dcIdFromSysProp);
assertEquals(DC_ID_0, dcIdFromSysProp);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.IgniteSystemProperties;
import org.apache.ignite.cache.CacheMetrics;
import org.apache.ignite.cluster.ClusterMetrics;
import org.apache.ignite.internal.ClusterMetricsSnapshot;
Expand Down Expand Up @@ -340,8 +341,6 @@ public void local(boolean loc) {
mtr = ClusterMetricsSnapshot.serialize(metrics);

U.writeByteArray(out, mtr);

out.writeObject(dcId);
}

/** {@inheritDoc} */
Expand All @@ -363,7 +362,7 @@ public void local(boolean loc) {
if (mtr != null)
metrics = ClusterMetricsSnapshot.deserialize(mtr, 0);

dcId = (String)in.readObject();
dcId = (String)attrs.get(IgniteSystemProperties.IGNITE_DATA_CENTER_ID);
}

/** {@inheritDoc} */
Expand Down
Loading