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

Fixes #1554 : Fixed by updating response in UserManagedCacheBuilder #3104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,6 @@ public void close() throws Exception {
valueSerializer = valueSer;
}
} catch (UnsupportedTypeException e) {
if (resources.contains(OFFHEAP) || resources.contains(DISK)) {
throw new RuntimeException(e);
} else {
LOGGER.debug("Serializers for cache '{}' failed creation ({}). However, depending on the configuration, they might not be needed", id, e.getMessage());
}
}
}

Expand Down Expand Up @@ -570,7 +565,14 @@ public final UserManagedCacheBuilder<K, V, T> withEventListeners(CacheEventListe
*/
public final UserManagedCacheBuilder<K, V, T> withResourcePools(ResourcePools resourcePools) {
UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
Set<ResourceType<?>> resources=resourcePools.getResourceTypeSet();
otherBuilder.resourcePools = resourcePools;
if (resources.contains(OFFHEAP) || resources.contains(DISK)) {
LOGGER.debug("Runtime Exception found");
} else {
LOGGER.debug("Could not create Serializers for user Managed cache");
LOGGER.debug("Serializers for cache failed creation. However, depending on the configuration, they might not be needed");
}
return otherBuilder;
}

Expand All @@ -584,6 +586,13 @@ public final UserManagedCacheBuilder<K, V, T> withResourcePools(ResourcePools re
* @see #withResourcePools(ResourcePools)
*/
public final UserManagedCacheBuilder<K, V, T> withResourcePools(ResourcePoolsBuilder resourcePoolsBuilder) {
Set<ResourceType<?>> resources1 = resourcePoolsBuilder.build().getResourceTypeSet();
if (resources1.contains(OFFHEAP) || resources1.contains(DISK)) {
LOGGER.debug("Runtime Exception found");
} else {
LOGGER.debug("Could not create Serializers for user Managed cache");
LOGGER.debug("Serializers for cache failed creation. However, depending on the configuration, they might not be needed");
}
return withResourcePools(resourcePoolsBuilder.build());
}

Expand Down