turcsanyip commented on a change in pull request #4689:
URL: https://github.com/apache/nifi/pull/4689#discussion_r531025457



##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenTCP.java
##########
@@ -83,10 +87,49 @@
             .defaultValue(ClientAuth.REQUIRED.name())
             .build();
 
+    public static final PropertyDescriptor MIN_RECV_THREAD_POOL_SIZE = new 
PropertyDescriptor.Builder()
+            .name("min_receiving_threads")
+            .displayName("Min Number of Receiving Message Handler Threads")
+            .description(
+                    "The minimum number of threads for handling receiving 
messages ready all the time. " +
+                    "Cannot be bigger than the \"Max Number of Receiving 
Message Handler Threads\" or \"Max Number of TCP Connections\". " +
+                    "If not set, the value of \"Max Number of Receiving 
Message Handler Threads\" will be used.")
+            .addValidator(StandardValidators.createLongValidator(1, 65535, 
true))
+            .required(false)
+            .build();
+
+    public static final PropertyDescriptor MAX_RECV_THREAD_POOL_SIZE = new 
PropertyDescriptor.Builder()
+            .name("max_receiving_threads")
+            .displayName("Max Number of Receiving Message Handler Threads")
+            .description(
+                    "The maximum number of threads might be available for 
handling receiving messages ready all the time. " +
+                    "Cannot be bigger than the \"Max Number of TCP 
Connections\". " +
+                    "If not set, the value of \"Max Number of Receiving 
Message Handler Threads\" will be used.")
+            .addValidator(StandardValidators.createLongValidator(1, 65535, 
true))
+            .required(false)
+            .build();
+
+    protected static final PropertyDescriptor RECV_POOL_BYTE_BUFFERS = new 
PropertyDescriptor.Builder()
+            .name("pool_byte_buffers")
+            .displayName("Pool Byte Buffers")

Review comment:
       I would call it `Pool Receive Buffers` and move the property just after 
`Receive Buffer Size` on the UI, and then the receiver threads property.

##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ListenTCP.java
##########
@@ -83,10 +87,49 @@
             .defaultValue(ClientAuth.REQUIRED.name())
             .build();
 
+    public static final PropertyDescriptor MIN_RECV_THREAD_POOL_SIZE = new 
PropertyDescriptor.Builder()
+            .name("min_receiving_threads")

Review comment:
       Property names rather use `min-receiving-threads` convention.

##########
File path: 
nifi-nar-bundles/nifi-extension-utils/nifi-processor-utils/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/ByteBufferSource.java
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.processor.util.listen.dispatcher;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Manages byte buffers for the dispatchers.
+ */
+public interface ByteBufferSource {
+
+    /**
+     * @return Returns for a buffer for usage. It is not guaranteed tha the 
buffer is created ad hoc. If the source is
+     * not capable to provide an instance, it returns {@code null} instead.
+     */
+    ByteBuffer acquireBuffer();
+
+    /**
+     * With calling this method the client releases the buffer. It might be 
reused by the handler and not to be used
+     * by this client any more.
+     *
+     * @param byteBuffer The byte buffer the client acquired previously.
+     */
+    void release(ByteBuffer byteBuffer);

Review comment:
       Is it intentional that one method has "Buffer" suffix but the other does 
not?
   I would use either acquire + release or acquireBuffer + releaseBuffer.

##########
File path: 
nifi-nar-bundles/nifi-extension-utils/nifi-processor-utils/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/ByteBufferSource.java
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.nifi.processor.util.listen.dispatcher;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Manages byte buffers for the dispatchers.
+ */
+public interface ByteBufferSource {
+
+    /**
+     * @return Returns for a buffer for usage. It is not guaranteed tha the 
buffer is created ad hoc. If the source is

Review comment:
       _"It is not guaranteed tha the buffer is created ad hoc."_
   I would rather say: _"The buffer can be pooled or created on demand 
depending on the implementation."_




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to