Github user JPercivall commented on a diff in the pull request:
https://github.com/apache/nifi/pull/609#discussion_r72658633
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java
---
@@ -168,15 +168,18 @@ protected PropertyDescriptor
getSupportedDynamicPropertyDescriptor(final String
@OnScheduled
public void onScheduled(final ProcessContext context) {
- final Long cacheSize = context.getProperty(CACHE_SIZE).asLong();
- final Long cacheDuration =
context.getProperty(CACHE_DURATION).asTimePeriod(TimeUnit.SECONDS);
-
- CacheBuilder cacheBuilder = CacheBuilder.newBuilder();
- if (cacheSize > 0) {
- cacheBuilder = cacheBuilder.maximumSize(cacheSize);
- if (cacheDuration > 0) {
- cacheBuilder =
cacheBuilder.expireAfterAccess(cacheDuration, TimeUnit.SECONDS);
- }
+ final ComponentLog logger = getLogger();
+ final Integer cacheSize =
context.getProperty(CACHE_SIZE).asInteger();
+ final Long cacheTTL =
context.getProperty(CACHE_TTL_AFTER_LAST_ACCESS).asTimePeriod(TimeUnit.SECONDS);
+
+ CacheBuilder cacheBuilder =
CacheBuilder.newBuilder().maximumSize(cacheSize);
+
+ if (cacheSize <= 0) {
+ logger.warn("Stylesheet cache disabled because cache size is
set to 0");
--- End diff --
The cache will still be created and on line 213 it will try to use it to
look up an xslt if the cache size is 0. I'd suggest not even creating it in
that case.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---