Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stale references to EvictableLoadingCache #11128

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .mvn/modernizer/violations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
<violation>
<name>com/google/common/cache/CacheBuilder.build:()Lcom/google/common/cache/Cache;</name>
<version>1.8</version>
<comment>Guava Cache has concurrency issues around invalidation and ongoing loads. Use EvictableCache, EvictableLoadingCache, or SafeCaches to build caches.
<comment>Guava Cache has concurrency issues around invalidation and ongoing loads. Use EvictableCacheBuilder or SafeCaches to build caches.
See https://github.com/trinodb/trino/issues/10512 for more information and see https://github.com/trinodb/trino/issues/10512#issuecomment-1016221168
for why Caffeine does not solve the problem.</comment>
</violation>

<violation>
<name>com/google/common/cache/CacheBuilder.build:(Lcom/google/common/cache/CacheLoader;)Lcom/google/common/cache/LoadingCache;</name>
<version>1.8</version>
<comment>Guava LoadingCache has concurrency issues around invalidation and ongoing loads. Use EvictableCache, EvictableLoadingCache, or SafeCaches to build caches.
<comment>Guava LoadingCache has concurrency issues around invalidation and ongoing loads. Use EvictableCacheBuilder or SafeCaches to build caches.
See https://github.com/trinodb/trino/issues/10512 for more information and see https://github.com/trinodb/trino/issues/10512#issuecomment-1016221168
for why Caffeine does not solve the problem.</comment>
</violation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface NonEvictableLoadingCache<K, V>
extends NonKeyEvictableLoadingCache<K, V>
{
/**
* @deprecated Not supported. Use {@link EvictableLoadingCache} cache implementation instead.
* @deprecated Not supported. Use {@link EvictableCacheBuilder} to build a cache instead.
*/
@Deprecated
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class NonEvictableLoadingCacheImpl<K, V>
public void invalidateAll()
{
throw new UnsupportedOperationException("invalidateAll does not invalidate ongoing loads, so a stale value may remain in the cache for ever. " +
"Use EvictableLoadingCache if you need invalidation, or use SafeCaches.buildNonEvictableCacheWithWeakInvalidateAll() " +
"Use EvictableCacheBuilder if you need invalidation, or use SafeCaches.buildNonEvictableCacheWithWeakInvalidateAll() " +
"if invalidateAll is not required for correctness");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public interface NonKeyEvictableLoadingCache<K, V>
extends LoadingCache<K, V>
{
/**
* @deprecated Not supported. Use {@link EvictableLoadingCache} cache implementation instead.
* @deprecated Not supported. Use {@link EvictableCacheBuilder} to build a cache instead.
*/
@Deprecated
@Override
void invalidate(Object key);

/**
* @deprecated Not supported. Use {@link EvictableLoadingCache} cache implementation instead.
* @deprecated Not supported. Use {@link EvictableCacheBuilder} to build a cache instead.
*/
@Deprecated
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ protected LoadingCache<K, V> delegate()
public void invalidate(Object key)
{
throw new UnsupportedOperationException("invalidate(key) does not invalidate ongoing loads, so a stale value may remain in the cache for ever. " +
"Use EvictableLoadingCache if you need invalidation");
"Use EvictableCacheBuilder if you need invalidation");
}

@Override
public void invalidateAll(Iterable<?> keys)
{
throw new UnsupportedOperationException("invalidateAll(keys) does not invalidate ongoing loads, so a stale value may remain in the cache for ever. " +
"Use EvictableLoadingCache if you need invalidation");
"Use EvictableCacheBuilder if you need invalidation");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

/**
* @see EvictableCache
* @see EvictableLoadingCache
* @see EvictableCacheBuilder
*/
public final class SafeCaches
{
Expand Down