* Add a ApiCommandHandler which fetch all registered CommandHandlers so that user can get all available CommandHandlers by request /api
* Add a customized CommandHandler demo
* Polish #272: upgrade nacos-client version and create a new constructor for NacosDataSource to support namespace, endpoint, ak, sk and so on
* check properties in NacosDataSource
- The constructor now accept `sampleCount` and `windowIntervalMs` so that it can match the two basic properties
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Update ParamFlowRule to support cluster mode
- Add `ParamFlowClusterConfig` to provide cluster mode items for the rule
- Update ParamFlowChecker to support cluster flow mode
- Extract ParamFlowRuleUtil class
- Change type of `flowId` from Integer to Long
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Update ParamFlowRule to support cluster mode
- Add `ParamFlowClusterConfig` to provide cluster mode items for the rule
- Update ParamFlowChecker to support cluster flow mode
- Extract ParamFlowRuleUtil class
- Change type of `flowId` from Integer to Long
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add callback registry for statistic slot for extensions.
- Add a new module `sentinel-parameter-flow-control` under `sentinel-extension`.
- Add a `CacheMap` interface to provide abstraction for cache. We use ConcurrentLinkedHashMap as the default implementation (LRU strategy)..
- Add a `ParameterMetric` class as frequent parameter metrics for a specific resource. The metric map is located in `ParamFlowSlot` rather than `ClusterNode`.
- Implement `ParameterLeapArray` as statistic data structure for frequent parameters in a period of time window.
- Add `ParamFlowSlot` as the checker slot; Add `ParamFlowChecker` to do rule checking; Add `ParamFlowRuleManager` to do rule managing.
- The statistic metrics for frequent parameters is enabled only if the related resource has configured parameter flow rule; Parameter metrics for removed rules will be cleared automatically.
- Leverage extensible `SlotChainBuilder` to provide a `HotParamSlotChainBuilder`.
- Add command handlers for hot param rules.
- Add test cases and demo.
- Add `close` method in WritableDataSource (to extend AutoCloseable in JDK 1.7 later)
- Separate the writable file data source from original class
- Add a sample to show how to register data sources via Sentinel init mechanism
- Separate a writable data source registry from original handler to make it clear
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Spilt DataSource into two types: ReadableDataSource and WritableDataSource
- The AbstractDataSource now is read-only
- Refactor the file data source for writable implementation
- Rename: ConfigParser -> Converter (represents both encoder `T -> S` and decoder `S -> T`)
- Some other refinement
Signed-off-by: Eric Zhao <sczyh16@gmail.com>