@Override public void accept(ConfigurationBuilder builder) { super.accept(builder); builder.clustering() .hash().capacityFactor(this.capacityFactor).numOwners(this.owners) .l1().enabled(this.l1Lifespan > 0).lifespan(this.l1Lifespan) ; } }
@Override public void accept(ConfigurationBuilder builder) { super.accept(builder); builder.clustering() .hash().capacityFactor(this.capacityFactor).numOwners(this.owners) .l1().enabled(this.l1Lifespan > 0).lifespan(this.l1Lifespan) ; } }
break; case LIFESPAN: builder.clustering().l1().lifespan(Long.parseLong(value)); break; case INVALIDATION_CLEANUP_TASK_FREQUENCY:
.asyncMarshalling() .l1() .lifespan(5, TimeUnit.MINUTES) .hash() .numOwners(2)
.asyncMarshalling() .l1() .lifespan(5, TimeUnit.MINUTES) .hash() .numOwners(2)
@Override protected void createCacheManagers() throws Throwable { MyBaseControlledConsistentHashFactory chf = new MyBaseControlledConsistentHashFactory(); builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false); builder.clustering().hash().numSegments(1).numOwners(1).consistentHashFactory(chf); builder.clustering().l1().enable().lifespan(10, TimeUnit.MINUTES); createClusteredCaches(3, builder); }
private ConfigurationBuilder getClusteredCfg(CacheMode mode, boolean l1) { ConfigurationBuilder cfg = getBaseCfg(); cfg .locking().lockAcquisitionTimeout(60000) .clustering().cacheMode(mode).remoteTimeout(60000).stateTransfer().fetchInMemoryState(false); if (mode.isDistributed()) { cfg.clustering().l1().enabled(l1).lifespan(120000); } return cfg; }
builder.clustering().l1().enable().lifespan(lifespan); } else { builder.clustering().l1().disable();
.l1() .enabled(l1Enabled) .lifespan(l1Lifespan) .build();