Is it possible to hotload a node?

Currently it takes upwards of 1 minute to start the Knime Platform to test changes to a node. Is there a quicker way? Hotload would be nice.

Hi @dandl,

You can improve the startup time of KNIME AP by reducing the number of enabled extensions in the targetplatform file, This is a minimal configuration, close to a freshly installed KNIME AP: https://github.com/knime/knime-sdk-setup/blob/master/org.knime.sdk.setup/KNIME-AP.target

Eclipse supports hot-reloading for many code changes, as long as you do not add new methods / change their signatures or add new classes you do not need to restart the debug instance of KNIME AP.
Eclipse will tell you when the hot reload failed and you do need to restart KNIME AP. For some changes to become active, you will need to replace the node in the workflow with a fresh instance from the node explorer. This is usually the case when you change something in the initialization of the node.

best,
Gabriel

2 Likes

Thanks. For some reason most of the loading time seems to be before loading nodes. That helps, but not much.

I’m happy to learn that Eclipse supports hot-reloading and I can live with the restrictions, but how, exactly? I made a tiny change to a string literal, and I tried both editing a workflow and creating a new one, but the change didn’t show up until I restarted the AP.

I have now started over with a clean new workspace, choosing the latest Release branch and the KNIME-AP.target. It fails after some time with the following 3 errors:

Application error
java.lang.RuntimeException: No application id has been found.
at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:246)
at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:33)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

Could not resolve module: org.eclipse.epp.logging.aeri.ide [162]
Unresolved requirement: Import-Package: org.apache.lucene.document; version="[7.1.0,8.0.0)"

Product org.knime.product.KNIME_PRODUCT could not be found.

Hi @dandl,
this is caused by the target platform not being loaded. Please try setting it again or reloading it.
best,
Gabriel

This is what I meant by this:

best,
Gabriel

But I did that. I made a small modification to a text literal in my node. The I first just deleted and reinserted the node in the AP. When that didn’t work I created an entire new workflow using that node. In each case the instance of the node was the one before modification. When I closed and restarted the AP without making any other changes, both workflows showed the new modified nodes.

How would I diagnose what is happening? Is there a way to log the rebuild and reload of the node?

Not all code can be hot reloaded, you will need to experiment. Also hot reloading requires starting the AP in debug mode from eclipse.
best,
Gabriel

I can see that the class file definitely gets updated, so the problem is in the AP not reloading. I know some kinds of updates are going to break, but it never gets that far.

Nobody mentioned the need to run in debug mode. Obviously that would do it! Thanks!

Just confirming: it works fine in Debug mode. That’s a relief!

1 Like