use of org.infinispan.container.offheap.OffHeapDataContainer in project wildfly by wildfly.
the class DataContainerFactory method createUnboundedContainer.
private DataContainer<?, ?> createUnboundedContainer() {
ClusteringConfiguration clustering = this.configuration.clustering();
boolean segmented = clustering.cacheMode().needsStateTransfer();
int level = this.configuration.locking().concurrencyLevel();
boolean offHeap = this.configuration.memory().isOffHeap();
if (segmented) {
Supplier<PeekableTouchableMap<WrappedBytes, WrappedBytes>> mapSupplier = offHeap ? this::createAndStartOffHeapConcurrentMap : PeekableTouchableContainerMap::new;
int segments = clustering.hash().numSegments();
return clustering.l1().enabled() ? new L1SegmentedDataContainer<>(mapSupplier, segments) : new DefaultSegmentedDataContainer<>(mapSupplier, segments);
}
return offHeap ? new OffHeapDataContainer() : DefaultDataContainer.unBoundedDataContainer(level);
}
Aggregations