2022-1-29 Kitex学习笔记

过年没事,写写代码,最好能为开源项目贡献点东西,就选了kitex,字节的,打算之后跳槽到字节。

既然贡献代码,最好能选一个模块来专门仔细看,看了kitex的目录结构后就选了负载均衡模块。
顺便研究下一致性哈希的源码是怎么实现的。

代码里面,loadbalance模块好像最适合,代码不多不少,适合修修补补。


.
├── acl
│   ├── acl.go
│   └── acl_test.go
├── circuitbreak
│   ├── cbsuite.go
│   ├── cbsuite_test.go
│   ├── circuitbreak.go
│   ├── circuitbreak_test.go
│   ├── default.go
│   ├── default_test.go
│   └── doc.go
├── connpool
│   ├── config.go
│   └── config_test.go
├── consts
│   └── ctx.go
├── diagnosis
│   ├── interface.go
│   └── interface_test.go
├── discovery
│   ├── constants.go
│   ├── discovery.go
│   └── discovery_test.go
├── endpoint
│   ├── endpoint.go
│   └── endpoint_test.go
├── event
│   ├── bus.go
│   ├── bus_test.go
│   ├── event.go
│   ├── queue.go
│   └── queue_test.go
├── exception
│   ├── deprecated.go
│   └── deprecated_test.go
├── generic
│   ├── binary_test
│   │   ├── generic_init.go
│   │   └── generic_test.go
│   ├── binarythrift_codec.go
│   ├── descriptor
│   │   ├── annotation.go
│   │   ├── descriptor.go
│   │   ├── field_mapping.go
│   │   ├── field_mapping_test.go
│   │   ├── http.go
│   │   ├── http_mapping.go
│   │   ├── route.go
│   │   ├── router.go
│   │   ├── tree.go
│   │   ├── tree_test.go
│   │   ├── type.go
│   │   ├── util.go
│   │   ├── value_mapping.go
│   │   └── value_mapping_test.go
│   ├── descriptor_provider.go
│   ├── generic.go
│   ├── generic_service.go
│   ├── httpthrift_codec.go
│   ├── httpthrift_codec_test.go
│   ├── json_test
│   │   ├── conf
│   │   │   └── kitex.yml
│   │   ├── generic_init.go
│   │   ├── generic_test.go
│   │   └── idl
│   │       ├── base.thrift
│   │       ├── example_check_read_required.thrift
│   │       ├── example_check_write_required.thrift
│   │       ├── example.thrift
│   │       ├── mock.thrift
│   │       └── self_ref.thrift
│   ├── jsonthrift_codec.go
│   ├── map_test
│   │   ├── conf
│   │   │   └── kitex.yml
│   │   ├── generic_init.go
│   │   ├── generic_test.go
│   │   └── idl
│   │       ├── base.thrift
│   │       ├── example_check_read_required.thrift
│   │       ├── example_check_write_required.thrift
│   │       ├── example.thrift
│   │       ├── mock.thrift
│   │       └── self_ref.thrift
│   ├── mapthrift_codec.go
│   ├── thrift
│   │   ├── base.go
│   │   ├── http.go
│   │   ├── json.go
│   │   ├── parse.go
│   │   ├── parse_test.go
│   │   ├── read.go
│   │   ├── read_test.go
│   │   ├── struct.go
│   │   ├── thrift.go
│   │   ├── util.go
│   │   ├── util_test.go
│   │   ├── write.go
│   │   └── write_test.go
│   ├── thriftidl_provider.go
│   └── thriftidl_provider_test.go
├── gofunc
│   └── go.go
├── http
│   ├── resolver.go
│   └── resolver_test.go
├── kerrors
│   ├── kerrors.go
│   └── kerrors_test.go
├── klog
│   ├── default.go
│   └── log.go
├── limit
│   ├── limit.go
│   └── limit_test.go
├── limiter
│   ├── concurrency_limiter.go
│   ├── concurrency_limiter_test.go
│   ├── dummy.go
│   ├── limiter.go
│   ├── limiter_test.go
│   ├── qps_limiter.go
│   └── qps_limiter_test.go
├── loadbalance
│   ├── consist.go
│   ├── consist_test.go
│   ├── dummy_picker.go
│   ├── lbcache
│   │   ├── cache.go
│   │   ├── cache_test.go
│   │   ├── hookable.go
│   │   ├── hookable_test.go
│   │   └── shared_ticker.go
│   ├── loadbalancer.go
│   ├── weighted_random.go
│   └── weighted_random_test.go
├── protocol
│   └── bthrift
│       ├── binary.go
│       └── interface.go
├── proxy
│   └── proxy.go
├── registry
│   └── registry.go
├── remote
│   ├── bound
│   │   ├── limiter_inbound.go
│   │   └── transmeta_bound.go
│   ├── bytebuf.go
│   ├── codec
│   │   ├── bytebuf_util.go
│   │   ├── default_codec.go
│   │   ├── default_codec_test.go
│   │   ├── header_codec.go
│   │   ├── header_codec_test.go
│   │   ├── perrors
│   │   │   ├── protocol_error.go
│   │   │   └── protocol_error_test.go
│   │   ├── protobuf
│   │   │   ├── error.pb.go
│   │   │   ├── error.proto
│   │   │   ├── grpc.go
│   │   │   ├── pberror.go
│   │   │   ├── protobuf.go
│   │   │   ├── protobuf_test.go
│   │   │   ├── test.pb.go
│   │   │   └── test.proto
│   │   ├── thrift
│   │   │   ├── binary_protocol.go
│   │   │   ├── binary_protocol_test.go
│   │   │   ├── thrift.go
│   │   │   └── thrift_test.go
│   │   └── util.go
│   ├── codec.go
│   ├── compression.go
│   ├── connpool
│   │   ├── dummy.go
│   │   ├── long_pool.go
│   │   ├── long_pool_test.go
│   │   ├── reporter.go
│   │   ├── short_pool.go
│   │   ├── short_pool_test.go
│   │   └── utils.go
│   ├── connpool.go
│   ├── default_bytebuf.go
│   ├── default_bytebuf_test.go
│   ├── dialer.go
│   ├── doc.go
│   ├── message.go
│   ├── option.go
│   ├── payload_codec.go
│   ├── remotecli
│   │   ├── client.go
│   │   ├── conn_wrapper.go
│   │   ├── conn_wrapper_test.go
│   │   └── stream.go
│   ├── remotesvr
│   │   ├── server.go
│   │   └── server_test.go
│   ├── role.go
│   ├── trans
│   │   ├── common.go
│   │   ├── default_client_handler.go
│   │   ├── default_client_handler_test.go
│   │   ├── default_server_handler.go
│   │   ├── default_server_handler_test.go
│   │   ├── detection
│   │   │   ├── noop.go
│   │   │   └── server_handler.go
│   │   ├── invoke
│   │   │   ├── conn_extension.go
│   │   │   ├── conn_extension_test.go
│   │   │   ├── invoke.go
│   │   │   ├── invoke_handler.go
│   │   │   ├── invoke_handler_test.go
│   │   │   ├── message.go
│   │   │   └── message_test.go
│   │   ├── mocks_test.go
│   │   ├── netpoll
│   │   │   ├── bytebuf.go
│   │   │   ├── client_handler.go
│   │   │   ├── client_handler_test.go
│   │   │   ├── conn_extension.go
│   │   │   ├── dialer.go
│   │   │   ├── http_client.go
│   │   │   ├── http_client_handler.go
│   │   │   ├── http_client_handler_test.go
│   │   │   ├── mocks_test.go
│   │   │   ├── server_handler.go
│   │   │   ├── server_handler_test.go
│   │   │   ├── trans_server.go
│   │   │   └── trans_server_test.go
│   │   ├── netpollmux
│   │   │   ├── client_handler.go
│   │   │   ├── client_handler_test.go
│   │   │   ├── mocks_test.go
│   │   │   ├── mux_conn.go
│   │   │   ├── mux_pool.go
│   │   │   ├── mux_pool_test.go
│   │   │   ├── mux_transport.go
│   │   │   ├── mux_transport_test.go
│   │   │   ├── server_handler.go
│   │   │   ├── shared_map.go
│   │   │   ├── shared_map_test.go
│   │   │   ├── shared_queue.go
│   │   │   └── shared_queue_test.go
│   │   └── nphttp2
│   │       ├── buffer.go
│   │       ├── client_conn.go
│   │       ├── client_handler.go
│   │       ├── codes
│   │       │   └── codes.go
│   │       ├── codes.go
│   │       ├── conn_pool.go
│   │       ├── doc.go
│   │       ├── grpc
│   │       │   ├── bdp_estimator.go
│   │       │   ├── controlbuf.go
│   │       │   ├── defaults.go
│   │       │   ├── flowcontrol.go
│   │       │   ├── http2_client.go
│   │       │   ├── http2_server.go
│   │       │   ├── http_util.go
│   │       │   ├── keepalive.go
│   │       │   ├── log.go
│   │       │   └── transport.go
│   │       ├── metadata
│   │       │   └── metadata.go
│   │       ├── server_conn.go
│   │       ├── server_handler.go
│   │       ├── status
│   │       │   └── status.go
│   │       └── stream.go
│   ├── trans_errors.go
│   ├── trans_errors_test.go
│   ├── trans_handler.go
│   ├── transmeta
│   │   ├── http_metakey.go
│   │   └── metakey.go
│   ├── trans_meta.go
│   ├── trans_pipeline.go
│   └── trans_server.go
├── retry
│   ├── backup.go
│   ├── backup_retryer.go
│   ├── failure.go
│   ├── failure_retryer.go
│   ├── failure_test.go
│   ├── policy.go
│   ├── policy_test.go
│   ├── retryer.go
│   ├── retryer_test.go
│   └── util.go
├── rpcinfo
│   ├── basicinfo.go
│   ├── convert.go
│   ├── convert_test.go
│   ├── ctx.go
│   ├── ctx_test.go
│   ├── endpointInfo.go
│   ├── endpointInfo_test.go
│   ├── interface.go
│   ├── invocation.go
│   ├── invocation_test.go
│   ├── mocks_test.go
│   ├── mutable.go
│   ├── remoteinfo
│   │   ├── remoteInfo.go
│   │   └── remoteInfo_test.go
│   ├── rpcconfig.go
│   ├── rpcconfig_test.go
│   ├── rpcinfo.go
│   ├── rpcstats.go
│   └── rpcstats_test.go
├── rpctimeout
│   └── rpctimeout.go
├── serviceinfo
│   ├── serviceinfo.go
│   └── serviceinfo_test.go
├── stats
│   ├── event.go
│   ├── event_test.go
│   ├── status.go
│   └── tracer.go
├── streaming
│   └── streaming.go
├── transmeta
│   ├── http2.go
│   ├── http2_test.go
│   ├── metainfo.go
│   ├── metainfo_test.go
│   ├── ttheader.go
│   └── ttheader_test.go
└── utils
    ├── byte2str.go
    ├── byte2str_test.go
    ├── config.go
    ├── config_test.go
    ├── counter.go
    ├── counter_test.go
    ├── err_chain.go
    ├── err_chain_test.go
    ├── func.go
    ├── func_test.go
    ├── int_len.go
    ├── int_len_test.go
    ├── json.go
    ├── json_test.go
    ├── max_counter.go
    ├── max_counter_test.go
    ├── netaddr.go
    ├── netaddr_test.go
    ├── ring.go
    ├── ring_single.go
    ├── ring_test.go
    ├── rpcstats.go
    ├── slice.go
    ├── slice_test.go
    ├── strbuf.go
    ├── strbuf_test.go
    ├── thrift.go
    ├── thrift_test.go
    ├── yaml.go
    └── yaml_test.go

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值