diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/provenance/lineage/LineageNode.java b/nifi/nifi-api/src/main/java/org/apache/nifi/provenance/lineage/LineageNode.java index c50cdf5840..56e865f1f9 100644 --- a/nifi/nifi-api/src/main/java/org/apache/nifi/provenance/lineage/LineageNode.java +++ b/nifi/nifi-api/src/main/java/org/apache/nifi/provenance/lineage/LineageNode.java @@ -22,6 +22,7 @@ public interface LineageNode { * @return the identifier of the Clustered NiFi Node that generated the * event */ + @Deprecated String getClusterNodeIdentifier(); /** diff --git a/nifi/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/lineage/EventNode.java b/nifi/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/lineage/EventNode.java index 12d9a4ff5e..1f8d1dcd46 100644 --- a/nifi/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/lineage/EventNode.java +++ b/nifi/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/lineage/EventNode.java @@ -36,11 +36,13 @@ public class EventNode implements ProvenanceEventLineageNode { return String.valueOf(getEventIdentifier()); } + @Deprecated @Override public String getClusterNodeIdentifier() { return clusterNodeIdentifier; } + @Deprecated public void setClusterNodeIdentifier(final String nodeIdentifier) { this.clusterNodeIdentifier = nodeIdentifier; } diff --git a/nifi/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/lineage/FlowFileNode.java b/nifi/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/lineage/FlowFileNode.java index fdc7470d99..94e7661aed 100644 --- a/nifi/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/lineage/FlowFileNode.java +++ b/nifi/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/lineage/FlowFileNode.java @@ -39,6 +39,7 @@ public class FlowFileNode implements LineageNode { return creationTime; } + @Deprecated @Override public String getClusterNodeIdentifier() { return clusterNodeIdentifier; diff --git a/nifi/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/nifi/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java index 43f02cab77..e25f5d6129 100644 --- a/nifi/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java +++ b/nifi/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java @@ -233,8 +233,7 @@ public class NiFiProperties extends Properties { * obtained. * * @return the NiFiProperties object to use - * @throws RuntimeException - * if unable to load properties file + * @throws RuntimeException if unable to load properties file */ public static synchronized NiFiProperties getInstance() { if (null == instance) { @@ -794,7 +793,7 @@ public class NiFiProperties extends Properties { final String scheme = (rawScheme == null) ? "http" : rawScheme; final String host; - final int port; + final Integer port; if ("http".equalsIgnoreCase(scheme)) { // get host if (StringUtils.isBlank(getProperty(WEB_HTTP_HOST))) { @@ -804,6 +803,10 @@ public class NiFiProperties extends Properties { } // get port port = getPort(); + + if (port == null) { + throw new RuntimeException(String.format("The %s must be specified if running in a cluster with %s set to false.", WEB_HTTP_PORT, CLUSTER_PROTOCOL_IS_SECURE)); + } } else { // get host if (StringUtils.isBlank(getProperty(WEB_HTTPS_HOST))) { @@ -813,6 +816,10 @@ public class NiFiProperties extends Properties { } // get port port = getSslPort(); + + if (port == null) { + throw new RuntimeException(String.format("The %s must be specified if running in a cluster with %s set to true.", WEB_HTTPS_PORT, CLUSTER_PROTOCOL_IS_SECURE)); + } } return InetSocketAddress.createUnresolved(host, port); @@ -824,8 +831,7 @@ public class NiFiProperties extends Properties { * configured. No directories will be created as a result of this operation. * * @return database repository path - * @throws InvalidPathException - * If the configured path is invalid + * @throws InvalidPathException If the configured path is invalid */ public Path getDatabaseRepositoryPath() { return Paths.get(getProperty(REPOSITORY_DATABASE_DIRECTORY)); @@ -836,8 +842,7 @@ public class NiFiProperties extends Properties { * configured. No directories will be created as a result of this operation. * * @return database repository path - * @throws InvalidPathException - * If the configured path is invalid + * @throws InvalidPathException If the configured path is invalid */ public Path getFlowFileRepositoryPath() { return Paths.get(getProperty(FLOWFILE_REPOSITORY_DIRECTORY)); @@ -850,8 +855,7 @@ public class NiFiProperties extends Properties { * operation. * * @return file repositories paths - * @throws InvalidPathException - * If any of the configured paths are invalid + * @throws InvalidPathException If any of the configured paths are invalid */ public Map getContentRepositoryPaths() { final Map contentRepositoryPaths = new HashMap<>();