Search code examples
gridgain

gridgain zero dedeployment for GridRunnable class


I am using 6.5.6. On same desktop, running 2 nodes. One is patitioned, and one is client_only runing from IDE(eclipse). using 'CONTINUOUS' as deployment mode. Only one cache named 'partitioned'.

my issue is: I have a GridRunnable static class defined in class which start the 'client_only' node, and in the run method, only print 'hello world'. First time it runs fine. Hello string print out in 'partitioned' node. Keep 'partitioned' node running. Then I changed string to 'hello world x'. Save in my IDE, restart 'client_only', I saw 'partitioned' one still print 'hello world'. restart 'client_only' one again. this time it start printing 'hello world x' in my 'client_only' node now.

It looks it probably should deploy the code change in GridRunnable by itself. I am not sure anywhere I did wrong ? Please help !


Solution

  • For the GridRunnable to be redeployed automatically every time you change the code, you should change the deployment mode to SHARED. This means that once all cluster members that initiated the deployment are gone, the closure will be undeployed - in your case it is the CLIENT_ONLY node.

    However, the same will apply to the data residing in caches - it will be undeployed, as well and the cache will be cleared. To avoid it, you should include the data you plan to cache in the classpath of each data node. Since classes on the local classpath do not get undeployed, the caches will not be cleared in this case.