private long capacity = CachingConstants.DEFAULT_CACHE_CAPACITY;
private EvictionAlgorithm evictionAlgorithm = CachingConstants.DEFAULT_EVICTION_ALGORITHM;
public CacheImpl(String cacheName, CacheManager cacheManager) {
CarbonContext carbonContext = CarbonContext.getThreadLocalCarbonContext();
if (carbonContext == null) {
throw new IllegalStateException("CarbonContext cannot be null");
}
ownerTenantDomain = carbonContext.getTenantDomain();
if (ownerTenantDomain == null) {
throw new IllegalStateException("Tenant domain cannot be " + ownerTenantDomain);
}
ownerTenantId = carbonContext.getTenantId();
if (ownerTenantId == MultitenantConstants.INVALID_TENANT_ID) {
throw new IllegalStateException("Tenant ID cannot be " + ownerTenantId);
}
this.cacheName = cacheName;
this.cacheManager = cacheManager;