Home / Function/ Environment() — netty Function Reference

Environment() — netty Function Reference

Architecture documentation for the Environment() function in IntObjectHashMapBenchmark.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  32f3085c_21da_1b3c_610e_6897273b9bd8["Environment()"]
  82a35403_7c2b_d103_4c1a_9dc614e8bbba["Environment"]
  32f3085c_21da_1b3c_610e_6897273b9bd8 -->|defined in| 82a35403_7c2b_d103_4c1a_9dc614e8bbba
  style 32f3085c_21da_1b3c_610e_6897273b9bd8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

microbench/src/main/java/io/netty/microbenchmark/common/IntObjectHashMapBenchmark.java lines 93–119

        Environment() {
            keys = new int[size];
            switch(keyDistribution) {
                case HTTP2:
                    for (int index = 0, key = 3; index < size; ++index, key += 2) {
                        keys[index] = key;
                    }
                    break;
                case RANDOM: {
                    // Create a 'size' # of random integers.
                    Random r = new Random();
                    Set<Integer> keySet = new HashSet<Integer>();
                    while (keySet.size() < size) {
                        keySet.add(r.nextInt());
                    }

                    int index = 0;
                    for (Integer key : keySet) {
                        keys[index++] = key;
                    }
                    break;
                }
                default: {
                    throw new IllegalStateException("Unknown keyDistribution: " + keyDistribution);
                }
            }
        }

Domain

Subdomains

Frequently Asked Questions

What does Environment() do?
Environment() is a function in the netty codebase, defined in microbench/src/main/java/io/netty/microbenchmark/common/IntObjectHashMapBenchmark.java.
Where is Environment() defined?
Environment() is defined in microbench/src/main/java/io/netty/microbenchmark/common/IntObjectHashMapBenchmark.java at line 93.

Analyze Your Own Codebase

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

Try Supermodel Free