Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi/pull/32#discussion_r78056820
--- Diff:
minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/util/ConfigTransformer.java
---
@@ -546,6 +550,37 @@ protected static void addConnection(final Element
parentElement, ConnectionSchem
}
}
+ protected static String getConnectionName(ConnectionSchema
connectionProperties) {
+ String connectionName = connectionProperties.getName();
+ if (StringUtil.isNullOrEmpty(connectionName)) {
+ return EMPTY_NAME;
+ }
+ return connectionName;
+ }
+
+ /**
+ * Will replace all characters not in [A-Za-z0-9_] with _
+ *
+ * This has potential for collisions so it will also append numbers as
necessary to prevent that
+ *
+ * @param ids id map of already incremented numbers
+ * @param name the name
+ * @return a unique filesystem-friendly id
+ */
+ protected static String getUniqueId(Map<String, Integer> ids, String
name) {
--- End diff --
I see what is happening here but wonder if hashing might be a better
alternative. While this does avoid collisions that could result, could keep
things simpler given the requirement for unique names currently.
---
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.
---