All Downloads are FREE. Search and download functionalities are using the official Maven repository.

keycloakjar.com.github.benmanes.caffeine.cache.WSLMS Maven / Gradle / Ivy

There is a newer version: 2.2.3
Show newest version
// Copyright 2020 Ben Manes. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.github.benmanes.caffeine.cache;

/**
 * WARNING: GENERATED CODE
 *
 * 

A cache that provides the following features: * *

    *
  • MaximumSize *
  • WeakKeys (inherited) *
  • StrongValues (inherited) *
  • Listening (inherited) *
* * @author [email protected] (Ben Manes) */ @SuppressWarnings({"unchecked", "MissingOverride", "NullAway"}) class WSLMS extends WSL { long maximum; long weightedSize; long windowMaximum; long windowWeightedSize; long mainProtectedMaximum; long mainProtectedWeightedSize; double stepSize; long adjustment; int hitsInSample; int missesInSample; double previousSampleHitRate; final FrequencySketch sketch; final AccessOrderDeque> accessOrderWindowDeque; final AccessOrderDeque> accessOrderProbationDeque; final AccessOrderDeque> accessOrderProtectedDeque; final MpscGrowableArrayQueue writeBuffer; WSLMS(Caffeine builder, CacheLoader cacheLoader, boolean async) { super(builder, cacheLoader, async); this.sketch = new FrequencySketch(); if (builder.hasInitialCapacity()) { long capacity = Math.min(builder.getMaximum(), builder.getInitialCapacity()); this.sketch.ensureCapacity(capacity); } this.accessOrderWindowDeque = builder.evicts() || builder.expiresAfterAccess() ? new AccessOrderDeque>() : null; this.accessOrderProbationDeque = new AccessOrderDeque>(); this.accessOrderProtectedDeque = new AccessOrderDeque>(); this.writeBuffer = new MpscGrowableArrayQueue<>(WRITE_BUFFER_MIN, WRITE_BUFFER_MAX); } protected final boolean evicts() { return true; } protected final long maximum() { return maximum; } protected final void setMaximum(long maximum) { this.maximum = maximum; } protected final long weightedSize() { return weightedSize; } protected final void setWeightedSize(long weightedSize) { this.weightedSize = weightedSize; } protected final long windowMaximum() { return windowMaximum; } protected final void setWindowMaximum(long windowMaximum) { this.windowMaximum = windowMaximum; } protected final long windowWeightedSize() { return windowWeightedSize; } protected final void setWindowWeightedSize(long windowWeightedSize) { this.windowWeightedSize = windowWeightedSize; } protected final long mainProtectedMaximum() { return mainProtectedMaximum; } protected final void setMainProtectedMaximum(long mainProtectedMaximum) { this.mainProtectedMaximum = mainProtectedMaximum; } protected final long mainProtectedWeightedSize() { return mainProtectedWeightedSize; } protected final void setMainProtectedWeightedSize(long mainProtectedWeightedSize) { this.mainProtectedWeightedSize = mainProtectedWeightedSize; } protected final double stepSize() { return stepSize; } protected final void setStepSize(double stepSize) { this.stepSize = stepSize; } protected final long adjustment() { return adjustment; } protected final void setAdjustment(long adjustment) { this.adjustment = adjustment; } protected final int hitsInSample() { return hitsInSample; } protected final void setHitsInSample(int hitsInSample) { this.hitsInSample = hitsInSample; } protected final int missesInSample() { return missesInSample; } protected final void setMissesInSample(int missesInSample) { this.missesInSample = missesInSample; } protected final double previousSampleHitRate() { return previousSampleHitRate; } protected final void setPreviousSampleHitRate(double previousSampleHitRate) { this.previousSampleHitRate = previousSampleHitRate; } protected final FrequencySketch frequencySketch() { return sketch; } protected final AccessOrderDeque> accessOrderWindowDeque() { return accessOrderWindowDeque; } protected final AccessOrderDeque> accessOrderProbationDeque() { return accessOrderProbationDeque; } protected final AccessOrderDeque> accessOrderProtectedDeque() { return accessOrderProtectedDeque; } protected final MpscGrowableArrayQueue writeBuffer() { return writeBuffer; } protected final boolean buffersWrites() { return true; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy