NIFI-2574 fix spring context definitions
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/d9633757 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/d9633757 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/d9633757 Branch: refs/heads/master Commit: d9633757a624dedd0dce4a61fd4bc66eab900265 Parents: 6bf7e7f Author: joewitt <[email protected]> Authored: Wed Aug 17 03:38:31 2016 -0700 Committer: joewitt <[email protected]> Committed: Wed Aug 17 03:38:31 2016 -0700 ---------------------------------------------------------------------- .../src/main/resources/nifi-cluster-protocol-context.xml | 3 +++ .../nifi-framework-core/src/main/resources/nifi-context.xml | 9 +++++++-- .../java/org/apache/nifi/web/api/DataTransferResource.java | 6 ++---- .../src/main/resources/nifi-web-api-context.xml | 2 ++ .../org/apache/nifi/processors/hive/PutHiveStreaming.java | 9 ++++++++- .../java/org/apache/nifi/controller/MonitorDiskUsage.java | 1 + 6 files changed, 23 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/d9633757/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/resources/nifi-cluster-protocol-context.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/resources/nifi-cluster-protocol-context.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/resources/nifi-cluster-protocol-context.xml index 032081b..63ab689 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/resources/nifi-cluster-protocol-context.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster-protocol/src/main/resources/nifi-cluster-protocol-context.xml @@ -42,6 +42,9 @@ <bean id="clusterCoordinationProtocolSender" class="org.apache.nifi.cluster.protocol.impl.StandardClusterCoordinationProtocolSender"> <constructor-arg ref="protocolSocketConfiguration"/> <constructor-arg ref="protocolContext"/> + <constructor-arg> + <bean factory-bean="nifiProperties" factory-method="getClusterNodeProtocolThreads"/> + </constructor-arg> <property name="handshakeTimeout"> <bean factory-bean="nifiProperties" factory-method="getClusterNodeConnectionTimeout"/> </property> http://git-wip-us.apache.org/repos/asf/nifi/blob/d9633757/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml index 1503208..7ca0130 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml @@ -25,7 +25,10 @@ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"> <!-- nifi properties created via getInstance using a file path specified as a system property --> - <bean id="nifiProperties" class="org.apache.nifi.util.NiFiProperties" factory-method="getInstance"/> + <bean id="nifiProperties" class="org.apache.nifi.util.NiFiProperties" factory-method="createBasicNiFiProperties"> + <constructor-arg index="0"><null /></constructor-arg> + <constructor-arg index="1"><null /></constructor-arg> + </bean> <!-- variable registry --> <bean id="variableRegistry" class="org.apache.nifi.util.FileBasedVariableRegistry"> @@ -36,7 +39,9 @@ <bean id="flowFileEventRepository" class="org.apache.nifi.spring.RingBufferEventRepositoryBean"> </bean> - <bean id="stringEncryptor" class="org.apache.nifi.encrypt.StringEncryptor" factory-method="createEncryptor"/> + <bean id="stringEncryptor" class="org.apache.nifi.encrypt.StringEncryptor" factory-method="createEncryptor"> + <constructor-arg ref="nifiProperties" /> + </bean> <!-- flow controller --> <bean id="flowController" class="org.apache.nifi.spring.FlowControllerFactoryBean"> http://git-wip-us.apache.org/repos/asf/nifi/blob/d9633757/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/DataTransferResource.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/DataTransferResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/DataTransferResource.java index 38a738c..886f24a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/DataTransferResource.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/DataTransferResource.java @@ -116,10 +116,8 @@ public class DataTransferResource extends ApplicationResource { private final ResponseCreator responseCreator = new ResponseCreator(); private final VersionNegotiator transportProtocolVersionNegotiator = new TransportProtocolVersionNegotiator(1); private final HttpRemoteSiteListener transactionManager; - private final NiFiProperties nifiProperties; public DataTransferResource(final NiFiProperties nifiProperties) { - this.nifiProperties = nifiProperties; transactionManager = HttpRemoteSiteListener.getInstance(nifiProperties); } @@ -311,13 +309,13 @@ public class DataTransferResource extends ApplicationResource { ((HttpCommunicationsSession) peer.getCommunicationsSession()).setDataTransferUrl(dataTransferUrl); HttpFlowFileServerProtocol serverProtocol = getHttpFlowFileServerProtocol(versionNegotiator); - HttpRemoteSiteListener.getInstance(nifiProperties).setupServerProtocol(serverProtocol); + HttpRemoteSiteListener.getInstance(getProperties()).setupServerProtocol(serverProtocol); serverProtocol.handshake(peer); return serverProtocol; } HttpFlowFileServerProtocol getHttpFlowFileServerProtocol(final VersionNegotiator versionNegotiator) { - return new StandardHttpFlowFileServerProtocol(versionNegotiator, nifiProperties); + return new StandardHttpFlowFileServerProtocol(versionNegotiator, getProperties()); } private Peer constructPeer(final HttpServletRequest req, final InputStream inputStream, http://git-wip-us.apache.org/repos/asf/nifi/blob/d9633757/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml index 614043a..104067c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/nifi-web-api-context.xml @@ -215,6 +215,7 @@ <property name="authorizer" ref="authorizer"/> </bean> <bean id="siteToSiteResource" class="org.apache.nifi.web.api.SiteToSiteResource" scope="singleton"> + <constructor-arg ref="nifiProperties"/> <property name="serviceFacade" ref="serviceFacade"/> <property name="properties" ref="nifiProperties"/> <property name="clusterCoordinator" ref="clusterCoordinator"/> @@ -222,6 +223,7 @@ <property name="authorizer" ref="authorizer"/> </bean> <bean id="dataTransferResource" class="org.apache.nifi.web.api.DataTransferResource" scope="singleton"> + <constructor-arg ref="nifiProperties"/> <property name="properties" ref="nifiProperties"/> <property name="clusterCoordinator" ref="clusterCoordinator"/> <property name="requestReplicator" ref="requestReplicator" /> http://git-wip-us.apache.org/repos/asf/nifi/blob/d9633757/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java index fdff58b..14eeb2a 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java @@ -17,6 +17,7 @@ package org.apache.nifi.processors.hive; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import java.io.File; import org.apache.avro.Schema; import org.apache.avro.file.CodecFactory; import org.apache.avro.file.DataFileConstants; @@ -243,6 +244,9 @@ public class PutHiveStreaming extends AbstractProcessor { private static final long TICKET_RENEWAL_PERIOD = 60000; protected KerberosProperties kerberosProperties; + private volatile String kerberosServicePrincipal = null; + private volatile File kerberosConfigFile = null; + private volatile File kerberosServiceKeytab = null; protected volatile HiveConfigurator hiveConfigurator = new HiveConfigurator(); protected volatile UserGroupInformation ugi; @@ -281,7 +285,10 @@ public class PutHiveStreaming extends AbstractProcessor { @Override protected void init(ProcessorInitializationContext context) { - kerberosProperties = getKerberosProperties(); + kerberosServicePrincipal = context.getKerberosServicePrincipal(); + kerberosConfigFile = context.getKerberosConfigurationFile(); + kerberosServiceKeytab = context.getKerberosServiceKeytab(); + kerberosProperties = new KerberosProperties(kerberosConfigFile); propertyDescriptors.add(kerberosProperties.getKerberosPrincipal()); propertyDescriptors.add(kerberosProperties.getKerberosKeytab()); } http://git-wip-us.apache.org/repos/asf/nifi/blob/d9633757/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java index 1cda544..e5c4ab2 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorDiskUsage.java @@ -73,6 +73,7 @@ public class MonitorDiskUsage extends AbstractReportingTask { final List<PropertyDescriptor> descriptors = new ArrayList<>(2); descriptors.add(DIR_THRESHOLD); descriptors.add(DIR_LOCATION); + descriptors.add(DIR_DISPLAY_NAME); return descriptors; }
