[nifi] branch support/nifi-1.x updated: NIFI-11433 - use .add() for set instead of .push() (#7193)
This is an automated email from the ASF dual-hosted git repository. mtien pushed a commit to branch support/nifi-1.x in repository https://gitbox.apache.org/repos/asf/nifi.git The following commit(s) were added to refs/heads/support/nifi-1.x by this push: new 8d04559e07 NIFI-11433 - use .add() for set instead of .push() (#7193) 8d04559e07 is described below commit 8d04559e073229f3edcc130c3be6147197b4f1d2 Author: Scott Aslan AuthorDate: Tue Apr 25 13:43:45 2023 -0400 NIFI-11433 - use .add() for set instead of .push() (#7193) * replace d3.nest, use add instead of push for Set, use forEach to loop over Set * es5 function syntax Merged #7193 into main. --- .../main/webapp/js/nf/canvas/nf-controller-service.js| 16 ++-- .../main/webapp/js/nf/canvas/nf-controller-services.js | 6 ++ .../src/main/webapp/js/nf/canvas/nf-settings.js | 6 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js index 9c09beb398..b705e98adf 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js @@ -450,13 +450,9 @@ * @param {array} bulletins */ var updateReferencingComponentBulletins = function (bulletins) { -var bulletinsBySource = d3.nest() -.key(function (d) { -return d.sourceId; -}) -.map(bulletins, d3.map); +var bulletinsBySource = new Map(bulletins.map(function(d) { return [d.sourceId, d]; })); -bulletinsBySource.each(function (sourceBulletins, sourceId) { +bulletinsBySource.forEach(function (sourceBulletins, sourceId) { $('div.' + sourceId + '-bulletins').each(function () { updateBulletins(sourceBulletins, $(this)); }); @@ -830,14 +826,14 @@ */ var getReferencingControllerServiceIds = function (controllerService) { var ids = new Set(); -ids.push(controllerService.id); +ids.add(controllerService.id); var checkReferencingServices = function (referencingComponents) { $.each(referencingComponents, function (_, referencingComponentEntity) { var referencingComponent = referencingComponentEntity.component; if (referencingComponent.referenceType === 'ControllerService') { // add the id -ids.push(referencingComponent.id); +ids.add(referencingComponent.id); // consider it's referencing components if appropriate if (referencingComponent.referenceCycle === false) { @@ -930,7 +926,7 @@ // start polling for each controller service var polling = []; -services.each(function (controllerServiceId) { +services.forEach(function (controllerServiceId) { getControllerService(controllerServiceId, controllerServiceData).done(function(controllerServiceEntity) { polling.push(stopReferencingSchedulableComponents(controllerServiceEntity, pollCondition)); }); @@ -1229,7 +1225,7 @@ // start polling for each controller service var polling = []; -services.each(function (controllerServiceId) { +services.forEach(function (controllerServiceId) { getControllerService(controllerServiceId, controllerServiceData).done(function(controllerServiceEntity) { if (enabled) { polling.push(enableReferencingServices(controllerServiceEntity, pollCondition)); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js index 1c8b1995ec..3742830bcc 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-services.js @@ -1452,11 +1452,9 @@ // if there are some bulletins process them if (!nfCommon.isEmpty(controllerServiceBulletins)) { -var controllerServiceBulletinsBySource = d3.nest() -
[nifi] branch main updated (05418d94f0 -> 387504b66f)
This is an automated email from the ASF dual-hosted git repository. mtien pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git from 05418d94f0 NIFI-1 add option to output Elasticsearch error responses as FlowFile to PutElasticsearchJson and PutElasticsearchRecord NIFI-1 clarify error_responses relationships in PutElasticsearchJson/Record processors NIFI-1 Refactor exception handling for error response flowfile transfer NIFI-1 Add elasticsearch.bulk.error attributes containing the Elasticsearch _bulk response for error documents in PutElasticsearchJson add 387504b66f NIFI-11433 - use .add() for set instead of .push() (#7193) No new revisions were added by this update. Summary of changes: .../main/webapp/js/nf/canvas/nf-controller-service.js| 16 ++-- .../main/webapp/js/nf/canvas/nf-controller-services.js | 6 ++ .../src/main/webapp/js/nf/canvas/nf-settings.js | 6 +- 3 files changed, 9 insertions(+), 19 deletions(-)
[nifi] branch support/nifi-1.x updated: NIFI-11111 add option to output Elasticsearch error responses as FlowFile to PutElasticsearchJson and PutElasticsearchRecord NIFI-11111 clarify error_responses
This is an automated email from the ASF dual-hosted git repository. mthomsen pushed a commit to branch support/nifi-1.x in repository https://gitbox.apache.org/repos/asf/nifi.git The following commit(s) were added to refs/heads/support/nifi-1.x by this push: new c45b841392 NIFI-1 add option to output Elasticsearch error responses as FlowFile to PutElasticsearchJson and PutElasticsearchRecord NIFI-1 clarify error_responses relationships in PutElasticsearchJson/Record processors NIFI-1 Refactor exception handling for error response flowfile transfer NIFI-1 Add elasticsearch.bulk.error attributes containing the Elasticsearch _bulk response for error documents in PutElasticsearchJson c45b841392 is described below commit c45b841392cc8671fe504374540eb5cca23903ff Author: Chris Sampson AuthorDate: Sun Jan 29 19:32:27 2023 + NIFI-1 add option to output Elasticsearch error responses as FlowFile to PutElasticsearchJson and PutElasticsearchRecord NIFI-1 clarify error_responses relationships in PutElasticsearchJson/Record processors NIFI-1 Refactor exception handling for error response flowfile transfer NIFI-1 Add elasticsearch.bulk.error attributes containing the Elasticsearch _bulk response for error documents in PutElasticsearchJson This closes #6903 Signed-off-by: Mike Thomsen --- .../elasticsearch/AbstractPutElasticsearch.java| 104 + .../elasticsearch/PutElasticsearchJson.java| 67 +++-- .../elasticsearch/PutElasticsearchRecord.java | 41 .../AbstractPutElasticsearchTest.groovy| 50 ++ .../elasticsearch/PutElasticsearchJsonTest.groovy | 51 -- .../PutElasticsearchRecordTest.groovy | 42 +++-- .../integration/AbstractElasticsearchITBase.java | 2 +- nifi-nar-bundles/nifi-elasticsearch-bundle/pom.xml | 2 +- 8 files changed, 273 insertions(+), 86 deletions(-) diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java index af12d18102..0ab0a504f7 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java @@ -17,7 +17,6 @@ package org.apache.nifi.processors.elasticsearch; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import org.apache.nifi.annotation.lifecycle.OnScheduled; @@ -37,12 +36,17 @@ import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.util.StandardValidators; +import java.io.IOException; +import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Predicate; @@ -67,6 +71,16 @@ public abstract class AbstractPutElasticsearch extends AbstractProcessor impleme .required(true) .build(); +static final PropertyDescriptor OUTPUT_ERROR_RESPONSES = new PropertyDescriptor.Builder() +.name("put-es-output-error-responses") +.displayName("Output Error Responses") +.description("If this is enabled, response messages from Elasticsearch marked as \"error\" will be output to the \"error_responses\" relationship." + +"This does not impact the output of flowfiles to the \"success\" or \"errors\" relationships") +.allowableValues("true", "false") +.defaultValue("false") +.addValidator(StandardValidators.BOOLEAN_VALIDATOR) +.build(); + static final Relationship REL_SUCCESS = new Relationship.Builder() .name("success") .description("All flowfiles that succeed in being transferred into Elasticsearch go here. " + @@ -74,6 +88,12 @@ public abstract class AbstractPutElasticsearch extends AbstractProcessor impleme "The Elasticsearch response will need to be examined to determine whether any Document(s)/Record(s) resulted in errors.") .build(); +static final Relationship REL_ERROR_RESPONSES = new Relationship.Builder() +.name("error_responses") +
[nifi] branch main updated: NIFI-11111 add option to output Elasticsearch error responses as FlowFile to PutElasticsearchJson and PutElasticsearchRecord NIFI-11111 clarify error_responses relationship
This is an automated email from the ASF dual-hosted git repository. mthomsen pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git The following commit(s) were added to refs/heads/main by this push: new 05418d94f0 NIFI-1 add option to output Elasticsearch error responses as FlowFile to PutElasticsearchJson and PutElasticsearchRecord NIFI-1 clarify error_responses relationships in PutElasticsearchJson/Record processors NIFI-1 Refactor exception handling for error response flowfile transfer NIFI-1 Add elasticsearch.bulk.error attributes containing the Elasticsearch _bulk response for error documents in PutElasticsearchJson 05418d94f0 is described below commit 05418d94f0d75513e3471032d872fd417242329f Author: Chris Sampson AuthorDate: Sun Jan 29 19:32:27 2023 + NIFI-1 add option to output Elasticsearch error responses as FlowFile to PutElasticsearchJson and PutElasticsearchRecord NIFI-1 clarify error_responses relationships in PutElasticsearchJson/Record processors NIFI-1 Refactor exception handling for error response flowfile transfer NIFI-1 Add elasticsearch.bulk.error attributes containing the Elasticsearch _bulk response for error documents in PutElasticsearchJson This closes #6903 Signed-off-by: Mike Thomsen --- .../elasticsearch/AbstractPutElasticsearch.java| 104 + .../elasticsearch/PutElasticsearchJson.java| 67 +++-- .../elasticsearch/PutElasticsearchRecord.java | 41 .../AbstractPutElasticsearchTest.groovy| 50 ++ .../elasticsearch/PutElasticsearchJsonTest.groovy | 51 -- .../PutElasticsearchRecordTest.groovy | 42 +++-- .../integration/AbstractElasticsearchITBase.java | 2 +- nifi-nar-bundles/nifi-elasticsearch-bundle/pom.xml | 2 +- 8 files changed, 273 insertions(+), 86 deletions(-) diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java index af12d18102..0ab0a504f7 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java @@ -17,7 +17,6 @@ package org.apache.nifi.processors.elasticsearch; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import org.apache.nifi.annotation.lifecycle.OnScheduled; @@ -37,12 +36,17 @@ import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.util.StandardValidators; +import java.io.IOException; +import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Predicate; @@ -67,6 +71,16 @@ public abstract class AbstractPutElasticsearch extends AbstractProcessor impleme .required(true) .build(); +static final PropertyDescriptor OUTPUT_ERROR_RESPONSES = new PropertyDescriptor.Builder() +.name("put-es-output-error-responses") +.displayName("Output Error Responses") +.description("If this is enabled, response messages from Elasticsearch marked as \"error\" will be output to the \"error_responses\" relationship." + +"This does not impact the output of flowfiles to the \"success\" or \"errors\" relationships") +.allowableValues("true", "false") +.defaultValue("false") +.addValidator(StandardValidators.BOOLEAN_VALIDATOR) +.build(); + static final Relationship REL_SUCCESS = new Relationship.Builder() .name("success") .description("All flowfiles that succeed in being transferred into Elasticsearch go here. " + @@ -74,6 +88,12 @@ public abstract class AbstractPutElasticsearch extends AbstractProcessor impleme "The Elasticsearch response will need to be examined to determine whether any Document(s)/Record(s) resulted in errors.") .build(); +static final Relationship REL_ERROR_RESPONSES = new Relationship.Builder() +.name("error_responses") +.description(