I would like to clarify the differences between the following:
ignite.getOrCreateCache(cfg);
and
ignite.cache("cacheName")
The documentation on cache()
says it
Gets an instance of IgniteCache API.
As for getOrCreateCache
,
Gets existing cache with the given name or creates new one with the given configuration.
But they both return IgniteCache
. Thank you!
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/Ignite.html
With getOrCreateCache
you can provide cache configuration that will be used to create new cache in case it doesn't exist yet. cache
method will return null
in this case.