org.redisson.api.RMapAsync Maven / Gradle / Ivy
/**
* Copyright 2018 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 java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import org.redisson.api.map.MapLoader;
import org.redisson.api.map.MapWriter;
import java.util.Set;
/**
* Distributed async implementation of {@link Map}.
*
* This map doesn't allow to store null
as key or value.
*
* @author Nikita Koksharov
*
* @param key
* @param value
*/
public interface RMapAsync extends RExpirableAsync {
/**
* Loads all map entries to this Redis map using {@link org.redisson.api.map.MapLoader}.
*
* @param replaceExistingValues - true
if existed values should be replaced, false
otherwise.
* @param parallelism - parallelism level, used to increase speed of process execution
* @return void
*/
RFuture loadAllAsync(boolean replaceExistingValues, int parallelism);
/**
* Loads map entries using {@link org.redisson.api.map.MapLoader} whose keys are listed in defined keys
parameter.
*
* @param keys - map keys
* @param replaceExistingValues - true
if existed values should be replaced, false
otherwise.
* @param parallelism - parallelism level, used to increase speed of process execution
* @return void
*/
RFuture loadAllAsync(Set extends K> keys, boolean replaceExistingValues, int parallelism);
/**
* Returns size of value mapped by key in bytes
*
* @param key - map key
* @return size of value
*/
RFuture valueSizeAsync(K key);
/**
* Gets a map slice contained the mappings with defined keys
* by one operation.
*
* If map doesn't contain value/values for specified key/keys and {@link MapLoader} is defined
* then value/values will be loaded in read-through mode.
*
* The returned map is NOT backed by the original map.
*
* @param keys - map keys
* @return Map slice
*/
RFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy