Home / Class/ Processor Class — netty Architecture

Processor Class — netty Architecture

Architecture documentation for the Processor class in AhoCorasicSearchProcessorFactory.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f283d224_e0fa_dd22_80d9_a9cc4926be51["Processor"]
  06ec8640_ebce_33c6_030a_e7db36482963["AhoCorasicSearchProcessorFactory.java"]
  f283d224_e0fa_dd22_80d9_a9cc4926be51 -->|defined in| 06ec8640_ebce_33c6_030a_e7db36482963
  0e9f52c1_c93f_14f2_d8ad_b68dbe3b0809["Processor()"]
  f283d224_e0fa_dd22_80d9_a9cc4926be51 -->|method| 0e9f52c1_c93f_14f2_d8ad_b68dbe3b0809
  1a86e7e0_63b3_4818_a926_1e3bf088c3ec["process()"]
  f283d224_e0fa_dd22_80d9_a9cc4926be51 -->|method| 1a86e7e0_63b3_4818_a926_1e3bf088c3ec
  89e35f6b_cb74_d122_070d_4eeadea375c1["getFoundNeedleId()"]
  f283d224_e0fa_dd22_80d9_a9cc4926be51 -->|method| 89e35f6b_cb74_d122_070d_4eeadea375c1
  fd704428_15b4_01ba_215c_cacdea6dbea9["reset()"]
  f283d224_e0fa_dd22_80d9_a9cc4926be51 -->|method| fd704428_15b4_01ba_215c_cacdea6dbea9

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/search/AhoCorasicSearchProcessorFactory.java lines 46–76

    public static class Processor implements MultiSearchProcessor {

        private final int[] jumpTable;
        private final int[] matchForNeedleId;
        private long currentPosition;

        Processor(int[] jumpTable, int[] matchForNeedleId) {
            this.jumpTable = jumpTable;
            this.matchForNeedleId = matchForNeedleId;
        }

        @Override
        public boolean process(byte value) {
            currentPosition = PlatformDependent.getInt(jumpTable, currentPosition | (value & 0xffL));
            if (currentPosition < 0) {
                currentPosition = -currentPosition;
                return false;
            }
            return true;
        }

        @Override
        public int getFoundNeedleId() {
            return matchForNeedleId[(int) currentPosition >> AhoCorasicSearchProcessorFactory.BITS_PER_SYMBOL];
        }

        @Override
        public void reset() {
            currentPosition = 0;
        }
    }

Frequently Asked Questions

What is the Processor class?
Processor is a class in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/search/AhoCorasicSearchProcessorFactory.java.
Where is Processor defined?
Processor is defined in buffer/src/main/java/io/netty/buffer/search/AhoCorasicSearchProcessorFactory.java at line 46.

Analyze Your Own Codebase

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

Try Supermodel Free