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

io.atleon.avro.AvroSchemaCache Maven / Gradle / Ivy

There is a newer version: 0.28.3
Show newest version
package io.atleon.avro;

import org.apache.avro.Schema;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;

public final class AvroSchemaCache {

    private final Map cache = new ConcurrentHashMap<>();

    public Schema load(K key, Function cacheLoader) {
        return cache.computeIfAbsent(key, cacheLoader);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy