@Override protected ConfigurationBuilder buildConfiguration() { ConfigurationBuilder builder = super.buildConfiguration(); builder.locking().isolationLevel(isolationLevel); return builder; }
@Override protected void createCacheManagers() throws Throwable { cacheName = "dist"; configuration = buildConfiguration(); // Create clustered caches with failure detection protocols on caches = createClusteredCaches(INIT_CLUSTER_SIZE, cacheName, configuration, new TransportFlags().withFD(false)); if (INIT_CLUSTER_SIZE > 0) c1 = caches.get(0); if (INIT_CLUSTER_SIZE > 1) c2 = caches.get(1); if (INIT_CLUSTER_SIZE > 2) c3 = caches.get(2); if (INIT_CLUSTER_SIZE > 3) c4 = caches.get(3); cacheAddresses = new ArrayList<>(INIT_CLUSTER_SIZE); for (Cache cache : caches) { EmbeddedCacheManager cacheManager = cache.getCacheManager(); cacheAddresses.add(cacheManager.getAddress()); } }
@Override protected ConfigurationBuilder buildConfiguration() { ConfigurationBuilder builder = super.buildConfiguration(); builder.clustering().hash(). consistentHashFactory(factory). numSegments(1); return builder; }
@Override protected ConfigurationBuilder buildConfiguration() { ConfigurationBuilder builder = super.buildConfiguration(); builder .memory() .size(MAX_ENTRIES) .persistence() .passivation(true) .addStore(DummyInMemoryStoreConfigurationBuilder.class); return builder; }
@Override protected ConfigurationBuilder buildConfiguration() { ConfigurationBuilder builder = super.buildConfiguration(); ControlledConsistentHashFactory.Default chf = new ControlledConsistentHashFactory.Default( new int[][]{{0, 1}, {1, 2}}); builder.clustering().hash().numOwners(2).numSegments(2).consistentHashFactory(chf); return builder; }
@Override protected ConfigurationBuilder buildConfiguration() { ConfigurationBuilder cfg = super.buildConfiguration(); StoreConfigurationBuilder<?, ?> storeConfigurationBuilder; if (shared) { storeConfigurationBuilder = cfg.persistence().addStore( new DummyInMemoryStoreConfigurationBuilder(cfg.persistence()).storeName(getClass().getSimpleName())); } else { storeConfigurationBuilder = cfg.persistence().addStore( new DummyInMemoryStoreConfigurationBuilder(cfg.persistence())); } storeConfigurationBuilder .shared(shared) .preload(preload) .segmented(segmented); return cfg; }