org.redisson.api.MapCacheOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redisson Show documentation
Show all versions of redisson Show documentation
Redis Java client with features of In-Memory Data Grid
/**
* Copyright (c) 2013-2024 Nikita Koksharov
*
* 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 org.redisson.api;
import org.redisson.api.map.MapLoader;
import org.redisson.api.map.MapLoaderAsync;
import org.redisson.api.map.MapWriter;
import org.redisson.api.map.MapWriterAsync;
import java.time.Duration;
/**
* Configuration for RMapCache object.
*
* @author Nikita Koksharov
*
* @param key type
* @param value type
*/
public class MapCacheOptions extends MapOptions {
private boolean removeEmptyEvictionTask;
public static MapCacheOptions defaults() {
return new MapCacheOptions<>();
}
@Override
public MapCacheOptions writer(MapWriter writer) {
return (MapCacheOptions) super.writer(writer);
}
@Override
public MapCacheOptions writerAsync(MapWriterAsync writer) {
return (MapCacheOptions) super.writerAsync(writer);
}
@Override
public MapCacheOptions writeBehindBatchSize(int writeBehindBatchSize) {
return (MapCacheOptions) super.writeBehindBatchSize(writeBehindBatchSize);
}
@Override
public MapCacheOptions writeBehindDelay(int writeBehindDelay) {
return (MapCacheOptions) super.writeBehindDelay(writeBehindDelay);
}
@Override
public MapCacheOptions writeMode(WriteMode writeMode) {
return (MapCacheOptions) super.writeMode(writeMode);
}
@Override
public MapCacheOptions loader(MapLoader loader) {
return (MapCacheOptions) super.loader(loader);
}
@Override
public MapCacheOptions loaderAsync(MapLoaderAsync loaderAsync) {
return (MapCacheOptions) super.loaderAsync(loaderAsync);
}
@Override
public MapCacheOptions writerRetryAttempts(int writerRetryAttempts) {
return (MapCacheOptions) super.writerRetryAttempts(writerRetryAttempts);
}
@Override
public MapCacheOptions writerRetryInterval(Duration writerRetryInterval) {
return (MapCacheOptions) super.writerRetryInterval(writerRetryInterval);
}
public boolean isRemoveEmptyEvictionTask() {
return removeEmptyEvictionTask;
}
/**
* Removes eviction task from memory if map is empty
* upon entries eviction process completion.
*
* @return MapOptions instance
*/
public MapCacheOptions removeEmptyEvictionTask() {
this.removeEmptyEvictionTask = true;
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy