Configuring a Hybrid Cache Manager
A hybrid
CacheManager configuration is very much like a full
CacheManager (refer to
Cache Manager Configuration and Usage of Server Side
Resources for details), except that instead of taking a FULL
RestartableOffHeapMode type, it takes a PARTIAL
RestartableOffHeapMode type. Everything else remains the same at this configuration level.
EnterpriseServerSideConfigurationBuilder serverSideConfigBuilder =
EnterpriseClusteringServiceConfigurationBuilder
.enterpriseCluster(URI.create(
"terracotta://localhost:9510/my-application"))
.autoCreate()
.defaultServerResource("primary-server-resource")
.restartable("data-root-identifier")
.withRestartableOffHeapMode(RestartableOffHeapMode.PARTIAL); // 1
PersistentCacheManager cacheManager = CacheManagerBuilder
.newCacheManagerBuilder()
.with(serverSideConfigBuilder)
.build(true);
cacheManager.close();
cacheManager.destroy();
1 | EnterpriseClusteringServiceConfigurationBuilder's withRestartableOffHeapMode(RestartableOffHeapMode) API lets you configure a hybrid CacheManager using the value PARTIAL in enum RestartableOffHeapMode. The value of FULL signifies a full (non-hybrid) CacheManager. If this API is not used, the CacheManager is created as a full CacheManager by default. |