setup() — netty Function Reference
Architecture documentation for the setup() function in BurstCostExecutorsBenchmark.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 30fce65c_e43b_4fc1_f613_eceff016b47f["setup()"] 1e2b3bde_093d_e848_9b56_b6d1ef72c773["BurstCostExecutorsBenchmark"] 30fce65c_e43b_4fc1_f613_eceff016b47f -->|defined in| 1e2b3bde_093d_e848_9b56_b6d1ef72c773 11bdb437_0419_7580_3709_276c968eb1f1["setup()"] 11bdb437_0419_7580_3709_276c968eb1f1 -->|calls| 30fce65c_e43b_4fc1_f613_eceff016b47f 11bdb437_0419_7580_3709_276c968eb1f1["setup()"] 30fce65c_e43b_4fc1_f613_eceff016b47f -->|calls| 11bdb437_0419_7580_3709_276c968eb1f1 85ceb04d_6d16_20b0_4aaf_1a8d046a2bea["SpinExecutorService()"] 30fce65c_e43b_4fc1_f613_eceff016b47f -->|calls| 85ceb04d_6d16_20b0_4aaf_1a8d046a2bea style 30fce65c_e43b_4fc1_f613_eceff016b47f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
microbench/src/main/java/io/netty/microbench/concurrent/BurstCostExecutorsBenchmark.java lines 187–228
@Setup
public void setup() {
ExecutorType type = ExecutorType.valueOf(executorType);
switch (type) {
case spinning:
//The case with 3 producers can have a peak of 3*burstLength offers:
//4 is to leave some room between the offers and 1024 is to leave some room
//between producer/consumer when work is > 0 and 1 producer.
//If work = 0 then the task queue is supposed to be near empty most of the time.
executor = new SpinExecutorService(Math.min(1024, burstLength * 4));
executorToShutdown = executor;
break;
case defaultEventExecutor:
executor = new DefaultEventExecutor();
executorToShutdown = executor;
break;
case juc:
executor = Executors.newSingleThreadScheduledExecutor();
executorToShutdown = executor;
break;
case nioEventLoop:
NioEventLoopGroup nioEventLoopGroup = new NioEventLoopGroup(1);
nioEventLoopGroup.setIoRatio(1);
executor = nioEventLoopGroup.next();
executorToShutdown = nioEventLoopGroup;
break;
case epollEventLoop:
Epoll.ensureAvailability();
EpollEventLoopGroup epollEventLoopGroup = new EpollEventLoopGroup(1);
epollEventLoopGroup.setIoRatio(1);
executor = epollEventLoopGroup.next();
executorToShutdown = epollEventLoopGroup;
break;
case kqueueEventLoop:
KQueue.ensureAvailability();
KQueueEventLoopGroup kQueueEventLoopGroup = new KQueueEventLoopGroup(1);
kQueueEventLoopGroup.setIoRatio(1);
executor = kQueueEventLoopGroup.next();
executorToShutdown = kQueueEventLoopGroup;
break;
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does setup() do?
setup() is a function in the netty codebase, defined in microbench/src/main/java/io/netty/microbench/concurrent/BurstCostExecutorsBenchmark.java.
Where is setup() defined?
setup() is defined in microbench/src/main/java/io/netty/microbench/concurrent/BurstCostExecutorsBenchmark.java at line 187.
What does setup() call?
setup() calls 2 function(s): SpinExecutorService, setup.
What calls setup()?
setup() is called by 1 function(s): setup.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free