apache / helix

Mirror of Apache Helix
Apache License 2.0
466 stars 227 forks source link

Gateway - Add GatewayCurrentStateCache for gateway service #2895

Closed xyuanlu closed 2 months ago

xyuanlu commented 2 months ago

Issues

2821

Description

This pull request introduces a caching mechanism for the Helix Gateway service. The main changes include:

  1. Addition of a new GatewayCurrentStateCache class in GatewayCurrentStateCache.java, which manages caching of current and target states for instances in a cluster.

  2. Modification of GatewayServiceManager.java to incorporate the new caching functionality:

    • A new _currentStateCacheMap is added to store GatewayCurrentStateCache objects for each cluster.
    • A new method getCurrentStateCache(String clusterName) is introduced to retrieve or create a cache for a given cluster.

Test

A new test class TestGatewayCurrentStateCache.java has been added with the following tests:

Changes that Break Backward Compatibility

N/A

Documentation

N/A

Created with Palmier

xyuanlu commented 2 months ago

This change is ready to be merged. Approved by @junkaixue Commit message: Gateway - Add GatewayCurrentStateCache for gateway

This pull request introduces a caching mechanism for the Helix Gateway service. The main changes include:

Addition of a new GatewayCurrentStateCache class in GatewayCurrentStateCache.java, which manages caching of current and target states for instances in a cluster.