com.hazelcast.map.impl.mapstore.AbstractMapDataStore Maven / Gradle / Ivy
/*
* Copyright (c) 2008-2021, 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.map.impl.mapstore;
import com.hazelcast.internal.serialization.DataType;
import com.hazelcast.internal.serialization.InternalSerializationService;
import com.hazelcast.internal.util.Clock;
import com.hazelcast.map.impl.MapStoreWrapper;
import com.hazelcast.map.impl.mapstore.writebehind.TxnReservedCapacityCounter;
import com.hazelcast.internal.serialization.Data;
import com.hazelcast.spi.impl.NodeEngine;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* Abstract map data store contains common functionality of map data stores.
*
* @param key type for map data store
* @param value type for map data store
*/
public abstract class AbstractMapDataStore implements MapDataStore {
protected final NodeEngine nodeEngine;
private final MapStoreWrapper store;
private final InternalSerializationService serializationService;
protected AbstractMapDataStore(MapStoreContext mapStoreContext) {
this.store = mapStoreContext.getMapStoreWrapper();
this.nodeEngine = mapStoreContext.getMapServiceContext().getNodeEngine();
this.serializationService = (InternalSerializationService) nodeEngine.getSerializationService();
}
@Override
public Map loadAll(Collection keys) {
if (keys == null || keys.isEmpty()) {
return Collections.emptyMap();
}
final List