You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2014/12/11 19:41:05 UTC

[03/25] incubator-nifi git commit: NIFI-141: - Removing the use of PreparedQueries when searching as it should be considering the raw form (not the evaluated form).

NIFI-141:
- Removing the use of PreparedQueries when searching as it should be considering the raw form (not the evaluated form).

Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/457787cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/457787cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/457787cd

Branch: refs/heads/bootstrap
Commit: 457787cde08b8d785948713b435d38f816e686da
Parents: 1120b0f
Author: Matt Gilman <ma...@gmail.com>
Authored: Tue Dec 9 12:42:55 2014 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Tue Dec 9 12:42:55 2014 -0500

----------------------------------------------------------------------
 .../web/controller/StandardSearchContext.java     | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/457787cd/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/StandardSearchContext.java
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/StandardSearchContext.java b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/StandardSearchContext.java
index 2bd6e7f..ddb5350 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/StandardSearchContext.java
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/StandardSearchContext.java
@@ -16,11 +16,8 @@
  */
 package org.apache.nifi.web.controller;
 
-import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.nifi.attribute.expression.language.PreparedQuery;
-import org.apache.nifi.attribute.expression.language.Query;
 import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.components.PropertyValue;
 import org.apache.nifi.controller.ControllerServiceLookup;
@@ -36,24 +33,11 @@ public class StandardSearchContext implements SearchContext {
     private final String searchTerm;
     private final ProcessorNode processorNode;
     private final ControllerServiceLookup controllerServiceLookup;
-    private final Map<PropertyDescriptor, PreparedQuery> preparedQueries;
 
     public StandardSearchContext(final String searchTerm, final ProcessorNode processorNode, final ControllerServiceLookup controllerServiceLookup) {
         this.searchTerm = searchTerm;
         this.processorNode = processorNode;
         this.controllerServiceLookup = controllerServiceLookup;
-
-        preparedQueries = new HashMap<>();
-        for (final Map.Entry<PropertyDescriptor, String> entry : processorNode.getProperties().entrySet()) {
-            final PropertyDescriptor desc = entry.getKey();
-            String value = entry.getValue();
-            if (value == null) {
-                value = desc.getDefaultValue();
-            }
-
-            final PreparedQuery pq = Query.prepare(value);
-            preparedQueries.put(desc, pq);
-        }
     }
 
     @Override
@@ -69,7 +53,7 @@ public class StandardSearchContext implements SearchContext {
     @Override
     public PropertyValue getProperty(PropertyDescriptor property) {
         final String configuredValue = processorNode.getProperty(property);
-        return new StandardPropertyValue(configuredValue == null ? property.getDefaultValue() : configuredValue, controllerServiceLookup, preparedQueries.get(property));
+        return new StandardPropertyValue(configuredValue == null ? property.getDefaultValue() : configuredValue, controllerServiceLookup, null);
     }
 
     @Override