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

com.hazelcast.cache.impl.record.CacheRecordMap Maven / Gradle / Ivy

/*
 * Copyright (c) 2008-2017, Hazelcast, Inc. 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.hazelcast.cache.impl.record;

import com.hazelcast.cache.impl.CacheEntryIterationResult;
import com.hazelcast.cache.impl.CacheKeyIterationResult;
import com.hazelcast.internal.eviction.EvictableStore;
import com.hazelcast.nio.serialization.Data;

import java.util.Map;

/**
 * Contract point for storing {@link CacheRecord}s.
 *
 * @param  type of the key of {@link CacheRecord} to be stored
 * @param  type of the value of {@link CacheRecord} to be stored
 */
public interface CacheRecordMap
        extends Map, EvictableStore {

    /**
     * Sets the entry counting behaviour.
     * Because, records on backup partitions should not be counted.
     *
     * @param enable enables the entry counting behaviour if it is true, otherwise disables.
     */
    void setEntryCounting(boolean enable);

    /**
     * Fetches keys in bulk as specified size at most.
     *
     * @param nextTableIndex starting point for fetching
     * @param size           maximum bulk size to fetch the keys
     * @return the {@link CacheKeyIterationResult} instance contains fetched keys
     */
    CacheKeyIterationResult fetchKeys(int nextTableIndex, int size);

    /**
     * Fetches entries in bulk as specified size at most.
     *
     * @param nextTableIndex starting point for fetching
     * @param size           maximum bulk size to fetch the entries
     * @return the {@link CacheEntryIterationResult} instance contains fetched keys
     */
    CacheEntryIterationResult fetchEntries(int nextTableIndex, int size);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy