azagrebin commented on a change in pull request #6782: [FLINK-9083][Cassandra 
Connector] Add async backpressure support to Cassandra Connector
URL: https://github.com/apache/flink/pull/6782#discussion_r224477067
 
 

 ##########
 File path: 
flink-connectors/flink-connector-cassandra/src/main/java/org/apache/flink/streaming/connectors/cassandra/CassandraSinkBase.java
 ##########
 @@ -43,70 +48,82 @@
  */
 public abstract class CassandraSinkBase<IN, V> extends RichSinkFunction<IN> 
implements CheckpointedFunction {
        protected final Logger log = LoggerFactory.getLogger(getClass());
-       protected transient Cluster cluster;
-       protected transient Session session;
 
-       protected transient volatile Throwable exception;
-       protected transient FutureCallback<V> callback;
+       // ------------------------ Default Configurations 
------------------------
+
+       /**
+        * The default maximum number of concurrent requests. By default, 
{@code Integer.MAX_VALUE}.
+        */
+       public static final int DEFAULT_MAX_CONCURRENT_REQUESTS = 
Integer.MAX_VALUE;
+
+       /**
+        * The default timeout duration when acquiring a permit to execute. By 
default, {@code Long.MAX_VALUE}.
+        */
+       public static final long DEFAULT_MAX_CONCURRENT_REQUESTS_TIMEOUT = 
Long.MAX_VALUE;
+
+       /**
+        * The default timeout unit when acquiring a permit to execute. By 
default, milliseconds.
+        */
+       public static final TimeUnit 
DEFAULT_MAX_CONCURRENT_REQUESTS_TIMEOUT_UNIT = TimeUnit.MILLISECONDS;
+
+       // ------------------------- Configuration Fields 
-------------------------
+
+       private int maxConcurrentRequests = DEFAULT_MAX_CONCURRENT_REQUESTS;
+       private long maxConcurrentRequestsTimeout = 
DEFAULT_MAX_CONCURRENT_REQUESTS_TIMEOUT;
+       private TimeUnit maxConcurrentRequestsTimeoutUnit = 
DEFAULT_MAX_CONCURRENT_REQUESTS_TIMEOUT_UNIT;
 
 Review comment:
   These parameters can be final actually because they are set only during 
construction. If they would explode constructor too much, I would rather create 
a separate immutable config class for them and all other possible sink base 
options internally.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to