• zhenwei pi's avatar
    Use connection name of string · 45617385
    zhenwei pi authored
    
    
    Suggested by Oran, use an array to store all the connection types
    instead of a linked list, and use connection name of string. The index
    of a connection is dynamically allocated.
    
    Currently we support max 8 connection types, include:
    - tcp
    - unix socket
    - tls
    
    and RDMA is in the plan, then we have another 4 types to support, it
    should be enough in a long time.
    
    Introduce 3 functions to get connection type by a fast path:
    - connectionTypeTcp()
    - connectionTypeTls()
    - connectionTypeUnix()
    
    Note that connectionByType() is designed to use only in unlikely code path.
    Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
    45617385
cluster.c 280 KB