Skip to content

Commit

Permalink
Fix setters for native_transport_max_concurrent_requests_in_bytes and…
Browse files Browse the repository at this point in the history
… native_transport_max_concurrent_requests_in_bytes_per_ip
  • Loading branch information
ekaterinadimitrova2 committed Apr 2, 2022
1 parent c22accc commit f0ba967
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -16,6 +16,7 @@
* dropping of a materialized view creates a snapshot with dropped- prefix (CASSANDRA-17415)
* Validate existence of DCs when repairing (CASSANDRA-17407)
Merged from 3.0:
* Fix setters for native_transport_max_concurrent_requests_in_bytes and native_transport_max_concurrent_requests_in_bytes_per_ip (CASSANDRA-17515)
* ConnectionLimitHandler may leaks connection count if remote connection drops (CASSANDRA-17252)
* Require ant >= 1.10 (CASSANDRA-17428)
* Disallow CONTAINS for UPDATE and DELETE (CASSANDRA-15266)
Expand Down
6 changes: 6 additions & 0 deletions src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Expand Up @@ -2304,6 +2304,9 @@ public static long getNativeTransportMaxConcurrentRequestsInBytesPerIp()

public static void setNativeTransportMaxConcurrentRequestsInBytesPerIp(long maxConcurrentRequestsInBytes)
{
if (maxConcurrentRequestsInBytes <= 0)
maxConcurrentRequestsInBytes = Runtime.getRuntime().maxMemory() / 40;

conf.native_transport_max_concurrent_requests_in_bytes_per_ip = maxConcurrentRequestsInBytes;
}

Expand All @@ -2314,6 +2317,9 @@ public static long getNativeTransportMaxConcurrentRequestsInBytes()

public static void setNativeTransportMaxConcurrentRequestsInBytes(long maxConcurrentRequestsInBytes)
{
if (maxConcurrentRequestsInBytes <= 0)
maxConcurrentRequestsInBytes = Runtime.getRuntime().maxMemory() / 10;

conf.native_transport_max_concurrent_requests_in_bytes = maxConcurrentRequestsInBytes;
}

Expand Down

0 comments on commit f0ba967

Please sign in to comment.