Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0e77682
Add using CLUSTER_REGION_ID for ordering nodes in ring
SharplEr Jan 20, 2017
c438948
Add tests for RegionNodeComparator
SharplEr Jan 20, 2017
5a7d5e3
Add test to suite
SharplEr Jan 20, 2017
cdcda32
A little clean up code
SharplEr Jan 21, 2017
620be44
Change ordering inside nodes field, and add maxNode field to avoid us…
SharplEr Jan 25, 2017
b45bad8
Add filed to TcpDiscoveryNode for faster getting cluster_region_id
SharplEr Jan 25, 2017
d9b68dd
Fix bug in RegionNodeComparator
SharplEr Jan 27, 2017
f36f07d
Cleanup code in RegionNodeComparatorTest
SharplEr Jan 27, 2017
145394c
Add catch NumberFormatException
SharplEr Jan 27, 2017
eeaf244
cleanup TcpDiscoveryNodesRing
SharplEr Jan 27, 2017
a3431de
Code cleanup
SharplEr Jan 30, 2017
a41ee66
Add @NotNull to RegionNodeComparator.compare
SharplEr Jan 30, 2017
8ebd887
Add @Nullable to TcpDiscoveryNode.getClusterRegionId
SharplEr Jan 30, 2017
fd91a18
cleanup modules/core/src/main/java/org/apache/ignite/spi/discovery/tc…
SharplEr Jan 30, 2017
f4652c8
Remove using cast to Nubmer
SharplEr Jan 30, 2017
6a3ac2e
restore code format
SharplEr Jan 30, 2017
ecb82ff
restore code format2
SharplEr Jan 30, 2017
2e3ec77
fix reusing variable
SharplEr Feb 1, 2017
7705554
Fix lost regionId after deserialization
SharplEr Feb 1, 2017
30d3cd9
Add test for save sorting
SharplEr Feb 1, 2017
3e204be
Add RegionTcpDiscoverySelfTest
SharplEr Feb 2, 2017
f1bdd6c
Add license
SharplEr Feb 2, 2017
5e9343b
Add RegionTcpDiscoverySelfTest to suite
SharplEr Feb 3, 2017
907facf
Remove maxNode
SharplEr Feb 3, 2017
33b8700
Merge RegionTcpDiscoverySelfTest and TcpDiscoverySelfTest
SharplEr Feb 3, 2017
951d838
Hmm, i think i has added it before.
SharplEr Feb 6, 2017
9d2b6bb
Add logic for using old behavior while old nodes still in topology
SharplEr Feb 6, 2017
c3a6270
Remove Java 8 methods like List.sort()
SharplEr Feb 6, 2017
1951e4f
Cleanup code in TcpDiscoveryNodesRing
SharplEr Feb 6, 2017
5515d05
format code
SharplEr Feb 6, 2017
a3ff2c1
More code format
SharplEr Feb 6, 2017
ce7a8f3
remove firstAdd from TcpDiscoveryNodesRing
SharplEr Feb 6, 2017
e40ae0a
Fix converted map types
SharplEr Feb 8, 2017
d4ad9ef
First iteration of fixing code after code review
SharplEr Feb 21, 2017
92b1c84
Add new test
SharplEr Feb 21, 2017
fc354b6
Merge branch 'master' into ignite-4501
SharplEr Feb 21, 2017
7d22a68
Fix javadoc
SharplEr Feb 21, 2017
dd16ce6
Fix version control
SharplEr Feb 21, 2017
2e7f830
Add License
SharplEr Feb 21, 2017
b22a32f
Backup TcpDiscoverySelfTest
SharplEr Feb 21, 2017
d2df15e
Fix conflict
SharplEr Mar 27, 2017
18ca73e
Merge with master
SharplEr Mar 27, 2017
2730699
Merge branch 'ignite-4501' of github.com:SharplEr/ignite into ignite-…
SharplEr Mar 29, 2017
653295a
After CR
SharplEr Mar 29, 2017
7dfaaaf
temp commit
SharplEr Apr 10, 2017
87a63e0
Fix bug in ServerImpl
SharplEr Apr 12, 2017
13466fb
decomposition #decomposition(...)
SharplEr Apr 17, 2017
40adc71
Ops)
SharplEr Apr 17, 2017
08deee3
par Fix bug of coplex ring
SharplEr Apr 25, 2017
0ce5421
Refactoring in TcpDiscoveryNodeAddedMessage
SharplEr May 23, 2017
a19da15
Remove unused vars and args
SharplEr May 23, 2017
083a4e9
Resorted nodes in topHist for fix problems in GridDhtPartitionsExchan…
SharplEr May 24, 2017
cd94b32
commit for Igor
SharplEr May 31, 2017
e727015
.
SharplEr May 31, 2017
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 @@ -544,6 +544,12 @@ public final class IgniteSystemProperties {
*/
public static final String IGNITE_MEMORY_PER_BYTE_COPY_THRESHOLD = "IGNITE_MEMORY_PER_BYTE_COPY_THRESHOLD";

/**
* Cluster region ID used for sorting nodes in ring for discovery.
* <p>
* Defaults to {@code} Long.MIN_VALUE.
*/
public static final String IGNITE_CLUSTER_REGION_ID = "IGNITE_CLUSTER_REGION_ID";
/**
* When set to {@code true} BinaryObject will be unwrapped before passing to IndexingSpi to preserve
* old behavior query processor with IndexingSpi.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,9 @@ public class IgniteConfiguration {
/** */
private boolean lateAffAssignment = DFLT_LATE_AFF_ASSIGNMENT;

/** */
private long clusterRegionId = Long.MIN_VALUE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use "0"? I like "0" better since I can put new nodes prior to nodes started with default config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking it's more predictable behavior: all nodes with default configuration less or equal than nodes with region id.


/**
* Creates valid grid configuration with all default values.
*/
Expand Down Expand Up @@ -517,6 +520,7 @@ public IgniteConfiguration(IgniteConfiguration cfg) {
clientMode = cfg.isClientMode();
clockSyncFreq = cfg.getClockSyncFrequency();
clockSyncSamples = cfg.getClockSyncSamples();
clusterRegionId = cfg.getClusterRegionId();
connectorCfg = cfg.getConnectorConfiguration();
consistentId = cfg.getConsistentId();
daemon = cfg.isDaemon();
Expand Down Expand Up @@ -2686,6 +2690,27 @@ public IgniteConfiguration setLateAffinityAssignment(boolean lateAffAssignment)
return this;
}

/**
* Sets cluster region ID.
*
* @param clusterRegionId Cluster region ID.
* @return {@code this} for chaining.
*/
public IgniteConfiguration setClusterRegionId(long clusterRegionId) {
this.clusterRegionId = clusterRegionId;

return this;
}

/**
* Gets cluster region ID.
*
* @return Cluster region ID.
*/
public long getClusterRegionId(){
return clusterRegionId;
}

/** {@inheritDoc} */
@Override public String toString() {
return S.toString(IgniteConfiguration.class, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ else if (type == EVT_CLIENT_NODE_RECONNECTED) {

checkAttributes(discoCache().remoteNodes());

ctx.service().initCompatibilityMode(discoCache().remoteNodes());
ctx.service().initCompatibilityMode();

// Start discovery worker.
new IgniteThread(discoWrk).start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ private void refreshPartitions() {
* @return {@code True} if message was sent, {@code false} if node left grid.
*/
private boolean sendAllPartitions(Collection<ClusterNode> nodes) {
GridDhtPartitionsFullMessage m = createPartitionsFullMessage(nodes, null, null, true);
GridDhtPartitionsFullMessage m = createPartitionsFullMessage(null, null, true);

if (log.isDebugEnabled())
log.debug("Sending all partitions [nodeIds=" + U.nodeIds(nodes) + ", msg=" + m + ']');
Expand All @@ -838,13 +838,12 @@ private boolean sendAllPartitions(Collection<ClusterNode> nodes) {
}

/**
* @param nodes Target nodes.
* @param exchId Non-null exchange ID if message is created for exchange.
* @param lastVer Last version.
* @param compress {@code True} if it is possible to use compression for message.
* @return Message.
*/
public GridDhtPartitionsFullMessage createPartitionsFullMessage(Collection<ClusterNode> nodes,
public GridDhtPartitionsFullMessage createPartitionsFullMessage(
@Nullable GridDhtPartitionExchangeId exchId,
@Nullable GridCacheVersion lastVer,
boolean compress) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteInClosure;
import org.apache.ignite.lang.IgniteRunnable;
import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
import org.jetbrains.annotations.Nullable;
import org.jsr166.ConcurrentHashMap8;

Expand Down Expand Up @@ -990,15 +991,13 @@ private void sendLocalPartitions(ClusterNode node)
}

/**
* @param nodes Target nodes.
* @param compress {@code True} if it is possible to use compression for message.
* @return Message.
*/
private GridDhtPartitionsFullMessage createPartitionsMessage(Collection<ClusterNode> nodes, boolean compress) {
private GridDhtPartitionsFullMessage createPartitionsMessage(boolean compress) {
GridCacheVersion last = lastVer.get();

return cctx.exchange().createPartitionsFullMessage(nodes,
exchangeId(),
return cctx.exchange().createPartitionsFullMessage(exchangeId(),
last != null ? last : cctx.versions().last(),
compress);
}
Expand All @@ -1008,7 +1007,7 @@ private GridDhtPartitionsFullMessage createPartitionsMessage(Collection<ClusterN
* @throws IgniteCheckedException If failed.
*/
private void sendAllPartitions(Collection<ClusterNode> nodes) throws IgniteCheckedException {
GridDhtPartitionsFullMessage m = createPartitionsMessage(nodes, true);
GridDhtPartitionsFullMessage m = createPartitionsMessage(true);

assert !nodes.contains(cctx.localNode());

Expand Down Expand Up @@ -1264,7 +1263,7 @@ private void onAffinityInitialized(IgniteInternalFuture<Map<Integer, Map<Integer

Map<Integer, Map<Integer, List<UUID>>> assignmentChange = fut.get();

GridDhtPartitionsFullMessage m = createPartitionsMessage(null, false);
GridDhtPartitionsFullMessage m = createPartitionsMessage(false);

CacheAffinityChangeMessage msg = new CacheAffinityChangeMessage(exchId, m, assignmentChange);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1265,10 +1265,8 @@ private Iterator<Cache.Entry<Object, Object>> serviceEntries(IgniteBiPredicate<O
}
}

/**
* @param nodes Remote nodes.
*/
public void initCompatibilityMode(Collection<ClusterNode> nodes) {
/** */
public void initCompatibilityMode() {
boolean mode = false;

if (srvcCompatibilitySysProp != null)
Expand Down
Loading