io.github.portlek.sfs.caching.MapLookupCache Maven / Gradle / Ivy
package io.github.portlek.sfs.caching;
import io.github.portlek.sfs.Location;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
public class MapLookupCache implements LookupCache {
ConcurrentHashMap> cache = new ConcurrentHashMap<>();
@Override
public List lookup(final long volumeId) {
return this.cache.get(volumeId);
}
@Override
public void invalidate(final long volumeId) {
this.cache.remove(volumeId);
}
@Override
public void invalidate() {
this.cache = new ConcurrentHashMap<>();
}
@Override
public void setLocation(final long volumeId, final List locations) {
this.cache.put(volumeId, locations);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy