Sentinel核心架构设计全景

整体架构 ┌────────────────────────────────────────┐ │ Sentinel Client │ ├────────────────────────────────────────┤ │ API Layer (SphU/SphO/Entry) │ ├────────────────────────────────────────┤ │ Slot Chain (责任链模式) │ │ ├─ NodeSelectorSlot │ │ ├─ ClusterBuilderSlot │ │ ├─ StatisticSlot │ │ ├─ AuthoritySlot │ │ ├─ SystemSlot │ │ ├─ FlowSlot │ │ └─ DegradeSlot │ ├────────────────────────────────────────┤ │ Metrics (滑动窗口统计) │ ├────────────────────────────────────────┤ │ Rule Manager (规则管理) │ └────────────────────────────────────────┘ 核心组件 1. Entry(资源入口) public abstract class Entry implements AutoCloseable { private final long createTime; private Node curNode; private Node originNode; private Throwable error; protected Entry(ResourceWrapper resourceWrapper, ProcessorSlot<Object> chain, Context context) { this.resourceWrapper = resourceWrapper; this.chain = chain; this.context = context; this.createTime = TimeUtil.currentTimeMillis(); } @Override public void close() { if (chain != null) { chain.exit(context, resourceWrapper, count, args); } } } 作用: ...

2025-11-20 · maneng

如约数科科技工作室

浙ICP备2025203501号

👀 本站总访问量 ...| 👤 访客数 ...| 📅 今日访问 ...