[
https://issues.apache.org/jira/browse/NIFI-1690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15228266#comment-15228266
]
ASF GitHub Bot commented on NIFI-1690:
--------------------------------------
Github user joewitt commented on a diff in the pull request:
https://github.com/apache/nifi/pull/328#discussion_r58706787
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java
---
@@ -91,12 +92,22 @@
+ " that the memory pool is exceeding this threshold.")
public class MonitorMemory extends AbstractReportingTask {
+ private static final AllowableValue[] memPoolAllowableValues;
+
+ static {
+ List<MemoryPoolMXBean> memoryPoolBeans =
ManagementFactory.getMemoryPoolMXBeans();
+ memPoolAllowableValues = new
AllowableValue[memoryPoolBeans.size()];
+ for (int i = 0; i < memPoolAllowableValues.length; i++) {
+ memPoolAllowableValues[i] = new
AllowableValue(memoryPoolBeans.get(i).getName());
+ }
+ }
+
public static final PropertyDescriptor MEMORY_POOL_PROPERTY = new
PropertyDescriptor.Builder()
.name("Memory Pool")
.description("The name of the JVM Memory Pool to monitor")
.required(true)
- .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
- .defaultValue(null)
+ .allowableValues(memPoolAllowableValues)
+ .defaultValue(memPoolAllowableValues.length == 0 ? null :
memPoolAllowableValues[0].getValue())
--- End diff --
I think we're better off simply not having a default value.
> Misconfigured MonitorMemory ReportingTask can not be stopped
> ------------------------------------------------------------
>
> Key: NIFI-1690
> URL: https://issues.apache.org/jira/browse/NIFI-1690
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 0.5.1
> Reporter: Matthew Clarke
> Assignee: Oleg Zhurakousky
> Fix For: 0.7.0
>
>
> The monitor memory reporting tasks allows the user to entire any value
> they want for the JVM memory pool. If the supplied value is not valid (NiFi
> can not find a memory pool with the supplied value), the reporting tasks
> appears to get stuck in the @onDemand state. At this point the task can not
> be stopped, edited, or deleted.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)