Skip to content

Commit 63c65ab

Browse files
committed
Merge branch 'master' of https://github.com/apache/nifi into aws-web-api
2 parents 9cd1798 + 2834fa4 commit 63c65ab

88 files changed

Lines changed: 1447 additions & 253 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

nifi-assembly/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,12 @@ language governing permissions and limitations under the License. -->
703703
<version>1.7.0-SNAPSHOT</version>
704704
<type>nar</type>
705705
</dependency>
706+
<dependency>
707+
<groupId>org.apache.nifi</groupId>
708+
<artifactId>nifi-proxy-configuration-nar</artifactId>
709+
<version>1.7.0-SNAPSHOT</version>
710+
<type>nar</type>
711+
</dependency>
706712
</dependencies>
707713
<profiles>
708714
<profile>

nifi-bootstrap/src/test/groovy/org/apache/nifi/bootstrap/notification/TestCustomNotificationService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.Map;
2424

2525
import org.apache.nifi.components.PropertyDescriptor;
26+
import org.apache.nifi.expression.ExpressionLanguageScope;
2627
import org.apache.nifi.processor.util.StandardValidators;
2728
import org.slf4j.Logger;
2829
import org.slf4j.LoggerFactory;
@@ -35,20 +36,20 @@ public class TestCustomNotificationService extends AbstractNotificationService {
3536
.name("Custom Hostname")
3637
.description("The hostname of the Custom Server that is used to send notifications")
3738
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
38-
.expressionLanguageSupported(true)
39+
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
3940
.required(true)
4041
.build();
4142
public static final PropertyDescriptor CUSTOM_USERNAME = new PropertyDescriptor.Builder()
4243
.name("Custom Username")
4344
.description("Username for the account")
44-
.expressionLanguageSupported(true)
45+
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
4546
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
4647
.required(false)
4748
.build();
4849
public static final PropertyDescriptor CUSTOM_PASSWORD = new PropertyDescriptor.Builder()
4950
.name("Custom Password")
5051
.description("Password for the account")
51-
.expressionLanguageSupported(true)
52+
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
5253
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
5354
.required(false)
5455
.sensitive(true)

nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/RecordField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.Set;
2525

2626
public class RecordField {
27-
private static final boolean DEFAULT_NULLABLE = true;
27+
public static final boolean DEFAULT_NULLABLE = true;
2828

2929
private final String fieldName;
3030
private final DataType dataType;

nifi-docs/src/main/asciidoc/administration-guide.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2751,18 +2751,18 @@ The first section of the _nifi.properties_ file is for the Core Properties. Thes
27512751
|*Property*|*Description*
27522752
|nifi.flow.configuration.file*|The location of the flow configuration file (i.e., the file that contains what is currently displayed on the NiFi graph). The default value is `./conf/flow.xml.gz`.
27532753
|nifi.flow.configuration.archive.enabled*|Specifies whether NiFi creates a backup copy of the flow automatically when the flow is updated. The default value is `true`.
2754-
|nifi.flow.configuration.archive.dir*|The location of the archive directory where backup copies of the flow.xml are saved. The default value is `./conf/archive`. NiFi removes old archive files to limit disk usage based on archived file lifespan, total size, and number of files, as specified with `nifi.flow.configuration.archive.max.time`, `max.storage` and `max.count` properties respectively. If none of these limitation for archiving is specified, NiFi uses default condition, that is "30 days" for max.time and "500 MB" for max.storage. +
2754+
|nifi.flow.configuration.archive.dir*|The location of the archive directory where backup copies of the flow.xml are saved. The default value is `./conf/archive`. NiFi removes old archive files to limit disk usage based on archived file lifespan, total size, and number of files, as specified with `nifi.flow.configuration.archive.max.time`, `max.storage` and `max.count` properties respectively. If none of these limitation for archiving is specified, NiFi uses default conditions, that is `30 days` for max.time and `500 MB` for max.storage. +
27552755
This cleanup mechanism takes into account only automatically created archived flow.xml files. If there are other files or directories in this archive directory, NiFi will ignore them. Automatically created archives have filename with ISO 8601 format timestamp prefix followed by '_<original-filename>'. That is <year><month><day>T<hour><minute><second>+<timezone offset>_<original filename>. For example, `20160706T160719+0900_flow.xml.gz`. NiFi checks filenames when it cleans archive directory. If you would like to keep a particular archive in this directory without worrying about NiFi deleting it, you can do so by copying it with a different filename pattern.
2756-
|nifi.flow.configuration.archive.max.time*|The lifespan of archived flow.xml files. NiFi will delete expired archive files when it updates flow.xml if this property is specified. Expiration is determined based on current system time and the last modified timestamp of an archived flow.xml. If no archive limitation is specified in nifi.properties, NiFi removes archives older than "30 days".
2757-
|nifi.flow.configuration.archive.max.storage*|The total data size allowed for the archived flow.xml files. NiFi will delete the oldest archive files until the total archived file size becomes less than this configuration value, if this property is specified. If no archive limitation is specified in nifi.properties, NiFi uses "500 MB" for this.
2756+
|nifi.flow.configuration.archive.max.time*|The lifespan of archived flow.xml files. NiFi will delete expired archive files when it updates flow.xml if this property is specified. Expiration is determined based on current system time and the last modified timestamp of an archived flow.xml. If no archive limitation is specified in nifi.properties, NiFi removes archives older than `30 days`.
2757+
|nifi.flow.configuration.archive.max.storage*|The total data size allowed for the archived flow.xml files. NiFi will delete the oldest archive files until the total archived file size becomes less than this configuration value, if this property is specified. If no archive limitation is specified in nifi.properties, NiFi uses `500 MB` for this.
27582758
|nifi.flow.configuration.archive.max.count*|The number of archive files allowed. NiFi will delete the oldest archive files so that only N latest archives can be kept, if this property is specified.
27592759
|nifi.flowcontroller.autoResumeState|Indicates whether -upon restart- the components on the NiFi graph should return to their last state. The default value is `true`.
27602760
|nifi.flowcontroller.graceful.shutdown.period|Indicates the shutdown period. The default value is `10 secs`.
27612761
|nifi.flowservice.writedelay.interval|When many changes are made to the flow.xml, this property specifies how long to wait before writing out the changes, so as to batch the changes into a single write. The default value is `500 ms`.
27622762
|nifi.administrative.yield.duration|If a component allows an unexpected exception to escape, it is considered a bug. As a result, the framework will pause (or administratively yield) the component for this amount of time. This is done so that the component does not use up massive amounts of system resources, since it is known to have problems in the existing state. The default value is `30 secs`.
27632763
|nifi.bored.yield.duration|When a component has no work to do (i.e., is "bored"), this is the amount of time it will wait before checking to see if it has new data to work on. This way, it does not use up CPU resources by checking for new work too often. When setting this property, be aware that it could add extra latency for components that do not constantly have work to do, as once they go into this "bored" state, they will wait this amount of time before checking for more work. The default value is `10 ms`.
2764-
|nifi.queue.backpressure.count|When drawing a new connection between two components, this is the default value for that connection's back pressure object threshold. The default is 10000 and the value must be an integer.
2765-
|nifi.queue.backpressure.size|When drawing a new connection between two components, this is the default value for that connection's back pressure data size threshold. The default is 1 GB and the value must be a data size including the unit of measure.
2764+
|nifi.queue.backpressure.count|When drawing a new connection between two components, this is the default value for that connection's back pressure object threshold. The default is `10000` and the value must be an integer.
2765+
|nifi.queue.backpressure.size|When drawing a new connection between two components, this is the default value for that connection's back pressure data size threshold. The default is `1 GB` and the value must be a data size including the unit of measure.
27662766
|nifi.authorizer.configuration.file*|This is the location of the file that specifies how authorizers are defined. The default value is `./conf/authorizers.xml`.
27672767
|nifi.login.identity.provider.configuration.file*|This is the location of the file that specifies how username/password authentication is performed. This file is
27682768
only considered if `nifi.security.user.login.identity.provider` is configured with a provider identifier. The default value is `./conf/login-identity-providers.xml`.
@@ -2869,7 +2869,7 @@ FlowFile Repository, if also on that disk, could become corrupt. To avoid this s
28692869
|====
28702870
|*Property*|*Description*
28712871
|nifi.content.repository.implementation|The Content Repository implementation. The default value is `org.apache.nifi.controller.repository.FileSystemRepository` and should only be changed with caution. To store flowfile content in memory instead of on disk (at the risk of data loss in the event of power/machine failure), set this property to `org.apache.nifi.controller.repository.VolatileContentRepository`.
2872-
|nifi.content.claim.max.appendable.size|The maximum size for a content claim. The default value is `10 MB`.
2872+
|nifi.content.claim.max.appendable.size|The maximum size for a content claim. The default value is `1 MB`.
28732873
|nifi.content.claim.max.flow.files|The maximum number of FlowFiles to assign to one content claim. The default value is `100`.
28742874
|nifi.content.repository.directory.default*|The location of the Content Repository. The default value is `./content_repository`. +
28752875
+

nifi-mock/src/main/java/org/apache/nifi/util/MockPropertyValue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public PropertyValue evaluateAttributeExpressions(final FlowFile flowFile) throw
209209
* raises an error which makes it not mimick real world behavior.
210210
*/
211211
if (flowFile == null) {
212-
return evaluateAttributeExpressions();
212+
return evaluateAttributeExpressions(null, (Map<String,String>)null);
213213
}
214214
return evaluateAttributeExpressions(flowFile, null, null);
215215
}

nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@
8181
<artifactId>nifi-utils</artifactId>
8282
<version>1.7.0-SNAPSHOT</version>
8383
</dependency>
84+
<dependency>
85+
<groupId>org.apache.nifi</groupId>
86+
<artifactId>nifi-proxy-configuration-api</artifactId>
87+
</dependency>
8488
</dependencies>
8589

8690
</project>

nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.amazonaws.regions.Regions;
2929
import java.io.File;
3030
import java.io.IOException;
31+
import java.net.Proxy;
3132
import java.util.ArrayList;
3233
import java.util.Arrays;
3334
import java.util.Collection;
@@ -45,13 +46,16 @@
4546
import org.apache.nifi.components.PropertyDescriptor;
4647
import org.apache.nifi.components.ValidationContext;
4748
import org.apache.nifi.components.ValidationResult;
49+
import org.apache.nifi.expression.ExpressionLanguageScope;
4850
import org.apache.nifi.processor.AbstractProcessor;
4951
import org.apache.nifi.processor.ProcessContext;
5052
import org.apache.nifi.processor.Relationship;
5153
import org.apache.nifi.processor.exception.ProcessException;
5254
import org.apache.nifi.processor.util.StandardValidators;
5355
import org.apache.nifi.processors.aws.credentials.provider.factory.CredentialPropertyDescriptors;
5456
import org.apache.nifi.processors.aws.regions.AWSRegions;
57+
import org.apache.nifi.proxy.ProxyConfiguration;
58+
import org.apache.nifi.proxy.ProxySpec;
5559
import org.apache.nifi.ssl.SSLContextService;
5660

5761
/**
@@ -79,19 +83,38 @@ public abstract class AbstractAWSProcessor<ClientType extends AmazonWebServiceCl
7983
public static final PropertyDescriptor PROXY_HOST = new PropertyDescriptor.Builder()
8084
.name("Proxy Host")
8185
.description("Proxy host name or IP")
82-
.expressionLanguageSupported(true)
86+
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
8387
.required(false)
8488
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
8589
.build();
8690

8791
public static final PropertyDescriptor PROXY_HOST_PORT = new PropertyDescriptor.Builder()
8892
.name("Proxy Host Port")
8993
.description("Proxy host port")
90-
.expressionLanguageSupported(true)
94+
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
9195
.required(false)
9296
.addValidator(StandardValidators.PORT_VALIDATOR)
9397
.build();
9498

99+
public static final PropertyDescriptor PROXY_USERNAME = new PropertyDescriptor.Builder()
100+
.name("proxy-user-name")
101+
.displayName("Proxy Username")
102+
.description("Proxy username")
103+
.expressionLanguageSupported(true)
104+
.required(false)
105+
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
106+
.build();
107+
108+
public static final PropertyDescriptor PROXY_PASSWORD = new PropertyDescriptor.Builder()
109+
.name("proxy-user-password")
110+
.displayName("Proxy Password")
111+
.description("Proxy password")
112+
.expressionLanguageSupported(true)
113+
.required(false)
114+
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
115+
.sensitive(true)
116+
.build();
117+
95118
public static final PropertyDescriptor REGION = new PropertyDescriptor.Builder()
96119
.name("Region")
97120
.required(true)
@@ -118,7 +141,7 @@ public abstract class AbstractAWSProcessor<ClientType extends AmazonWebServiceCl
118141
.description("Endpoint URL to use instead of the AWS default including scheme, host, port, and path. " +
119142
"The AWS libraries select an endpoint URL based on the AWS region, but this property overrides " +
120143
"the selected endpoint URL, allowing use with other S3-compatible endpoints.")
121-
.expressionLanguageSupported(true)
144+
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
122145
.required(false)
123146
.addValidator(StandardValidators.URL_VALIDATOR)
124147
.build();
@@ -130,6 +153,9 @@ public abstract class AbstractAWSProcessor<ClientType extends AmazonWebServiceCl
130153
protected static final Protocol DEFAULT_PROTOCOL = Protocol.HTTPS;
131154
protected static final String DEFAULT_USER_AGENT = "NiFi";
132155

156+
private static final ProxySpec[] PROXY_SPECS = {ProxySpec.HTTP_AUTH};
157+
public static final PropertyDescriptor PROXY_CONFIGURATION_SERVICE = ProxyConfiguration.createProxyConfigPropertyDescriptor(true, PROXY_SPECS);
158+
133159
protected static AllowableValue createAllowableValue(final Regions region) {
134160
return new AllowableValue(region.getName(), AWSRegions.getRegionDisplayName(region.getName()));
135161
}
@@ -168,6 +194,8 @@ protected Collection<ValidationResult> customValidate(final ValidationContext va
168194
problems.add(new ValidationResult.Builder().input("Proxy Host Port").valid(false).explanation("Both proxy host and port must be set").build());
169195
}
170196

197+
ProxyConfiguration.validateProxySpec(validationContext, problems, PROXY_SPECS);
198+
171199
return problems;
172200
}
173201

@@ -192,11 +220,31 @@ protected ClientConfiguration createConfiguration(final ProcessContext context)
192220
}
193221
}
194222

195-
if (context.getProperty(PROXY_HOST).isSet()) {
196-
String proxyHost = context.getProperty(PROXY_HOST).evaluateAttributeExpressions().getValue();
197-
config.setProxyHost(proxyHost);
198-
Integer proxyPort = context.getProperty(PROXY_HOST_PORT).evaluateAttributeExpressions().asInteger();
199-
config.setProxyPort(proxyPort);
223+
final ProxyConfiguration proxyConfig = ProxyConfiguration.getConfiguration(context, () -> {
224+
if (context.getProperty(PROXY_HOST).isSet()) {
225+
final ProxyConfiguration componentProxyConfig = new ProxyConfiguration();
226+
String proxyHost = context.getProperty(PROXY_HOST).evaluateAttributeExpressions().getValue();
227+
Integer proxyPort = context.getProperty(PROXY_HOST_PORT).evaluateAttributeExpressions().asInteger();
228+
String proxyUsername = context.getProperty(PROXY_USERNAME).evaluateAttributeExpressions().getValue();
229+
String proxyPassword = context.getProperty(PROXY_PASSWORD).evaluateAttributeExpressions().getValue();
230+
componentProxyConfig.setProxyType(Proxy.Type.HTTP);
231+
componentProxyConfig.setProxyServerHost(proxyHost);
232+
componentProxyConfig.setProxyServerPort(proxyPort);
233+
componentProxyConfig.setProxyUserName(proxyUsername);
234+
componentProxyConfig.setProxyUserPassword(proxyPassword);
235+
return componentProxyConfig;
236+
}
237+
return ProxyConfiguration.DIRECT_CONFIGURATION;
238+
});
239+
240+
if (Proxy.Type.HTTP.equals(proxyConfig.getProxyType())) {
241+
config.setProxyHost(proxyConfig.getProxyServerHost());
242+
config.setProxyPort(proxyConfig.getProxyServerPort());
243+
244+
if (proxyConfig.hasCredential()) {
245+
config.setProxyUsername(proxyConfig.getProxyUserName());
246+
config.setProxyPassword(proxyConfig.getProxyUserPassword());
247+
}
200248
}
201249

202250
return config;

nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/cloudwatch/PutCloudWatchMetric.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public ValidationResult validate(String subject, String input, ValidationContext
174174
Collections.unmodifiableList(
175175
Arrays.asList(NAMESPACE, METRIC_NAME, VALUE, MAXIMUM, MINIMUM, SAMPLECOUNT, SUM, TIMESTAMP,
176176
UNIT, REGION, ACCESS_KEY, SECRET_KEY, CREDENTIALS_FILE, AWS_CREDENTIALS_PROVIDER_SERVICE,
177-
TIMEOUT, SSL_CONTEXT_SERVICE, ENDPOINT_OVERRIDE, PROXY_HOST, PROXY_HOST_PORT)
177+
TIMEOUT, SSL_CONTEXT_SERVICE, ENDPOINT_OVERRIDE, PROXY_HOST, PROXY_HOST_PORT, PROXY_USERNAME, PROXY_PASSWORD)
178178
);
179179

180180
private volatile Set<String> dynamicPropertyNames = new HashSet<>();

nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/dynamodb/DeleteDynamoDB.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public class DeleteDynamoDB extends AbstractWriteDynamoDBProcessor {
7474
public static final List<PropertyDescriptor> properties = Collections.unmodifiableList(
7575
Arrays.asList(TABLE, HASH_KEY_NAME, RANGE_KEY_NAME, HASH_KEY_VALUE, RANGE_KEY_VALUE,
7676
HASH_KEY_VALUE_TYPE, RANGE_KEY_VALUE_TYPE, BATCH_SIZE, REGION, ACCESS_KEY, SECRET_KEY,
77-
CREDENTIALS_FILE, AWS_CREDENTIALS_PROVIDER_SERVICE, TIMEOUT, SSL_CONTEXT_SERVICE));
77+
CREDENTIALS_FILE, AWS_CREDENTIALS_PROVIDER_SERVICE, TIMEOUT, SSL_CONTEXT_SERVICE,
78+
PROXY_CONFIGURATION_SERVICE, PROXY_HOST, PROXY_HOST_PORT, PROXY_USERNAME, PROXY_PASSWORD));
7879

7980
@Override
8081
protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {

nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/dynamodb/GetDynamoDB.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ public class GetDynamoDB extends AbstractDynamoDBProcessor {
8080
public static final List<PropertyDescriptor> properties = Collections.unmodifiableList(
8181
Arrays.asList(TABLE, HASH_KEY_NAME, RANGE_KEY_NAME, HASH_KEY_VALUE, RANGE_KEY_VALUE,
8282
HASH_KEY_VALUE_TYPE, RANGE_KEY_VALUE_TYPE, JSON_DOCUMENT, BATCH_SIZE, REGION, ACCESS_KEY, SECRET_KEY,
83-
CREDENTIALS_FILE, AWS_CREDENTIALS_PROVIDER_SERVICE, TIMEOUT, SSL_CONTEXT_SERVICE));
83+
CREDENTIALS_FILE, AWS_CREDENTIALS_PROVIDER_SERVICE, TIMEOUT, SSL_CONTEXT_SERVICE,
84+
PROXY_CONFIGURATION_SERVICE, PROXY_HOST, PROXY_HOST_PORT, PROXY_USERNAME, PROXY_PASSWORD));
8485

8586
public static final Relationship REL_NOT_FOUND = new Relationship.Builder().name("not found")
8687
.description("FlowFiles are routed to not found relationship if key not found in the table").build();

0 commit comments

Comments
 (0)