@@ -60,6 +60,8 @@ public class EngineConfiguration extends Configuration
6060 public static final PropertyDef <Path > ENGINE_CACHE_DIRECTORY ;
6161 public static final PropertyDef <HostResolver > ENGINE_HOST_RESOLVER ;
6262 public static final IntPropertyDef ENGINE_WORKER_CAPACITY ;
63+ public static final IntPropertyDef ENGINE_WORKER_CAPACITY_LIMIT ;
64+ public static final BooleanPropertyDef ENGINE_WORKER_CAPACITY_UNBOUNDED ;
6365 public static final DoublePropertyDef ENGINE_MEMORY_PERCENTAGE ;
6466 public static final DoublePropertyDef ENGINE_DISK_PERCENTAGE ;
6567 public static final IntPropertyDef ENGINE_BUFFER_POOL_CAPACITY ;
@@ -111,6 +113,8 @@ public class EngineConfiguration extends Configuration
111113 ENGINE_MEMORY_PERCENTAGE = config .property ("memory.percentage" , 0.25 );
112114 ENGINE_DISK_PERCENTAGE = config .property ("disk.percentage" , 0.75 );
113115 ENGINE_WORKER_CAPACITY = config .property ("worker.capacity" , EngineConfiguration ::defaultWorkerCapacity );
116+ ENGINE_WORKER_CAPACITY_UNBOUNDED = config .property ("worker.capacity.unbounded" , false );
117+ ENGINE_WORKER_CAPACITY_LIMIT = config .property ("worker.capacity.limit" , EngineConfiguration ::defaultWorkerCapacityLimit );
114118 ENGINE_BUFFER_POOL_CAPACITY = config .property ("buffer.pool.capacity" , EngineConfiguration ::defaultBufferPoolCapacity );
115119 ENGINE_BUFFER_SLOT_CAPACITY = config .property ("buffer.slot.capacity" , 32 * 1024 );
116120 ENGINE_STREAMS_BUFFER_CAPACITY = config .property ("streams.buffer.capacity" ,
@@ -426,6 +430,14 @@ private static int defaultWorkerCapacity(
426430 return newWorkersCapacity ;
427431 }
428432
433+ private static int defaultWorkerCapacityLimit (
434+ Configuration config )
435+ {
436+ return ENGINE_WORKER_CAPACITY_UNBOUNDED .get (config )
437+ ? Integer .MAX_VALUE
438+ : ENGINE_WORKER_CAPACITY .get (config );
439+ }
440+
429441 private static URL configURL (
430442 Configuration config ,
431443 String url )
0 commit comments