This is an automated email from the ASF dual-hosted git repository.
exceptionfactory 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 7d44d9176a NIFI-14990 Standardized component property names in
Elasticsearch bundle (#10351)
7d44d9176a is described below
commit 7d44d9176afab161068297809e829ee830b3fb79
Author: dan-s1 <[email protected]>
AuthorDate: Thu Oct 2 09:48:42 2025 -0400
NIFI-14990 Standardized component property names in Elasticsearch bundle
(#10351)
- Aligned those processors and controller services whose property names do
not match the human-friendly display names in extended bundle
nifi-elasticsearch-bundle.
Signed-off-by: David Handermann <[email protected]>
---
.../elasticsearch/ElasticSearchClientService.java | 103 +++++++++++----------
.../elasticsearch/ElasticSearchLookupService.java | 18 ++--
.../ElasticSearchStringLookupService.java | 17 ++--
.../AbstractByQueryElasticsearch.java | 6 ++
.../AbstractJsonQueryElasticsearch.java | 26 ++++--
.../AbstractPaginatedJsonQueryElasticsearch.java | 14 ++-
.../elasticsearch/AbstractPutElasticsearch.java | 22 +++--
.../elasticsearch/ConsumeElasticsearch.java | 30 +++---
.../elasticsearch/ElasticsearchRestProcessor.java | 61 ++++++------
.../processors/elasticsearch/GetElasticsearch.java | 31 +++++--
.../elasticsearch/PutElasticsearchJson.java | 36 ++++---
.../elasticsearch/PutElasticsearchRecord.java | 70 +++++++-------
.../elasticsearch/SearchElasticsearch.java | 10 +-
.../elasticsearch/PutElasticsearchJsonTest.java | 2 +-
.../elasticsearch/PutElasticsearchRecordTest.java | 2 +-
15 files changed, 265 insertions(+), 183 deletions(-)
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service-api/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientService.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service-api/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientService.java
index 5e2d2a37a6..b330c3965e 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service-api/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientService.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service-api/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientService.java
@@ -22,6 +22,7 @@ import org.apache.nifi.components.Validator;
import org.apache.nifi.controller.ControllerService;
import org.apache.nifi.controller.VerifiableControllerService;
import org.apache.nifi.expression.ExpressionLanguageScope;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.oauth2.OAuth2AccessTokenProvider;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.proxy.ProxyConfiguration;
@@ -33,13 +34,12 @@ import java.util.Map;
public interface ElasticSearchClientService extends ControllerService,
VerifiableControllerService {
PropertyDescriptor HTTP_HOSTS = new PropertyDescriptor.Builder()
- .name("el-cs-http-hosts")
- .displayName("HTTP Hosts")
+ .name("HTTP Hosts")
.description("""
A comma-separated list of HTTP hosts that host
Elasticsearch query nodes.
The HTTP Hosts should be valid URIs including protocol,
domain and port for each entry.
For example "https://elasticsearch1:9200,
https://elasticsearch2:9200".
- Note that the Host is included in requests as a header
(typically including domain and port, e.g. elasticsearch:9200).
+ Note that the Host is included in requests as a header
(typically including domain and port, e.g. elasticsearch:9200).
""")
.required(true)
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
@@ -47,8 +47,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor PROP_SSL_CONTEXT_SERVICE = new
PropertyDescriptor.Builder()
- .name("el-cs-ssl-context-service")
- .displayName("SSL Context Service")
+ .name("SSL Context Service")
.description("The SSL Context Service used to provide client
certificate information for TLS/SSL "
+ "connections. This service only applies if the
Elasticsearch endpoint(s) have been secured with TLS/SSL.")
.required(false)
@@ -59,8 +58,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
PropertyDescriptor PROXY_CONFIGURATION_SERVICE =
ProxyConfiguration.createProxyConfigPropertyDescriptor(ProxySpec.HTTP);
PropertyDescriptor AUTHORIZATION_SCHEME = new PropertyDescriptor.Builder()
- .name("authorization-scheme")
- .displayName("Authorization Scheme")
+ .name("Authorization Scheme")
.description("Authorization Scheme used for optional
authentication to Elasticsearch.")
.allowableValues(AuthorizationScheme.class)
.defaultValue(AuthorizationScheme.BASIC)
@@ -69,8 +67,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor OAUTH2_ACCESS_TOKEN_PROVIDER = new
PropertyDescriptor.Builder()
- .name("el-cs-oauth2-token-provider")
- .displayName("OAuth2 Access Token Provider")
+ .name("OAuth2 Access Token Provider")
.description("The OAuth2 Access Token Provider used to provide
JWTs for Bearer Token Authorization with Elasticsearch.")
.dependsOn(AUTHORIZATION_SCHEME, AuthorizationScheme.JWT)
.required(true)
@@ -79,8 +76,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor JWT_SHARED_SECRET = new PropertyDescriptor.Builder()
- .name("jwt-shared-secret")
- .displayName("JWT Shared Secret")
+ .name("JWT Shared Secret")
.description("JWT realm Shared Secret.")
.dependsOn(AUTHORIZATION_SCHEME, AuthorizationScheme.JWT)
.required(true)
@@ -89,8 +85,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor RUN_AS_USER = new PropertyDescriptor.Builder()
- .name("el-cs-run-as-user")
- .displayName("Run As User")
+ .name("Run As User")
.description("The username to impersonate within Elasticsearch.")
.required(false)
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
@@ -98,8 +93,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor USERNAME = new PropertyDescriptor.Builder()
- .name("el-cs-username")
- .displayName("Username")
+ .name("Username")
.description("The username to use with XPack security.")
.dependsOn(AUTHORIZATION_SCHEME, AuthorizationScheme.BASIC)
.required(true)
@@ -108,8 +102,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor PASSWORD = new PropertyDescriptor.Builder()
- .name("el-cs-password")
- .displayName("Password")
+ .name("Password")
.description("The password to use with XPack security.")
.dependsOn(AUTHORIZATION_SCHEME, AuthorizationScheme.BASIC)
.required(true)
@@ -119,8 +112,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor API_KEY_ID = new PropertyDescriptor.Builder()
- .name("api-key-id")
- .displayName("API Key ID")
+ .name("API Key ID")
.description("Unique identifier of the API key.")
.dependsOn(AUTHORIZATION_SCHEME, AuthorizationScheme.API_KEY)
.required(true)
@@ -129,8 +121,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor API_KEY = new PropertyDescriptor.Builder()
- .name("api-key")
- .displayName("API Key")
+ .name("API Key")
.description("Encoded API key.")
.dependsOn(AUTHORIZATION_SCHEME, AuthorizationScheme.API_KEY)
.required(true)
@@ -139,8 +130,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor CONNECT_TIMEOUT = new PropertyDescriptor.Builder()
- .name("el-cs-connect-timeout")
- .displayName("Connect timeout")
+ .name("Connect timeout")
.description("Controls the amount of time, in milliseconds, before
a timeout occurs when trying to connect.")
.required(true)
.defaultValue("5000")
@@ -148,8 +138,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor SOCKET_TIMEOUT = new PropertyDescriptor.Builder()
- .name("el-cs-socket-timeout")
- .displayName("Read timeout")
+ .name("Read Timeout")
.description("Controls the amount of time, in milliseconds, before
a timeout occurs when waiting for a response.")
.required(true)
.defaultValue("60000")
@@ -157,8 +146,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor CHARSET = new PropertyDescriptor.Builder()
- .name("el-cs-charset")
- .displayName("Charset")
+ .name("Character Set")
.description("The charset to use for interpreting the response
from Elasticsearch.")
.required(true)
.defaultValue("UTF-8")
@@ -172,8 +160,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
"Fields that are missing (present in the schema but not in the
record), or that have a value of null/empty, will be written out as a
null/empty value");
PropertyDescriptor SUPPRESS_NULLS = new PropertyDescriptor.Builder()
- .name("el-cs-suppress-nulls")
- .displayName("Suppress Null/Empty Values")
+ .name("Suppress Null and Empty Values")
.description("Specifies how the writer should handle null and
empty fields (including objects and arrays)")
.allowableValues(NEVER_SUPPRESS, ALWAYS_SUPPRESS)
.defaultValue(ALWAYS_SUPPRESS)
@@ -181,8 +168,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor COMPRESSION = new PropertyDescriptor.Builder()
- .name("el-cs-enable-compression")
- .displayName("Enable Compression")
+ .name("Enable Compression")
.description("Whether the REST client should compress requests
using gzip content encoding and add the " +
"\"Accept-Encoding: gzip\" header to receive compressed
responses")
.allowableValues("true", "false")
@@ -191,8 +177,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor SEND_META_HEADER = new PropertyDescriptor.Builder()
- .name("el-cs-send-meta-header")
- .displayName("Send Meta Header")
+ .name("Send Meta Header")
.description("Whether to send a \"X-Elastic-Client-Meta\" header
that describes the runtime environment. " +
"It contains information that is similar to what could be
found in User-Agent. " +
"Using a separate header allows applications to use
User-Agent for their own needs, " +
@@ -203,8 +188,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor STRICT_DEPRECATION = new PropertyDescriptor.Builder()
- .name("el-cs-strict-deprecation")
- .displayName("Strict Deprecation")
+ .name("Strict Deprecation")
.description("Whether the REST client should return any response
containing at least one warning header as a failure")
.allowableValues("true", "false")
.defaultValue("false")
@@ -217,8 +201,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
"Skip dedicated Elasticsearch master nodes for handling request");
PropertyDescriptor NODE_SELECTOR = new PropertyDescriptor.Builder()
- .name("el-cs-node-selector")
- .displayName("Node Selector")
+ .name("Node Selector")
.description("Selects Elasticsearch nodes that can receive
requests. Used to keep requests away from dedicated Elasticsearch master nodes")
.allowableValues(NODE_SELECTOR_ANY,
NODE_SELECTOR_SKIP_DEDICATED_MASTERS)
.defaultValue(NODE_SELECTOR_ANY)
@@ -226,8 +209,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor PATH_PREFIX = new PropertyDescriptor.Builder()
- .name("el-cs-path-prefix")
- .displayName("Path Prefix")
+ .name("Path Prefix")
.description("Sets the path's prefix for every request used by the
http client. " +
"For example, if this is set to \"/my/path\", then any
client request will become \"/my/path/\" + endpoint. " +
"In essence, every request's endpoint is prefixed by this
pathPrefix. " +
@@ -237,8 +219,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor SNIFF_CLUSTER_NODES = new PropertyDescriptor.Builder()
- .name("el-cs-sniff-cluster-nodes")
- .displayName("Sniff Cluster Nodes")
+ .name("Sniff Cluster Nodes")
.description("Periodically sniff for nodes within the
Elasticsearch cluster via the Elasticsearch Node Info API. " +
"If Elasticsearch security features are enabled (default
to \"true\" for 8.x+), the Elasticsearch user must " +
"have the \"monitor\" or \"manage\" cluster privilege to
use this API." +
@@ -252,8 +233,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor SNIFF_ON_FAILURE = new PropertyDescriptor.Builder()
- .name("el-cs-sniff-failure")
- .displayName("Sniff on Failure")
+ .name("Sniff on Failure")
.description("Enable sniffing on failure, meaning that after each
failure the Elasticsearch nodes list gets updated " +
"straight away rather than at the following ordinary
sniffing round")
.dependsOn(SNIFF_CLUSTER_NODES, "true")
@@ -263,8 +243,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor SNIFFER_INTERVAL = new PropertyDescriptor.Builder()
- .name("el-cs-sniffer-interval")
- .displayName("Sniffer Interval")
+ .name("Sniffer Interval")
.description("Interval between Cluster sniffer operations")
.dependsOn(SNIFF_CLUSTER_NODES, "true")
.defaultValue("5 mins")
@@ -273,8 +252,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor SNIFFER_REQUEST_TIMEOUT = new
PropertyDescriptor.Builder()
- .name("el-cs-sniffer-request-timeout")
- .displayName("Sniffer Request Timeout")
+ .name("Sniffer Request Timeout")
.description("Cluster sniffer timeout for node info requests")
.dependsOn(SNIFF_CLUSTER_NODES, "true")
.defaultValue("1 sec")
@@ -283,8 +261,7 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.build();
PropertyDescriptor SNIFFER_FAILURE_DELAY = new PropertyDescriptor.Builder()
- .name("el-cs-sniffer-failure-delay")
- .displayName("Sniffer Failure Delay")
+ .name("Sniffer Failure Delay")
.description("Delay between an Elasticsearch request failure and
updating available Cluster nodes using the Sniffer")
.dependsOn(SNIFF_ON_FAILURE, "true")
.defaultValue("1 min")
@@ -292,6 +269,34 @@ public interface ElasticSearchClientService extends
ControllerService, Verifiabl
.required(true)
.build();
+ @Override
+ default void migrateProperties(PropertyConfiguration config) {
+ config.renameProperty("el-cs-http-hosts", HTTP_HOSTS.getName());
+ config.renameProperty("el-cs-ssl-context-service",
PROP_SSL_CONTEXT_SERVICE.getName());
+ config.renameProperty("authorization-scheme",
AUTHORIZATION_SCHEME.getName());
+ config.renameProperty("el-cs-oauth2-token-provider",
OAUTH2_ACCESS_TOKEN_PROVIDER.getName());
+ config.renameProperty("jwt-shared-secret",
JWT_SHARED_SECRET.getName());
+ config.renameProperty("el-cs-run-as-user", RUN_AS_USER.getName());
+ config.renameProperty("el-cs-username", USERNAME.getName());
+ config.renameProperty("el-cs-password", PASSWORD.getName());
+ config.renameProperty("api-key-id", API_KEY_ID.getName());
+ config.renameProperty("api-key", API_KEY.getName());
+ config.renameProperty("el-cs-connect-timeout",
CONNECT_TIMEOUT.getName());
+ config.renameProperty("el-cs-socket-timeout",
SOCKET_TIMEOUT.getName());
+ config.renameProperty("el-cs-charset", CHARSET.getName());
+ config.renameProperty("el-cs-suppress-nulls",
SUPPRESS_NULLS.getName());
+ config.renameProperty("el-cs-enable-compression",
COMPRESSION.getName());
+ config.renameProperty("el-cs-send-meta-header",
SEND_META_HEADER.getName());
+ config.renameProperty("el-cs-strict-deprecation",
STRICT_DEPRECATION.getName());
+ config.renameProperty("el-cs-node-selector", NODE_SELECTOR.getName());
+ config.renameProperty("el-cs-path-prefix", PATH_PREFIX.getName());
+ config.renameProperty("el-cs-sniff-cluster-nodes",
SNIFF_CLUSTER_NODES.getName());
+ config.renameProperty("el-cs-sniff-failure",
SNIFF_ON_FAILURE.getName());
+ config.renameProperty("el-cs-sniffer-interval",
SNIFFER_INTERVAL.getName());
+ config.renameProperty("el-cs-sniffer-request-timeout",
SNIFFER_REQUEST_TIMEOUT.getName());
+ config.renameProperty("el-cs-sniffer-failure-delay",
SNIFFER_FAILURE_DELAY.getName());
+ }
+
/**
* Index a document.
*
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchLookupService.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchLookupService.java
index 0db790225b..c7f08cd526 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchLookupService.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchLookupService.java
@@ -29,6 +29,7 @@ import org.apache.nifi.controller.ConfigurationContext;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.lookup.LookupFailureException;
import org.apache.nifi.lookup.LookupService;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.record.path.FieldValue;
import org.apache.nifi.record.path.RecordPath;
@@ -58,15 +59,13 @@ import java.util.stream.Stream;
description = "Retrieves an object using JSONPath from the result
document and places it in the return Record at the specified Record Path.")
public class ElasticSearchLookupService extends
JsonInferenceSchemaRegistryService implements LookupService<Record> {
public static final PropertyDescriptor CLIENT_SERVICE = new
PropertyDescriptor.Builder()
- .name("el-rest-client-service")
- .displayName("Client Service")
+ .name("Client Service")
.description("An ElasticSearch client service to use for running
queries.")
.identifiesControllerService(ElasticSearchClientService.class)
.required(true)
.build();
public static final PropertyDescriptor INDEX = new
PropertyDescriptor.Builder()
- .name("el-lookup-index")
- .displayName("Index")
+ .name("Index")
.description("The name of the index to read from")
.required(true)
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
@@ -74,8 +73,7 @@ public class ElasticSearchLookupService extends
JsonInferenceSchemaRegistryServi
.build();
public static final PropertyDescriptor TYPE = new
PropertyDescriptor.Builder()
- .name("el-lookup-type")
- .displayName("Type")
+ .name("Type")
.description("The type of this document (used by Elasticsearch for
indexing and searching)")
.required(false)
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
@@ -178,6 +176,14 @@ public class ElasticSearchLookupService extends
JsonInferenceSchemaRegistryServi
}
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ super.migrateProperties(config);
+ config.renameProperty("el-rest-client-service",
CLIENT_SERVICE.getName());
+ config.renameProperty("el-lookup-index", INDEX.getName());
+ config.renameProperty("el-lookup-type", TYPE.getName());
+ }
+
private void validateCoordinates(final Map<String, Object> coordinates)
throws LookupFailureException {
final List<String> reasons = new ArrayList<>();
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchStringLookupService.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchStringLookupService.java
index ec05144a5a..63bdded121 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchStringLookupService.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchStringLookupService.java
@@ -27,6 +27,7 @@ import org.apache.nifi.controller.ConfigurationContext;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.lookup.LookupFailureException;
import org.apache.nifi.lookup.StringLookupService;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.util.StandardValidators;
import java.io.IOException;
@@ -41,23 +42,20 @@ import java.util.Set;
@Tags({"lookup", "enrich", "value", "key", "elasticsearch"})
public class ElasticSearchStringLookupService extends
AbstractControllerService implements StringLookupService {
public static final PropertyDescriptor CLIENT_SERVICE = new
PropertyDescriptor.Builder()
- .name("el-rest-client-service")
- .displayName("Client Service")
+ .name("Client Service")
.description("An ElasticSearch client service to use for running
queries.")
.identifiesControllerService(ElasticSearchClientService.class)
.required(true)
.build();
public static final PropertyDescriptor INDEX = new
PropertyDescriptor.Builder()
- .name("el-lookup-index")
- .displayName("Index")
+ .name("Index")
.description("The name of the index to read from")
.required(true)
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.build();
public static final PropertyDescriptor TYPE = new
PropertyDescriptor.Builder()
- .name("el-lookup-type")
- .displayName("Type")
+ .name("Type")
.description("The type of this document (used by Elasticsearch for
indexing and searching)")
.required(false)
.expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT)
@@ -103,6 +101,13 @@ public class ElasticSearchStringLookupService extends
AbstractControllerService
}
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ config.renameProperty("el-rest-client-service",
CLIENT_SERVICE.getName());
+ config.renameProperty("el-lookup-index", INDEX.getName());
+ config.renameProperty("el-lookup-type", TYPE.getName());
+ }
+
@Override
public Set<String> getRequiredKeys() {
return Collections.singleton(ID);
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractByQueryElasticsearch.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractByQueryElasticsearch.java
index fcbf3d3245..bdcfab8762 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractByQueryElasticsearch.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractByQueryElasticsearch.java
@@ -27,6 +27,7 @@ import
org.apache.nifi.elasticsearch.ElasticsearchRequestOptions;
import org.apache.nifi.elasticsearch.OperationResponse;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.AbstractProcessor;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
@@ -166,4 +167,9 @@ public abstract class AbstractByQueryElasticsearch extends
AbstractProcessor imp
context.yield();
}
}
+
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ ElasticsearchRestProcessor.super.migrateProperties(config);
+ }
}
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractJsonQueryElasticsearch.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractJsonQueryElasticsearch.java
index 65f2f6876e..c4636965cb 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractJsonQueryElasticsearch.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractJsonQueryElasticsearch.java
@@ -26,6 +26,7 @@ import org.apache.nifi.elasticsearch.SearchResponse;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.flowfile.attributes.CoreAttributes;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.AbstractProcessor;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
@@ -61,8 +62,7 @@ public abstract class AbstractJsonQueryElasticsearch<Q
extends JsonQueryParamete
.build();
public static final PropertyDescriptor SEARCH_RESULTS_SPLIT = new
PropertyDescriptor.Builder()
- .name("el-rest-split-up-hits")
- .displayName("Search Results Split")
+ .name("Search Results Split")
.description("Output a flowfile containing all hits or one
flowfile for each individual hit.")
.allowableValues(ResultOutputStrategy.getNonPaginatedResponseOutputStrategies())
.defaultValue(ResultOutputStrategy.PER_RESPONSE)
@@ -71,8 +71,7 @@ public abstract class AbstractJsonQueryElasticsearch<Q
extends JsonQueryParamete
.build();
public static final PropertyDescriptor SEARCH_RESULTS_FORMAT = new
PropertyDescriptor.Builder()
- .name("el-rest-format-hits")
- .displayName("Search Results Format")
+ .name("Search Results Format")
.description("Format of Hits output.")
.allowableValues(SearchResultsFormat.class)
.defaultValue(SearchResultsFormat.FULL)
@@ -80,8 +79,7 @@ public abstract class AbstractJsonQueryElasticsearch<Q
extends JsonQueryParamete
.expressionLanguageSupported(ExpressionLanguageScope.NONE)
.build();
public static final PropertyDescriptor AGGREGATION_RESULTS_SPLIT = new
PropertyDescriptor.Builder()
- .name("el-rest-split-up-aggregations")
- .displayName("Aggregation Results Split")
+ .name("Aggregation Results Split")
.description("Output a flowfile containing all aggregations or one
flowfile for each individual aggregation.")
.allowableValues(ResultOutputStrategy.getNonPaginatedResponseOutputStrategies())
.defaultValue(ResultOutputStrategy.PER_RESPONSE)
@@ -90,8 +88,7 @@ public abstract class AbstractJsonQueryElasticsearch<Q
extends JsonQueryParamete
.build();
public static final PropertyDescriptor AGGREGATION_RESULTS_FORMAT = new
PropertyDescriptor.Builder()
- .name("el-rest-format-aggregations")
- .displayName("Aggregation Results Format")
+ .name("Aggregation Results Format")
.description("Format of Aggregation output.")
.allowableValues(AggregationResultsFormat.class)
.defaultValue(AggregationResultsFormat.FULL)
@@ -99,8 +96,7 @@ public abstract class AbstractJsonQueryElasticsearch<Q
extends JsonQueryParamete
.expressionLanguageSupported(ExpressionLanguageScope.NONE)
.build();
public static final PropertyDescriptor OUTPUT_NO_HITS = new
PropertyDescriptor.Builder()
- .name("el-rest-output-no-hits")
- .displayName("Output No Hits")
+ .name("Output No Hits")
.description("Output a \"" + REL_HITS.getName() + "\" flowfile
even if no hits found for query. " +
"If true, an empty \"" + REL_HITS.getName() + "\" flowfile
will be output even if \"" +
REL_AGGREGATIONS.getName() + "\" are output.")
@@ -152,6 +148,16 @@ public abstract class AbstractJsonQueryElasticsearch<Q
extends JsonQueryParamete
return queryPropertyDescriptors;
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ ElasticsearchRestProcessor.super.migrateProperties(config);
+ config.renameProperty("el-rest-split-up-hits",
SEARCH_RESULTS_SPLIT.getName());
+ config.renameProperty("el-rest-format-hits",
SEARCH_RESULTS_FORMAT.getName());
+ config.renameProperty("el-rest-split-up-aggregations",
AGGREGATION_RESULTS_SPLIT.getName());
+ config.renameProperty("el-rest-format-aggregations",
AGGREGATION_RESULTS_FORMAT.getName());
+ config.renameProperty("el-rest-output-no-hits",
OUTPUT_NO_HITS.getName());
+ }
+
@Override
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final
String propertyDescriptorName) {
return new PropertyDescriptor.Builder()
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPaginatedJsonQueryElasticsearch.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPaginatedJsonQueryElasticsearch.java
index ec881b65cc..8c3b6d0894 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPaginatedJsonQueryElasticsearch.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPaginatedJsonQueryElasticsearch.java
@@ -26,6 +26,7 @@ import
org.apache.nifi.elasticsearch.ElasticsearchRequestOptions;
import org.apache.nifi.elasticsearch.SearchResponse;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
import org.apache.nifi.processor.util.StandardValidators;
@@ -52,8 +53,7 @@ public abstract class AbstractPaginatedJsonQueryElasticsearch
extends AbstractJs
.build();
public static final PropertyDescriptor PAGINATION_TYPE = new
PropertyDescriptor.Builder()
- .name("el-rest-pagination-type")
- .displayName("Pagination Type")
+ .name("Pagination Type")
.description("Pagination method to use. Not all types are
available for all Elasticsearch versions, " +
"check the Elasticsearch docs to confirm which are
applicable and recommended for your service.")
.allowableValues(PaginationType.class)
@@ -63,8 +63,7 @@ public abstract class AbstractPaginatedJsonQueryElasticsearch
extends AbstractJs
.build();
public static final PropertyDescriptor PAGINATION_KEEP_ALIVE = new
PropertyDescriptor.Builder()
- .name("el-rest-pagination-keep-alive")
- .displayName("Pagination Keep Alive")
+ .name("Pagination Keep Alive")
.description("Pagination \"keep_alive\" period. Period
Elasticsearch will keep the scroll/pit cursor alive " +
"in between requests (this is not the time expected for
all pages to be returned, but the maximum " +
"allowed time for requests between page retrievals).")
@@ -95,6 +94,13 @@ public abstract class
AbstractPaginatedJsonQueryElasticsearch extends AbstractJs
writer = mapper.writer().withRootValueSeparator("\n");
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ super.migrateProperties(config);
+ config.renameProperty("el-rest-pagination-type",
PAGINATION_TYPE.getName());
+ config.renameProperty("el-rest-pagination-keep-alive",
PAGINATION_KEEP_ALIVE.getName());
+ }
+
@Override
SearchResponse doQuery(final PaginatedJsonQueryParameters
paginatedJsonQueryParameters, List<FlowFile> hitsFlowFiles,
final ProcessSession session, final ProcessContext
context, final FlowFile input,
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java
index 2956173baf..6479e0a61e 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractPutElasticsearch.java
@@ -32,6 +32,7 @@ import org.apache.nifi.elasticsearch.IndexOperationResponse;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.AbstractProcessor;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
@@ -77,8 +78,7 @@ public abstract class AbstractPutElasticsearch extends
AbstractProcessor impleme
.build();
static final PropertyDescriptor OUTPUT_ERROR_RESPONSES = new
PropertyDescriptor.Builder()
- .name("put-es-output-error-responses")
- .displayName("Output Error Responses")
+ .name("Output Error Responses")
.description("If this is enabled, response messages from
Elasticsearch marked as \"error\" will be output to the \"" +
REL_ERROR_RESPONSES.getName() + "\" relationship." +
"This does not impact the output of flowfiles to the \"" +
REL_SUCCESSFUL.getName() + "\" or \"" + REL_ERRORS.getName() + "\"
relationships")
.allowableValues("true", "false")
@@ -87,8 +87,7 @@ public abstract class AbstractPutElasticsearch extends
AbstractProcessor impleme
.build();
static final PropertyDescriptor BATCH_SIZE = new
PropertyDescriptor.Builder()
- .name("put-es-record-batch-size")
- .displayName("Batch Size")
+ .name("Batch Size")
.description("The preferred number of FlowFiles to send over in a
single batch")
.defaultValue("100")
.addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR)
@@ -97,8 +96,7 @@ public abstract class AbstractPutElasticsearch extends
AbstractProcessor impleme
.build();
public static final PropertyDescriptor INDEX_OP = new
PropertyDescriptor.Builder()
- .name("put-es-record-index-op")
- .displayName("Index Operation")
+ .name("Index Operation")
.description("The type of the operation used to index (create,
delete, index, update, upsert)")
.addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
@@ -107,8 +105,7 @@ public abstract class AbstractPutElasticsearch extends
AbstractProcessor impleme
.build();
static final PropertyDescriptor NOT_FOUND_IS_SUCCESSFUL = new
PropertyDescriptor.Builder()
- .name("put-es-not_found-is-error")
- .displayName("Treat \"Not Found\" as Success")
+ .name("Treat Not Found as Success")
.description("If true, \"not_found\" Elasticsearch Document
associated Records will be routed to the \"" +
REL_SUCCESSFUL.getName() + "\" relationship, otherwise to
the \"" + REL_ERRORS.getName() + "\" relationship. " +
"If " + OUTPUT_ERROR_RESPONSES.getDisplayName() + " is
\"true\" then \"not_found\" responses from Elasticsearch " +
@@ -143,6 +140,15 @@ public abstract class AbstractPutElasticsearch extends
AbstractProcessor impleme
return relationships.get();
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ ElasticsearchRestProcessor.super.migrateProperties(config);
+ config.renameProperty("put-es-output-error-responses",
OUTPUT_ERROR_RESPONSES.getName());
+ config.renameProperty("put-es-record-batch-size",
BATCH_SIZE.getName());
+ config.renameProperty("put-es-record-index-op", INDEX_OP.getName());
+ config.renameProperty("put-es-not_found-is-error",
NOT_FOUND_IS_SUCCESSFUL.getName());
+ }
+
@Override
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(final
String propertyDescriptorName) {
final PropertyDescriptor.Builder builder = new
PropertyDescriptor.Builder()
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/ConsumeElasticsearch.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/ConsumeElasticsearch.java
index 747730e63b..dab3208c76 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/ConsumeElasticsearch.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/ConsumeElasticsearch.java
@@ -41,6 +41,7 @@ import org.apache.nifi.components.state.StateMap;
import org.apache.nifi.elasticsearch.SearchResponse;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
import org.apache.nifi.processor.util.JsonValidator;
@@ -122,8 +123,7 @@ public class ConsumeElasticsearch extends
SearchElasticsearch {
.build();
public static final PropertyDescriptor RANGE_FIELD = new
PropertyDescriptor.Builder()
- .name("es-rest-range-field")
- .displayName("Range Query Field")
+ .name("Range Query Field")
.description("Field to be tracked as part of an Elasticsearch
Range query using a \"gt\" bound match. " +
"This field must exist within the Elasticsearch document
for it to be retrieved.")
.addValidator(StandardValidators.NON_BLANK_VALIDATOR)
@@ -131,8 +131,7 @@ public class ConsumeElasticsearch extends
SearchElasticsearch {
.build();
public static final PropertyDescriptor RANGE_FIELD_SORT_ORDER = new
PropertyDescriptor.Builder()
- .name("es-rest-sort-order")
- .displayName("Sort Order")
+ .name("Sort Order")
.description("The order in which to sort the \"" +
RANGE_FIELD.getDisplayName() + "\". " +
"A \"sort\" clause for the \"" +
RANGE_FIELD.getDisplayName() +
"\" field will be prepended to any provided \"" +
SORT.getDisplayName() + "\" clauses. " +
@@ -144,8 +143,7 @@ public class ConsumeElasticsearch extends
SearchElasticsearch {
.build();
public static final PropertyDescriptor RANGE_INITIAL_VALUE = new
PropertyDescriptor.Builder()
- .name("es-rest-range-initial-value")
- .displayName("Initial Value")
+ .name("Initial Value")
.description("The initial value to use for the query if the
processor has not run previously. " +
"If the processor has run previously and stored a value in
its state, this property will be ignored. " +
"If no value is provided, and the processor has not
previously run, no Range query bounds will be used, " +
@@ -155,8 +153,7 @@ public class ConsumeElasticsearch extends
SearchElasticsearch {
.build();
public static final PropertyDescriptor RANGE_DATE_FORMAT = new
PropertyDescriptor.Builder()
- .name("es-rest-range-format")
- .displayName(RANGE_INITIAL_VALUE.getDisplayName() + " Date Format")
+ .name(RANGE_INITIAL_VALUE.getDisplayName() + " Date Format")
.description("If the \"" + RANGE_FIELD.getDisplayName() + "\" is a
Date field, convert the \"" + RANGE_INITIAL_VALUE.getDisplayName() + "\" to a
date with this format. " +
"If not specified, Elasticsearch will use the date format
provided by the \"" + RANGE_FIELD.getDisplayName() + "\"'s mapping. " +
"For valid syntax, see
https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html")
@@ -166,8 +163,7 @@ public class ConsumeElasticsearch extends
SearchElasticsearch {
.build();
public static final PropertyDescriptor RANGE_TIME_ZONE = new
PropertyDescriptor.Builder()
- .name("es-rest-range-time-zone")
- .displayName(RANGE_INITIAL_VALUE.getDisplayName() + " Date Time
Zone")
+ .name(RANGE_INITIAL_VALUE.getDisplayName() + " Date Time Zone")
.description("If the \"" + RANGE_FIELD.getDisplayName() + "\" is a
Date field, convert the \"" + RANGE_INITIAL_VALUE.getDisplayName() + "\" to UTC
with this time zone. " +
"Valid values are ISO 8601 UTC offsets, such as \"+01:00\"
or \"-08:00\", and IANA time zone IDs, such as \"Europe/London\".")
.addValidator(StandardValidators.NON_BLANK_VALIDATOR)
@@ -176,8 +172,7 @@ public class ConsumeElasticsearch extends
SearchElasticsearch {
.build();
public static final PropertyDescriptor ADDITIONAL_FILTERS = new
PropertyDescriptor.Builder()
- .name("es-rest-additional-filters")
- .displayName("Additional Filters")
+ .name("Additional Filters")
.description("One or more query filters in JSON syntax, not Lucene
syntax. " +
"Ex: [{\"match\":{\"somefield\":\"somevalue\"}},
{\"match\":{\"anotherfield\":\"anothervalue\"}}]. " +
"These filters wil be used as part of a Bool query's
filter.")
@@ -232,6 +227,17 @@ public class ConsumeElasticsearch extends
SearchElasticsearch {
trackingSortOrder = null;
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ super.migrateProperties(config);
+ config.renameProperty("es-rest-range-field", RANGE_FIELD.getName());
+ config.renameProperty("es-rest-sort-order",
RANGE_FIELD_SORT_ORDER.getName());
+ config.renameProperty("es-rest-range-initial-value",
RANGE_INITIAL_VALUE.getName());
+ config.renameProperty("es-rest-range-format",
RANGE_DATE_FORMAT.getName());
+ config.renameProperty("es-rest-range-time-zone",
RANGE_TIME_ZONE.getName());
+ config.renameProperty("es-rest-additional-filters",
ADDITIONAL_FILTERS.getName());
+ }
+
private String getTrackingRangeField(final ProcessContext context) {
final String field;
if (trackingRangeField != null) {
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/ElasticsearchRestProcessor.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/ElasticsearchRestProcessor.java
index 44b2ae69db..9d5b641def 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/ElasticsearchRestProcessor.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/ElasticsearchRestProcessor.java
@@ -33,6 +33,7 @@ import org.apache.nifi.elasticsearch.SearchResponse;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.DataUnit;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
@@ -65,8 +66,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
StringUtils.startsWith(entry.getKey().getName(),
DYNAMIC_PROPERTY_PREFIX_REQUEST_HEADER);
PropertyDescriptor INDEX = new PropertyDescriptor.Builder()
- .name("el-rest-fetch-index")
- .displayName("Index")
+ .name("Index")
.description("The name of the index to use.")
.required(true)
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
@@ -74,8 +74,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor TYPE = new PropertyDescriptor.Builder()
- .name("el-rest-type")
- .displayName("Type")
+ .name("Type")
.description("The type of this document (used by Elasticsearch for
indexing and searching).")
.required(false)
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
@@ -83,8 +82,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor QUERY_DEFINITION_STYLE = new
PropertyDescriptor.Builder()
- .name("el-rest-query-definition-style")
- .displayName("Query Definition Style")
+ .name("Query Definition Style")
.description("How the JSON Query will be defined for use by the
processor.")
.required(true)
.allowableValues(QueryDefinitionType.class)
@@ -92,8 +90,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor QUERY = new PropertyDescriptor.Builder()
- .name("el-rest-query")
- .displayName("Query")
+ .name("Query")
.description("A query in JSON syntax, not Lucene syntax. Ex:
{\"query\":{\"match\":{\"somefield\":\"somevalue\"}}}. " +
"If this parameter is not set, the query will be read from
the flowfile content. " +
"If the query (property and flowfile content) is empty, a
default empty JSON Object will be used, " +
@@ -105,8 +102,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor QUERY_CLAUSE = new PropertyDescriptor.Builder()
- .name("el-rest-query-clause")
- .displayName("Query Clause")
+ .name("Query Clause")
.description("A \"query\" clause in JSON syntax, not Lucene
syntax. Ex: {\"match\":{\"somefield\":\"somevalue\"}}. " +
"If the query is empty, a default JSON Object will be
used, which will result in a \"match_all\" query in Elasticsearch.")
.dependsOn(QUERY_DEFINITION_STYLE, QueryDefinitionType.BUILD_QUERY)
@@ -116,8 +112,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor SCRIPT = new PropertyDescriptor.Builder()
- .name("el-rest-script")
- .displayName("Script")
+ .name("Script")
.description("A \"script\" to execute during the operation, in
JSON syntax. " +
"Ex: {\"source\": \"ctx._source.count++\", \"lang\":
\"painless\"}")
.dependsOn(QUERY_DEFINITION_STYLE, QueryDefinitionType.BUILD_QUERY)
@@ -127,8 +122,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor SIZE = new PropertyDescriptor.Builder()
- .name("es-rest-size")
- .displayName("Size")
+ .name("Size")
.description("The maximum number of documents to retrieve in the
query. If the query is paginated, " +
"this \"size\" applies to each page of the query, not the
\"size\" of the entire result set.")
.dependsOn(QUERY_DEFINITION_STYLE, QueryDefinitionType.BUILD_QUERY)
@@ -138,8 +132,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor AGGREGATIONS = new PropertyDescriptor.Builder()
- .name("es-rest-query-aggs")
- .displayName("Aggregations")
+ .name("Aggregations")
.description("One or more query aggregations (or \"aggs\"), in
JSON syntax. " +
"Ex: {\"items\": {\"terms\": {\"field\": \"product\",
\"size\": 10}}}")
.dependsOn(QUERY_DEFINITION_STYLE, QueryDefinitionType.BUILD_QUERY)
@@ -149,8 +142,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor SORT = new PropertyDescriptor.Builder()
- .name("es-rest-query-sort")
- .displayName("Sort")
+ .name("Sort")
.description("Sort results by one or more fields, in JSON syntax.
" +
"Ex: [{\"price\" : {\"order\" : \"asc\", \"mode\" :
\"avg\"}}, {\"post_date\" : {\"format\":
\"strict_date_optional_time_nanos\"}}]")
.dependsOn(QUERY_DEFINITION_STYLE, QueryDefinitionType.BUILD_QUERY)
@@ -160,8 +152,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor FIELDS = new PropertyDescriptor.Builder()
- .name("es-rest-query-fields")
- .displayName("Fields")
+ .name("Fields")
.description("Fields of indexed documents to be retrieved, in JSON
syntax. " +
"Ex: [\"user.id\", \"http.response.*\", {\"field\":
\"@timestamp\", \"format\": \"epoch_millis\"}]")
.dependsOn(QUERY_DEFINITION_STYLE, QueryDefinitionType.BUILD_QUERY)
@@ -171,8 +162,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor SCRIPT_FIELDS = new PropertyDescriptor.Builder()
- .name("es-rest-query-script-fields")
- .displayName("Script Fields")
+ .name("Script Fields")
.description("Fields to created using script evaluation at query
runtime, in JSON syntax. " +
"Ex: {\"test1\": {\"script\": {\"lang\": \"painless\",
\"source\": \"doc['price'].value * 2\"}}, " +
"\"test2\": {\"script\": {\"lang\": \"painless\",
\"source\": \"doc['price'].value * params.factor\", \"params\": {\"factor\":
2.0}}}}")
@@ -183,8 +173,7 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor QUERY_ATTRIBUTE = new PropertyDescriptor.Builder()
- .name("el-query-attribute")
- .displayName("Query Attribute")
+ .name("Query Attribute")
.description("If set, the executed query will be set on each
result flowfile in the specified attribute.")
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
.addValidator(Validator.VALID)
@@ -200,16 +189,14 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
.build();
PropertyDescriptor CLIENT_SERVICE = new PropertyDescriptor.Builder()
- .name("el-rest-client-service")
- .displayName("Client Service")
+ .name("Client Service")
.description("An Elasticsearch client service to use for running
queries.")
.identifiesControllerService(ElasticSearchClientService.class)
.required(true)
.build();
PropertyDescriptor LOG_ERROR_RESPONSES = new PropertyDescriptor.Builder()
- .name("put-es-record-log-error-responses")
- .displayName("Log Error Responses")
+ .name("Log Error Responses")
.description("If this is enabled, errors will be logged to the
NiFi logs at the error log level. Otherwise, they will " +
"only be logged if debug logging is enabled on NiFi as a
whole. The purpose of this option is to give the user " +
"the ability to debug failed operations without having to
turn on debug logging.")
@@ -229,6 +216,24 @@ public interface ElasticsearchRestProcessor extends
Processor, VerifiableProcess
String DEFAULT_QUERY_JSON = "{}";
+ @Override
+ default void migrateProperties(PropertyConfiguration config) {
+ config.renameProperty("el-rest-fetch-index", INDEX.getName());
+ config.renameProperty("el-rest-type", TYPE.getName());
+ config.renameProperty("el-rest-query-definition-style",
QUERY_DEFINITION_STYLE.getName());
+ config.renameProperty("el-rest-query", QUERY.getName());
+ config.renameProperty("el-rest-query-clause", QUERY_CLAUSE.getName());
+ config.renameProperty("el-rest-script", SCRIPT.getName());
+ config.renameProperty("es-rest-size", SIZE.getName());
+ config.renameProperty("es-rest-query-aggs", AGGREGATIONS.getName());
+ config.renameProperty("es-rest-query-sort", SORT.getName());
+ config.renameProperty("es-rest-query-fields", FIELDS.getName());
+ config.renameProperty("es-rest-query-script-fields",
SCRIPT_FIELDS.getName());
+ config.renameProperty("el-query-attribute", QUERY_ATTRIBUTE.getName());
+ config.renameProperty("el-rest-client-service",
CLIENT_SERVICE.getName());
+ config.renameProperty("put-es-record-log-error-responses",
LOG_ERROR_RESPONSES.getName());
+ }
+
default ObjectMapper buildObjectMapper(final ProcessContext context) {
final int maxStringLength =
context.getProperty(MAX_JSON_FIELD_STRING_LENGTH).asDataSize(DataUnit.B).intValue();
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/GetElasticsearch.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/GetElasticsearch.java
index ddcc6b175d..6f986b2dfa 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/GetElasticsearch.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/GetElasticsearch.java
@@ -38,6 +38,7 @@ import
org.apache.nifi.elasticsearch.ElasticsearchRequestOptions;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.AbstractProcessor;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
@@ -96,8 +97,7 @@ public class GetElasticsearch extends AbstractProcessor
implements Elasticsearch
);
public static final PropertyDescriptor ID = new
PropertyDescriptor.Builder()
- .name("get-es-id")
- .displayName("Document Id")
+ .name("Document Id")
.description("The _id of the document to retrieve.")
.required(true)
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
@@ -105,8 +105,7 @@ public class GetElasticsearch extends AbstractProcessor
implements Elasticsearch
.build();
static final PropertyDescriptor DESTINATION = new
PropertyDescriptor.Builder()
- .name("get-es-destination")
- .displayName("Destination")
+ .name("Destination")
.description("Indicates whether the retrieved document is written
to the FlowFile content or a FlowFile attribute.")
.required(true)
.allowableValues(FLOWFILE_CONTENT, FLOWFILE_ATTRIBUTE)
@@ -114,8 +113,7 @@ public class GetElasticsearch extends AbstractProcessor
implements Elasticsearch
.build();
static final PropertyDescriptor ATTRIBUTE_NAME = new
PropertyDescriptor.Builder()
- .name("get-es-attribute-name")
- .displayName("Attribute Name")
+ .name("Attribute Name")
.description("The name of the FlowFile attribute to use for the
retrieved document output.")
.required(true)
.defaultValue("elasticsearch.doc")
@@ -134,8 +132,15 @@ public class GetElasticsearch extends AbstractProcessor
implements Elasticsearch
public static final String VERIFICATION_STEP_DOCUMENT_EXISTS =
"Elasticsearch Document Exists";
- static final List<PropertyDescriptor> DESCRIPTORS =
- List.of(ID, INDEX, TYPE, DESTINATION, ATTRIBUTE_NAME,
CLIENT_SERVICE);
+ static final List<PropertyDescriptor> DESCRIPTORS = List.of(
+ ID,
+ INDEX,
+ TYPE,
+ DESTINATION,
+ ATTRIBUTE_NAME,
+ CLIENT_SERVICE
+ );
+
static final Set<Relationship> RELATIONSHIPS = Set.of(REL_DOC,
REL_FAILURE, REL_RETRY, REL_NOT_FOUND);
private ObjectMapper mapper;
@@ -281,8 +286,16 @@ public class GetElasticsearch extends AbstractProcessor
implements Elasticsearch
}
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ ElasticsearchRestProcessor.super.migrateProperties(config);
+ config.renameProperty("get-es-id", ID.getName());
+ config.renameProperty("get-es-destination", DESTINATION.getName());
+ config.renameProperty("get-es-attribute-name",
ATTRIBUTE_NAME.getName());
+ }
+
private void handleElasticsearchException(final ElasticsearchException
ese, FlowFile input, final ProcessSession session,
- final String index, final
String type, final String id) {
+ final String index, final String
type, final String id) {
if (ese.isNotFound()) {
if (input != null) {
session.transfer(input, REL_NOT_FOUND);
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchJson.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchJson.java
index f1abcca921..54d413c3df 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchJson.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchJson.java
@@ -98,8 +98,7 @@ import java.util.Set;
description = "The Batch of FlowFiles will be stored in memory until
the bulk operation is performed.")
public class PutElasticsearchJson extends AbstractPutElasticsearch {
static final PropertyDescriptor ID_ATTRIBUTE = new
PropertyDescriptor.Builder()
- .name("put-es-json-id-attr")
- .displayName("Identifier Attribute")
+ .name("Identifier Attribute")
.description("The name of the FlowFile attribute containing the
identifier for the document. If the Index Operation is \"index\", "
+ "this property may be left empty or evaluate to an empty
value, in which case the document's identifier will be "
+ "auto-generated by Elasticsearch. For all other Index
Operations, the attribute must evaluate to a non-empty value.")
@@ -109,8 +108,7 @@ public class PutElasticsearchJson extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor SCRIPT = new PropertyDescriptor.Builder()
- .name("put-es-json-script")
- .displayName("Script")
+ .name("Script")
.description("The script for the document update/upsert. Only
applies to Update/Upsert operations. " +
"Must be parsable as JSON Object. If left blank, the
FlowFile content will be used for document update/upsert")
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
@@ -118,8 +116,7 @@ public class PutElasticsearchJson extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor SCRIPTED_UPSERT = new
PropertyDescriptor.Builder()
- .name("put-es-json-scripted-upsert")
- .displayName("Scripted Upsert")
+ .name("Scripted Upsert")
.description("Whether to add the scripted_upsert flag to the
Upsert Operation. " +
"If true, forces Elasticsearch to execute the Script
whether or not the document exists, defaults to false. " +
"If the Upsert Document provided (from FlowFile content)
will be empty, but sure to set the " +
@@ -133,16 +130,14 @@ public class PutElasticsearchJson extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor DYNAMIC_TEMPLATES = new
PropertyDescriptor.Builder()
- .name("put-es-json-dynamic_templates")
- .displayName("Dynamic Templates")
+ .name("Dynamic Templates")
.description("The dynamic_templates for the document. Must be
parsable as a JSON Object. Requires Elasticsearch 7+")
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
.addValidator(StandardValidators.NON_BLANK_VALIDATOR)
.build();
static final PropertyDescriptor CHARSET = new PropertyDescriptor.Builder()
- .name("put-es-json-charset")
- .displayName("Character Set")
+ .name("Character Set")
.description("Specifies the character set of the document data.")
.addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
@@ -151,8 +146,20 @@ public class PutElasticsearchJson extends
AbstractPutElasticsearch {
.build();
static final List<PropertyDescriptor> DESCRIPTORS = List.of(
- ID_ATTRIBUTE, INDEX_OP, INDEX, TYPE, SCRIPT, SCRIPTED_UPSERT,
DYNAMIC_TEMPLATES, BATCH_SIZE, CHARSET, MAX_JSON_FIELD_STRING_LENGTH,
- CLIENT_SERVICE, LOG_ERROR_RESPONSES, OUTPUT_ERROR_RESPONSES,
NOT_FOUND_IS_SUCCESSFUL
+ ID_ATTRIBUTE,
+ INDEX_OP,
+ INDEX,
+ TYPE,
+ SCRIPT,
+ SCRIPTED_UPSERT,
+ DYNAMIC_TEMPLATES,
+ BATCH_SIZE,
+ CHARSET,
+ MAX_JSON_FIELD_STRING_LENGTH,
+ CLIENT_SERVICE,
+ LOG_ERROR_RESPONSES,
+ OUTPUT_ERROR_RESPONSES,
+ NOT_FOUND_IS_SUCCESSFUL
);
static final Set<Relationship> BASE_RELATIONSHIPS =
Set.of(REL_ORIGINAL, REL_FAILURE, REL_RETRY, REL_SUCCESSFUL,
REL_ERRORS);
@@ -174,6 +181,11 @@ public class PutElasticsearchJson extends
AbstractPutElasticsearch {
if (config.hasProperty("put-es-json-error-documents")) {
config.removeProperty("put-es-json-error-documents");
}
+ config.renameProperty("put-es-json-id-attr", ID_ATTRIBUTE.getName());
+ config.renameProperty("put-es-json-script", SCRIPT.getName());
+ config.renameProperty("put-es-json-scripted-upsert",
SCRIPTED_UPSERT.getName());
+ config.renameProperty("put-es-json-dynamic_templates",
DYNAMIC_TEMPLATES.getName());
+ config.renameProperty("put-es-json-charset", CHARSET.getName());
config.renameProperty("put-es-json-not_found-is-error",
AbstractPutElasticsearch.NOT_FOUND_IS_SUCCESSFUL.getName());
}
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecord.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecord.java
index 8602a76883..8675480a76 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecord.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecord.java
@@ -129,8 +129,7 @@ import java.util.concurrent.atomic.AtomicLong;
description = "The Batch of Records will be stored in memory until the
bulk operation is performed.")
public class PutElasticsearchRecord extends AbstractPutElasticsearch {
public static final PropertyDescriptor RECORD_READER = new
PropertyDescriptor.Builder()
- .name("put-es-record-reader")
- .displayName("Record Reader")
+ .name("Record Reader")
.description("The record reader to use for reading incoming records
from flowfiles.")
.identifiesControllerService(RecordReaderFactory.class)
.required(true)
@@ -143,8 +142,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor AT_TIMESTAMP = new
PropertyDescriptor.Builder()
- .name("put-es-record-at-timestamp")
- .displayName("@timestamp Value")
+ .name("Timestamp Value")
.description("The value to use as the @timestamp field (required for
Elasticsearch Data Streams)")
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
@@ -152,8 +150,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor INDEX_OP_RECORD_PATH = new
PropertyDescriptor.Builder()
- .name("put-es-record-index-op-path")
- .displayName("Index Operation Record Path")
+ .name("Index Operation Record Path")
.description("A record path expression to retrieve the Index Operation
field for use with Elasticsearch. If left blank " +
"the Index Operation will be determined using the main Index
Operation property.")
.addValidator(new RecordPathValidator())
@@ -162,8 +159,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
public static final PropertyDescriptor ID_RECORD_PATH = new
PropertyDescriptor.Builder()
- .name("put-es-record-id-path")
- .displayName("ID Record Path")
+ .name("ID Record Path")
.description("A record path expression to retrieve the ID field for
use with Elasticsearch. If left blank " +
"the ID will be automatically generated by Elasticsearch.")
.addValidator(new RecordPathValidator())
@@ -172,8 +168,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
public static final PropertyDescriptor RETAIN_ID_FIELD = new
PropertyDescriptor.Builder()
- .name("put-es-record-retain-id-field")
- .displayName("Retain ID (Record Path)")
+ .name("Retain ID (Record Path)")
.description("Whether to retain the existing field used as the ID
Record Path.")
.addValidator(StandardValidators.BOOLEAN_VALIDATOR)
.defaultValue("false")
@@ -183,8 +178,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor INDEX_RECORD_PATH = new
PropertyDescriptor.Builder()
- .name("put-es-record-index-record-path")
- .displayName("Index Record Path")
+ .name("Index Record Path")
.description("A record path expression to retrieve the index field for
use with Elasticsearch. If left blank " +
"the index will be determined using the main index property.")
.addValidator(new RecordPathValidator())
@@ -193,8 +187,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor TYPE_RECORD_PATH = new
PropertyDescriptor.Builder()
- .name("put-es-record-type-record-path")
- .displayName("Type Record Path")
+ .name("Type Record Path")
.description("A record path expression to retrieve the type field for
use with Elasticsearch. If left blank " +
"the type will be determined using the main type property.")
.addValidator(new RecordPathValidator())
@@ -203,8 +196,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor AT_TIMESTAMP_RECORD_PATH = new
PropertyDescriptor.Builder()
- .name("put-es-record-at-timestamp-path")
- .displayName("@timestamp Record Path")
+ .name("Timestamp Record Path")
.description("A RecordPath pointing to a field in the record(s) that
contains the @timestamp for the document. " +
"If left blank the @timestamp will be determined using the
main @timestamp property")
.addValidator(new RecordPathValidator())
@@ -212,8 +204,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
public static final PropertyDescriptor SCRIPT_RECORD_PATH = new
PropertyDescriptor.Builder()
- .name("put-es-record-script-path")
- .displayName("Script Record Path")
+ .name("Script Record Path")
.description("A RecordPath pointing to a field in the record(s)
that contains the script for the document update/upsert. " +
"Only applies to Update/Upsert operations. Field must be
Map-type compatible (e.g. a Map or a Record) " +
"or a String parsable into a JSON Object")
@@ -222,8 +213,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
public static final PropertyDescriptor SCRIPTED_UPSERT_RECORD_PATH = new
PropertyDescriptor.Builder()
- .name("put-es-record-scripted-upsert-path")
- .displayName("Scripted Upsert Record Path")
+ .name("Scripted Upsert Record Path")
.description("A RecordPath pointing to a field in the record(s)
that contains the scripted_upsert boolean flag. " +
"Whether to add the scripted_upsert flag to the Upsert
Operation. " +
"Forces Elasticsearch to execute the Script whether or not
the document exists, defaults to false. " +
@@ -237,8 +227,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor DYNAMIC_TEMPLATES_RECORD_PATH = new
PropertyDescriptor.Builder()
- .name("put-es-record-dynamic-templates-path")
- .displayName("Dynamic Templates Record Path")
+ .name("Dynamic Templates Record Path")
.description("A RecordPath pointing to a field in the record(s)
that contains the dynamic_templates for the document. " +
"Field must be Map-type compatible (e.g. a Map or Record)
or a String parsable into a JSON Object. " +
"Requires Elasticsearch 7+")
@@ -247,8 +236,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor RETAIN_AT_TIMESTAMP_FIELD = new
PropertyDescriptor.Builder()
- .name("put-es-record-retain-at-timestamp-field")
- .displayName("Retain @timestamp (Record Path)")
+ .name("Retain Record Timestamp")
.description("Whether to retain the existing field used as the
@timestamp Record Path.")
.addValidator(StandardValidators.BOOLEAN_VALIDATOR)
.defaultValue("false")
@@ -258,8 +246,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
public static final PropertyDescriptor RESULT_RECORD_WRITER = new
PropertyDescriptor.Builder()
- .name("put-es-record-error-writer")
- .displayName("Result Record Writer")
+ .name("Result Record Writer")
.description("The response from Elasticsearch will be examined for
failed records " +
"and the failed records will be written to a record set with
this record writer service and sent to the \"" +
REL_ERRORS.getName() + "\" relationship. Successful records
will be written to a record set " +
@@ -270,8 +257,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor GROUP_BULK_ERRORS_BY_TYPE = new
PropertyDescriptor.Builder()
- .name("put-es-record-bulk-error-groups")
- .displayName("Group Results by Bulk Error Type")
+ .name("Group Results by Bulk Error Type")
.description("The errored records written to the \"" +
REL_ERRORS.getName() + "\" relationship will be grouped by error type " +
"and the error related to the first record within the
FlowFile added to the FlowFile as \"elasticsearch.bulk.error\". " +
"If \"" + NOT_FOUND_IS_SUCCESSFUL.getDisplayName() + "\"
is \"false\" then records associated with \"not_found\" " +
@@ -284,8 +270,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor DATE_FORMAT = new
PropertyDescriptor.Builder()
- .name("put-es-record-at-timestamp-date-format")
- .displayName("Date Format")
+ .name("Date Format")
.description("Specifies the format to use when writing Date fields. "
+ "If not specified, the default format '" +
RecordFieldType.DATE.getDefaultFormat() + "' is used. "
+ "If specified, the value must match the Java Simple Date
Format (for example, MM/dd/yyyy for a two-digit month, followed by "
@@ -296,8 +281,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor TIME_FORMAT = new
PropertyDescriptor.Builder()
- .name("put-es-record-at-timestamp-time-format")
- .displayName("Time Format")
+ .name("Time Format")
.description("Specifies the format to use when writing Time fields. "
+ "If not specified, the default format '" +
RecordFieldType.TIME.getDefaultFormat() + "' is used. "
+ "If specified, the value must match the Java Simple Date
Format (for example, HH:mm:ss for a two-digit hour in 24-hour format, followed
by "
@@ -308,8 +292,7 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
.build();
static final PropertyDescriptor TIMESTAMP_FORMAT = new
PropertyDescriptor.Builder()
- .name("put-es-record-at-timestamp-timestamp-format")
- .displayName("Timestamp Format")
+ .name("Timestamp Format")
.description("Specifies the format to use when writing Timestamp
fields. "
+ "If not specified, the default format '" +
RecordFieldType.TIMESTAMP.getDefaultFormat() + "' is used. "
+ "If specified, the value must match the Java Simple Date
Format (for example, MM/dd/yyyy HH:mm:ss for a two-digit month, followed by "
@@ -357,8 +340,25 @@ public class PutElasticsearchRecord extends
AbstractPutElasticsearch {
@Override
public void migrateProperties(final PropertyConfiguration config) {
super.migrateProperties(config);
-
+ config.renameProperty("put-es-record-reader", RECORD_READER.getName());
+ config.renameProperty("put-es-record-at-timestamp",
AT_TIMESTAMP.getName());
+ config.renameProperty("put-es-record-index-op-path",
INDEX_OP_RECORD_PATH.getName());
+ config.renameProperty("put-es-record-id-path",
ID_RECORD_PATH.getName());
+ config.renameProperty("put-es-record-retain-id-field",
RETAIN_ID_FIELD.getName());
+ config.renameProperty("put-es-record-index-record-path",
INDEX_RECORD_PATH.getName());
+ config.renameProperty("put-es-record-type-record-path",
TYPE_RECORD_PATH.getName());
+ config.renameProperty("put-es-record-at-timestamp-path",
AT_TIMESTAMP_RECORD_PATH.getName());
+ config.renameProperty("put-es-record-script-path",
SCRIPT_RECORD_PATH.getName());
+ config.renameProperty("put-es-record-scripted-upsert-path",
SCRIPTED_UPSERT_RECORD_PATH.getName());
+ config.renameProperty("put-es-record-dynamic-templates-path",
DYNAMIC_TEMPLATES_RECORD_PATH.getName());
+ config.renameProperty("put-es-record-retain-at-timestamp-field",
RETAIN_AT_TIMESTAMP_FIELD.getName());
+ config.renameProperty("put-es-record-error-writer",
RESULT_RECORD_WRITER.getName());
+ config.renameProperty("put-es-record-bulk-error-groups",
GROUP_BULK_ERRORS_BY_TYPE.getName());
+ config.renameProperty("put-es-record-at-timestamp-date-format",
DATE_FORMAT.getName());
+ config.renameProperty("put-es-record-at-timestamp-time-format",
TIME_FORMAT.getName());
+ config.renameProperty("put-es-record-at-timestamp-timestamp-format",
TIMESTAMP_FORMAT.getName());
config.renameProperty("put-es-record-not_found-is-error",
AbstractPutElasticsearch.NOT_FOUND_IS_SUCCESSFUL.getName());
+
if (config.getPropertyValue(RESULT_RECORD_WRITER).isEmpty()) {
final String resultRecordWriterId =
config.createControllerService("org.apache.nifi.json.JsonRecordSetWriter",
Collections.emptyMap());
config.setProperty(RESULT_RECORD_WRITER, resultRecordWriterId);
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/SearchElasticsearch.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/SearchElasticsearch.java
index c353489d59..b49131bae3 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/SearchElasticsearch.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/SearchElasticsearch.java
@@ -37,6 +37,7 @@ import org.apache.nifi.components.state.StateMap;
import org.apache.nifi.elasticsearch.SearchResponse;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.flowfile.FlowFile;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.ProcessSession;
import org.apache.nifi.processor.Relationship;
@@ -108,8 +109,7 @@ public class SearchElasticsearch extends
AbstractPaginatedJsonQueryElasticsearch
.build();
static final PropertyDescriptor RESTART_ON_FINISH = new
PropertyDescriptor.Builder()
- .name("restart-on-finish")
- .displayName("Restart On Finish?")
+ .name("Restart On Finish")
.description("Whether the processor should start another search
with the same query once a paginated search has completed.")
.addValidator(StandardValidators.BOOLEAN_VALIDATOR)
.allowableValues(Boolean.TRUE.toString(), Boolean.FALSE.toString())
@@ -157,6 +157,12 @@ public class SearchElasticsearch extends
AbstractPaginatedJsonQueryElasticsearch
}
}
+ @Override
+ public void migrateProperties(PropertyConfiguration config) {
+ super.migrateProperties(config);
+ config.renameProperty("restart-on-finish",
RESTART_ON_FINISH.getName());
+ }
+
@Override
PaginatedJsonQueryParameters buildJsonQueryParameters(final FlowFile
input, final ProcessContext context, final ProcessSession session) throws
IOException {
final StateMap stateMap =
context.getStateManager().getState(getStateScope());
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchJsonTest.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchJsonTest.java
index 193b490826..feaa612923 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchJsonTest.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchJsonTest.java
@@ -156,7 +156,7 @@ public class PutElasticsearchJsonTest extends
AbstractPutElasticsearchTest {
assertTrue(runner.getProcessContext().getProperties().keySet().stream().noneMatch(pd
-> "put-es-json-not_found-is-error".equals(pd.getName())));
assertTrue(runner.getProcessContext().getProperties().keySet().stream().noneMatch(pd
-> "put-es-json-error-documents".equals(pd.getName())));
- assertEquals(1, result.getPropertiesRenamed().size());
+ assertTrue(1 < result.getPropertiesRenamed().size());
assertEquals(AbstractPutElasticsearch.NOT_FOUND_IS_SUCCESSFUL.getName(),
result.getPropertiesRenamed().get("put-es-json-not_found-is-error"));
assertEquals(1, result.getPropertiesRemoved().size());
assertTrue(result.getPropertiesRemoved().contains("put-es-json-error-documents"));
diff --git
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecordTest.java
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecordTest.java
index 45efb78aef..449bf7785a 100644
---
a/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecordTest.java
+++
b/nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/test/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchRecordTest.java
@@ -220,7 +220,7 @@ class PutElasticsearchRecordTest extends
AbstractPutElasticsearchTest {
assertNotNull(migratedWriter);
assertTrue(runner.isControllerServiceEnabled(migratedWriter));
- assertEquals(1, result.getPropertiesRenamed().size());
+ assertTrue(1 < result.getPropertiesRenamed().size());
assertEquals(AbstractPutElasticsearch.NOT_FOUND_IS_SUCCESSFUL.getName(),
result.getPropertiesRenamed().get("put-es-record-not_found-is-error"));
assertEquals(0, result.getPropertiesRemoved().size());
assertEquals(1, result.getPropertiesUpdated().size());