* Rename: MetricsLeapArray -> BucketLeapArray
* Add implementation for `FutureBucketLeapArray`, a kind of `BucketLeapArray` that only reserves for future buckets, which is used for calculating occupied future tokens.
* Add OccupiableBucketLeapArray that combines common BucketLeapArray with FutureBucketLeapArray. The rollingNumberInSecond in StatisticNode now uses OccupiableBucketLeapArray by default.
* Add OccupySupport interface. Node now implements OccupySupport interface.
* Add occupy-related methods in Metric and ArrayMetric.
* Handle prioritized requests in default traffic shaping controller.
* Update default occupyTimeout to 500ms
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
* Add a ApiCommandHandler which fetch all registered CommandHandlers so that user can get all available CommandHandlers by request /api
* Add a customized CommandHandler demo
- The NPE will occur when multiple threads are trying to create the connection group for the same namespace
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Refactor token client common config and assign config
- Log enhancement when transport to token server failed
- Add `getState` method to `ClusterTokenClient` interface
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add `UnaryLeapArray` and `RequestLimiter` to enable simple QPS limit
- Improve cluster rule manager and server config manager to support request limiter
- Support `TOO_MANY_REQUEST` status in client side
- Also improve the automatic namespace register of embedded server mode
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add a `@RequestType` annotation for common use (e.g. request handler, encoder or decoder)
- Add a registry for universal config supplier (e.g. namespace of client)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
- Add a `ClusterTransportClient` for transport abstraction of Sentinel cluster
- Add universal request/response interface and common ClusterRequest/ClusterResponse abstraction
- Add common request/response data entity
- Add basic abstraction of codec (EntityWriter and EntityDecoder)
Signed-off-by: Eric Zhao <sczyh16@gmail.com>