Hi,
I introduced the delay of 5 seconds and it worked.
1) What is exchange process and how to identify whether exchange process is
finished?
2) I am doing partition key aware data loading and I want to start load
process from server node only and not from the client node. I just want to
initiate my load process only after all the configured nodes are up and
running.
For that I am using Distributed count down latch. Each node when started
reduces the count on LifecycleEventType.AFTER_NODE_START event. When this
count down latch count becomes zero, cache.loadCache() method is invoked
and this method is always executed from the node which joins the cluster
last.
Is there any better way to achieve this?
3) I also want to make sure that if any other node joins the cluster after
the data loading process is comeplete, cache.loadCache method is not
invoked and the data is made available to this node using re-balancing
process.
I am thinking to use some variable which will tell the cache loading is
complete. Does ignite have any builtin feature to achieve this?
Code is as shown below to get the ignite partitions.
private List getPrimaryParitionIdsLocalToNode() {
Affinity affinity = igniteSpringBean.affinity(cacheName);
ClusterNode locNode = igniteSpringBean.cluster().localNode();
List primaryPartitionIds =
Arrays.stream(affinity.primaryPartitions(locNode)).boxed()
.collect(Collectors.toList());
LOGGER.info("Primary Partition Ids for Node {} are {}",
locNode.id(), primaryPartitionIds);
LOGGER.info("Number of Primary Partition Ids for Node {} are {}",
locNode.id(), primaryPartitionIds.size());
return primaryPartitionIds;
}
private List getBackupParitionIdsLocalToNode() {
Affinity affinity = igniteSpringBean.affinity(cacheName);
ClusterNode locNode = igniteSpringBean.cluster().localNode();
List backPartitionIds =
Arrays.stream(affinity.backupPartitions(locNode)).boxed()
.collect(Collectors.toList());
LOGGER.info("Backup Partition Ids for Node {} are {}", locNode.id(),
backPartitionIds);
LOGGER.info("Number of Backup Partition Ids for Node {} are {}",
locNode.id(), backPartitionIds.size());
return backPartitionIds;
}
Thanks,
Akash
On Wed, Aug 8, 2018 at 1:16 PM dkarachentsev
wrote:
> Hi Akash,
>
> How do you measure partition distribution? Can you provide code for that
> test? I can assume that you get partitions before exchange process if
> finished. Try to use delay in 5 sec after all nodes are started and check
> again.
>
> Thanks!
> -Dmitry
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>