Vertx with ignite

138 views
Skip to first unread message

Anil

unread,
Oct 8, 2016, 4:20:30 AM10/8/16
to vert.x
HI,

i was looking at Apache Ignite cluster manager and see the grid name given in ignite.xml is replaced with new random name.

private IgniteConfiguration loadConfiguration(URL config) {
    try {
      IgniteConfiguration cfg = F.first(IgnitionEx.loadConfigurations(config).get1());
      setNodeID(cfg);
      return cfg;
    } catch (IgniteCheckedException e) {
      log.error("Configuration loading error:", e);
      throw new RuntimeException(e);
    }
  }

 private void setNodeID(IgniteConfiguration cfg) {
    UUID uuid = UUID.fromString(nodeID);
    cfg.setNodeId(uuid);
    cfg.setGridName(VERTX_NODE_PREFIX + uuid);
  }

was there any specific reason ?

Thanks.

Anil

unread,
Oct 9, 2016, 1:56:39 AM10/9/16
to vert.x

Ignition.ignite(<your grid name>) throws exception as ignite instance grid name has been changed during vertx cluster startup.

any inputs ?

Andrey Gura

unread,
Oct 11, 2016, 8:43:51 AM10/11/16
to vert.x
Actually grid name doesn't make sense in Ignite. The only exception is starting multiple nodes in one JVM (in this case all Ignite instance shuld have unque names).

But if you know some implementation details... In Ignite you can get local node using Ignition.ignite(String name)orIgnition.ignite(UUID uuid) methods. So you can use the following code snippet for getting Ignite instance:
ClusterManager clusterManager = ((VertxInternal)vertx).clusterManager()
String uuid = clusterManager.getNodeID();
Ignite ignite = Ignition.ignite(UUID.fromString(uuid))

Anil

unread,
Oct 12, 2016, 8:53:48 AM10/12/16
to vert.x
HI Andrey,

I did the same thing. I was just trying to understand the reason behind changing the grid name.

i did not see any change in the vertx-ignite cluster manager behavior with/without grid name change.

One can configure number of grids in one ignite cluster. if we override the grid name, how to get the IgniteCache specific to a particular grid ?

Thanks

Andrey Gura

unread,
Oct 12, 2016, 9:58:54 AM10/12/16
to vert.x
Anil,

There are two reasons that I mentioned already:

1. Unit-tests: Because cluster manager tests start many nodes in the same JVM we should give unqiue names to Ignite nodes. Otherwise exception will be thrown, becaue is not allowed to start more than one Ignite node with deafult (or equal) name.
2. Providing client code on vert-x side possibility to get local Ignite instance using node ID.

Does it make sense?

If you have some ideas about node naming please share it.

Anil

unread,
Oct 18, 2016, 2:44:27 AM10/18/16
to vert.x
Thank you Andrey.

This makes sense. this would have no issues with one grid per one ignite cluster. 
Reply all
Reply to author
Forward
0 new messages