Skip to content

Commit 480f393

Browse files
committed
Merge branch 'master' of https://github.com/apache/nifi into aws-web-api
2 parents 47e9d18 + 716587d commit 480f393

File tree

63 files changed

+1398
-914
lines changed

Some content is hidden

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

63 files changed

+1398
-914
lines changed

nifi-api/src/main/java/org/apache/nifi/controller/status/ProcessGroupStatus.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,9 @@ public static void merge(final ProcessGroupStatus target, final ProcessGroupStat
481481
// and should not differ amongst nodes. however, whether a processor is invalid
482482
// can be driven by environmental conditions. this check allows any of those to
483483
// take precedence over the configured run status.
484-
if (RunStatus.Invalid.equals(statusToMerge.getRunStatus())) {
484+
if (RunStatus.Validating.equals(statusToMerge.getRunStatus())) {
485+
merged.setRunStatus(RunStatus.Validating);
486+
} else if (RunStatus.Invalid.equals(statusToMerge.getRunStatus())) {
485487
merged.setRunStatus(RunStatus.Invalid);
486488
}
487489
}

nifi-api/src/main/java/org/apache/nifi/controller/status/RunStatus.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public enum RunStatus {
2323

2424
Running,
2525
Stopped,
26+
Validating,
2627
Invalid,
2728
Disabled;
2829
}

nifi-commons/nifi-expression-language/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<dependency>
7777
<groupId>com.jayway.jsonpath</groupId>
7878
<artifactId>json-path</artifactId>
79-
<version>2.0.0</version>
79+
<version>2.4.0</version>
8080
</dependency>
8181
<dependency>
8282
<groupId>com.fasterxml.jackson.core</groupId>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,6 +3474,7 @@ and can be viewed in the Cluster page. This value indicates how many events to k
34743474
the connection a failure. The default value is `5 secs`.
34753475
|nifi.cluster.node.read.timeout|When communicating with another node in the cluster, specifies how long this node should wait to receive information
34763476
from the remote node before considering the communication with the node a failure. The default value is `5 secs`.
3477+
|nifi.cluster.node.max.concurrent.requests|The maximum number of outstanding web requests that can be replicated to nodes in the cluster. If this number of requests is exceeded, the embedded Jetty server will return a "409: Conflict" response. This property defaults to `100`.
34773478
|nifi.cluster.firewall.file|The location of the node firewall file. This is a file that may be used to list all the nodes that are allowed to connect
34783479
to the cluster. It provides an additional layer of security. This value is blank by default, meaning that no firewall file is to be used.
34793480
|nifi.cluster.flow.election.max.wait.time|Specifies the amount of time to wait before electing a Flow as the "correct" Flow. If the number of Nodes that have voted is equal to the number specified by the `nifi.cluster.flow.election.max.candidates` property, the cluster will not wait this long. The default value is `5 mins`. Note that the time starts as soon as the first vote is cast.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.nifi.elasticsearch;
19+
20+
public class DeleteOperationResponse {
21+
private long took;
22+
23+
public DeleteOperationResponse(long took) {
24+
this.took = took;
25+
}
26+
27+
public long getTook() {
28+
return took;
29+
}
30+
}

nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service-api/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientService.java

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import org.apache.nifi.ssl.SSLContextService;
2626

2727
import java.io.IOException;
28+
import java.util.List;
29+
import java.util.Map;
2830

2931
@Tags({"elasticsearch", "client"})
3032
@CapabilityDescription("A controller service for accessing an ElasticSearch client.")
@@ -95,6 +97,66 @@ public interface ElasticSearchClientService extends ControllerService {
9597
.addValidator(StandardValidators.NON_BLANK_VALIDATOR)
9698
.build();
9799

100+
/**
101+
* Index a document.
102+
*
103+
* @param operation A document to index.
104+
* @return IndexOperationResponse if successful
105+
* @throws IOException thrown when there is an error.
106+
*/
107+
IndexOperationResponse add(IndexOperationRequest operation) throws IOException;
108+
109+
/**
110+
* Index multiple documents.
111+
*
112+
* @param operations A list of documents to index.
113+
* @return IndexOperationResponse if successful.
114+
* @throws IOException thrown when there is an error.
115+
*/
116+
IndexOperationResponse add(List<IndexOperationRequest> operations) throws IOException;
117+
118+
/**
119+
* Delete a document by its ID from an index.
120+
*
121+
* @param index The index to target.
122+
* @param type The type to target. Optional.
123+
* @param id The document ID to remove from the selected index.
124+
* @return A DeleteOperationResponse object if successful.
125+
*/
126+
DeleteOperationResponse deleteById(String index, String type, String id) throws IOException;
127+
128+
129+
/**
130+
* Delete multiple documents by ID from an index.
131+
* @param index The index to target.
132+
* @param type The type to target. Optional.
133+
* @param ids A list of document IDs to remove from the selected index.
134+
* @return A DeleteOperationResponse object if successful.
135+
* @throws IOException thrown when there is an error.
136+
*/
137+
DeleteOperationResponse deleteById(String index, String type, List<String> ids) throws IOException;
138+
139+
/**
140+
* Delete documents by query.
141+
*
142+
* @param query A valid JSON query to be used for finding documents to delete.
143+
* @param index The index to target.
144+
* @param type The type to target within the index. Optional.
145+
* @return A DeleteOperationResponse object if successful.
146+
*/
147+
DeleteOperationResponse deleteByQuery(String query, String index, String type) throws IOException;
148+
149+
/**
150+
* Get a document by ID.
151+
*
152+
* @param index The index that holds the document.
153+
* @param type The document type. Optional.
154+
* @param id The document ID
155+
* @return Map if successful, null if not found.
156+
* @throws IOException thrown when there is an error.
157+
*/
158+
Map<String, Object> get(String index, String type, String id) throws IOException;
159+
98160
/**
99161
* Perform a search using the JSON DSL.
100162
*
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.nifi.elasticsearch;
19+
20+
import java.util.Map;
21+
22+
public class IndexOperationRequest {
23+
private String index;
24+
private String type;
25+
private String id;
26+
private Map<String, Object> fields;
27+
28+
public IndexOperationRequest(String index, String type, String id, Map<String, Object> fields) {
29+
this.index = index;
30+
this.type = type;
31+
this.id = id;
32+
this.fields = fields;
33+
}
34+
35+
public String getIndex() {
36+
return index;
37+
}
38+
39+
public String getType() {
40+
return type;
41+
}
42+
43+
public String getId() {
44+
return id;
45+
}
46+
47+
public Map<String, Object> getFields() {
48+
return fields;
49+
}
50+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.nifi.elasticsearch;
19+
20+
public class IndexOperationResponse {
21+
private long took;
22+
private long ingestTook;
23+
24+
public IndexOperationResponse(long took, long ingestTook) {
25+
this.took = took;
26+
this.ingestTook = ingestTook;
27+
}
28+
29+
public long getTook() {
30+
return took;
31+
}
32+
33+
public long getIngestTook() {
34+
return ingestTook;
35+
}
36+
}

nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@
6969
<version>2.6</version>
7070
</dependency>
7171

72-
<dependency>
73-
<groupId>org.elasticsearch.client</groupId>
74-
<artifactId>rest</artifactId>
75-
<version>5.0.1</version>
76-
</dependency>
7772
<dependency>
7873
<groupId>com.github.stephenc.findbugs</groupId>
7974
<artifactId>findbugs-annotations</artifactId>
@@ -120,6 +115,18 @@
120115
<version>1.7.0-SNAPSHOT</version>
121116
<scope>provided</scope>
122117
</dependency>
118+
<dependency>
119+
<groupId>org.elasticsearch</groupId>
120+
<artifactId>elasticsearch</artifactId>
121+
<version>5.6.8</version>
122+
<scope>compile</scope>
123+
</dependency>
124+
<dependency>
125+
<groupId>org.elasticsearch.client</groupId>
126+
<artifactId>elasticsearch-rest-high-level-client</artifactId>
127+
<version>5.6.8</version>
128+
<scope>compile</scope>
129+
</dependency>
123130
</dependencies>
124131

125132
<profiles>
@@ -137,7 +144,6 @@
137144
<httpPort>9400</httpPort>
138145
<version>5.6.2</version>
139146
<timeout>90</timeout>
140-
<pathInitScript>${project.basedir}/src/test/resources/setup.script</pathInitScript>
141147
</configuration>
142148
<executions>
143149
<execution>

0 commit comments

Comments
 (0)