You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2016/10/18 18:51:21 UTC

nifi git commit: NIFI-2500 This closes #1131. made container queue configurable

Repository: nifi
Updated Branches:
  refs/heads/master 9fb303941 -> 5afbc4336


NIFI-2500 This closes #1131. made container queue configurable


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

Branch: refs/heads/master
Commit: 5afbc433642a51a40c22a2048cfa7d0e9cf0a86a
Parents: 9fb3039
Author: Oleg Zhurakousky <ol...@suitcase.io>
Authored: Thu Oct 13 12:08:29 2016 -0400
Committer: joewitt <jo...@apache.org>
Committed: Tue Oct 18 14:47:49 2016 -0400

----------------------------------------------------------------------
 .../processors/standard/HandleHttpRequest.java  | 26 ++++++++++++++------
 1 file changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/5afbc433/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
index 9f8edfc..c1acc85 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HandleHttpRequest.java
@@ -219,19 +219,20 @@ public class HandleHttpRequest extends AbstractProcessor {
             .allowableValues(CLIENT_NONE, CLIENT_WANT, CLIENT_NEED)
             .defaultValue(CLIENT_NONE.getValue())
             .build();
+    public static final PropertyDescriptor CONTAINER_QUEUE_SIZE = new PropertyDescriptor.Builder()
+            .name("container-queue-size").displayName("Container Queue Size")
+            .description("The size of the queue for Http Request Containers").required(true)
+            .addValidator(StandardValidators.POSITIVE_INTEGER_VALIDATOR).defaultValue("50").build();
 
     public static final Relationship REL_SUCCESS = new Relationship.Builder()
             .name("success")
             .description("All content that is received is routed to the 'success' relationship")
             .build();
 
-    private volatile Server server;
-    private AtomicBoolean initialized = new AtomicBoolean(false);
-    private final BlockingQueue<HttpRequestContainer> containerQueue = new LinkedBlockingQueue<>(50);
+    private static final List<PropertyDescriptor> propertyDescriptors;
 
-    @Override
-    protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
-        final List<PropertyDescriptor> descriptors = new ArrayList<>();
+    static {
+        List<PropertyDescriptor> descriptors = new ArrayList<>();
         descriptors.add(PORT);
         descriptors.add(HOSTNAME);
         descriptors.add(SSL_CONTEXT);
@@ -246,8 +247,17 @@ public class HandleHttpRequest extends AbstractProcessor {
         descriptors.add(ALLOW_OPTIONS);
         descriptors.add(ADDITIONAL_METHODS);
         descriptors.add(CLIENT_AUTH);
+        descriptors.add(CONTAINER_QUEUE_SIZE);
+        propertyDescriptors = Collections.unmodifiableList(descriptors);
+    }
 
-        return descriptors;
+    private volatile Server server;
+    private AtomicBoolean initialized = new AtomicBoolean(false);
+    private volatile BlockingQueue<HttpRequestContainer> containerQueue;
+
+    @Override
+    protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
+        return propertyDescriptors;
     }
 
     @Override
@@ -264,7 +274,7 @@ public class HandleHttpRequest extends AbstractProcessor {
         if(initialized.get()){
             return;
         }
-
+        this.containerQueue = new LinkedBlockingQueue<>(context.getProperty(CONTAINER_QUEUE_SIZE).asInteger());
         final String host = context.getProperty(HOSTNAME).getValue();
         final int port = context.getProperty(PORT).asInteger();
         final SSLContextService sslService = context.getProperty(SSL_CONTEXT).asControllerService(SSLContextService.class);