Home / Function/ testOrdering() — netty Function Reference

testOrdering() — netty Function Reference

Architecture documentation for the testOrdering() function in NonStickyEventExecutorGroupTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a5a7ef77_49a5_2174_475c_896e0d12611b["testOrdering()"]
  d2c2f535_6e38_2696_75d2_7afac99b078a["NonStickyEventExecutorGroupTest"]
  a5a7ef77_49a5_2174_475c_896e0d12611b -->|defined in| d2c2f535_6e38_2696_75d2_7afac99b078a
  d369a955_11b2_c7ca_40f7_c70d0810e451["execute()"]
  a5a7ef77_49a5_2174_475c_896e0d12611b -->|calls| d369a955_11b2_c7ca_40f7_c70d0810e451
  style a5a7ef77_49a5_2174_475c_896e0d12611b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/test/java/io/netty/util/concurrent/NonStickyEventExecutorGroupTest.java lines 68–104

    @ParameterizedTest(name = PARAMETERIZED_NAME)
    @MethodSource("data")
    @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS)
    public void testOrdering(int maxTaskExecutePerRun) throws Throwable {
        final int threads = NettyRuntime.availableProcessors() * 2;
        final EventExecutorGroup group = new UnorderedThreadPoolEventExecutor(threads);
        final NonStickyEventExecutorGroup nonStickyGroup = new NonStickyEventExecutorGroup(group, maxTaskExecutePerRun);
        try {
            final CountDownLatch startLatch = new CountDownLatch(1);
            final AtomicReference<Throwable> error = new AtomicReference<Throwable>();
            List<Thread> threadList = new ArrayList<Thread>(threads);
            for (int i = 0 ; i < threads; i++) {
                Thread thread = new Thread(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            execute(nonStickyGroup, startLatch);
                        } catch (Throwable cause) {
                            error.compareAndSet(null, cause);
                        }
                    }
                });
                threadList.add(thread);
                thread.start();
            }
            startLatch.countDown();
            for (Thread t: threadList) {
                t.join();
            }
            Throwable cause = error.get();
            if (cause != null) {
                throw cause;
            }
        } finally {
            nonStickyGroup.shutdownGracefully();
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testOrdering() do?
testOrdering() is a function in the netty codebase, defined in common/src/test/java/io/netty/util/concurrent/NonStickyEventExecutorGroupTest.java.
Where is testOrdering() defined?
testOrdering() is defined in common/src/test/java/io/netty/util/concurrent/NonStickyEventExecutorGroupTest.java at line 68.
What does testOrdering() call?
testOrdering() calls 1 function(s): execute.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free