Home / Function/ setup() — netty Function Reference

setup() — netty Function Reference

Architecture documentation for the setup() function in RedisEncoderBenchmark.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4a89d274_66a6_c1a0_3405_ea0979fcc7cc["setup()"]
  c0bad0b8_2a8e_1783_0199_88c007f3f64d["RedisEncoderBenchmark"]
  4a89d274_66a6_c1a0_3405_ea0979fcc7cc -->|defined in| c0bad0b8_2a8e_1783_0199_88c007f3f64d
  style 4a89d274_66a6_c1a0_3405_ea0979fcc7cc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

microbench/src/main/java/io/netty/microbench/redis/RedisEncoderBenchmark.java lines 65–85

    @Setup(Level.Trial)
    public void setup() {
        byte[] bytes = new byte[256];
        content = Unpooled.buffer(bytes.length);
        content.writeBytes(bytes);
        ByteBuf testContent = Unpooled.unreleasableBuffer(content.asReadOnly());

        List<RedisMessage> rList = new ArrayList<RedisMessage>(arraySize);
        for (int i = 0; i < arraySize; ++i) {
            rList.add(new FullBulkStringRedisMessage(testContent));
        }
        redisArray = new ArrayRedisMessage(rList);
        encoder = new RedisEncoder();
        context = new EmbeddedChannelWriteReleaseHandlerContext(pooledAllocator ? PooledByteBufAllocator.DEFAULT :
                UnpooledByteBufAllocator.DEFAULT, encoder) {
            @Override
            protected void handleException(Throwable t) {
                handleUnexpectedException(t);
            }
        };
    }

Domain

Subdomains

Frequently Asked Questions

What does setup() do?
setup() is a function in the netty codebase, defined in microbench/src/main/java/io/netty/microbench/redis/RedisEncoderBenchmark.java.
Where is setup() defined?
setup() is defined in microbench/src/main/java/io/netty/microbench/redis/RedisEncoderBenchmark.java at line 65.

Analyze Your Own Codebase

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

Try Supermodel Free