io.telicent.smart.cache.sources.offsets.file.AbstractJacksonOffsetStore Maven / Gradle / Ivy
/**
* Copyright (C) Telicent Ltd
*
* 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 io.telicent.smart.cache.sources.offsets.file;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.telicent.smart.cache.sources.offsets.MemoryOffsetStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.Objects;
/**
* An abstract file backed offset store where offsets are serialised using Jackson
*/
public class AbstractJacksonOffsetStore extends MemoryOffsetStore {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractJacksonOffsetStore.class);
private static final TypeReference