Skip to content

Add Customized State View Aggregation Feature#963

Merged
jiajunwang merged 23 commits intoapache:masterfrom
zhangmeng916:customizeView
Apr 23, 2020
Merged

Add Customized State View Aggregation Feature#963
jiajunwang merged 23 commits intoapache:masterfrom
zhangmeng916:customizeView

Conversation

@zhangmeng916
Copy link
Contributor

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

(#728 )

Description

  • Here are some details about my PR, including screenshots of any UI changes:

This PR implements Helix customized state view aggregation feature. This feature allow Helix users to have their own defined states for each partition, provide them APIs to update the states when there's any change, and also help them aggregate the customized states into a customized view similar to existing external view. Finally, users could get the aggregated view from routing table provider.

Tests

  • The following tests are written for this issue:

(List the names of added unit/integration tests)

  • The following is the result of the "mvn test" command on the appropriate module:
    TestCustomizedStateUpdate
    TestCustomizedStateComputationStage
    TestCustomizedViewStage
    TestComputeAndCleanupCustomizedView
    TestCustomizedViewAggregation

[WARNING] Tests run: 1144, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 4,645.631 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 1144, Failures: 0, Errors: 0, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:17 h
[INFO] Finished at: 2020-04-23T12:02:40-07:00

helix-rest: (known issues, will be fixed in the following PRs)

[ERROR] Failures:
[ERROR] TestZkRoutingDataReader.testGetRoutingData:81 » ZkMarshalling java.io.NotSeria...
[ERROR] TestZkRoutingDataWriter.testAddMetadataStoreRealm:87 » ZkMarshalling java.io.S...
[INFO]
[ERROR] Tests run: 159, Failures: 2, Errors: 0, Skipped: 11
[INFO]

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

Ali Reza Zamani Zadeh Najari and others added 23 commits April 23, 2020 10:11
This commit contains the bare minimum properties for CustomizedView Helix property.
Add CustomizedViewAggregation as a cluster level config. This config defines the types of customized states that will be aggregated by Helix controller to generate a customized view. If Helix customers would like to have an aggregated view generated for their own states, they will need to add the type of the state to the list view in this config.
…e#792)

In this commit the below APIs have been added.
1- addCustomizedStateAggregationConfig
2- removeCustomizedStateAggregationConfig.
3- addTypeToCustomizedStateAggregationConfig
4- removeTypeFromCustomizedStateAggregationConfig
Tests have been added to check the functionality of these APIs.
…ig (apache#797)

In this commit the below REST APIs have been added.
1- addCustomizedStateAggregationConfig
2- removeCustomizedStateAggregationConfig
3- getCustomizedStateAggregationConfig
4- updateCustomizedStateAggregationConfig
Tests have been added to check the functionality of these REST APIs.
Also some of the depricated calls have been updated.
Implement Helix APIs in CustomizedStateProvider for customers to operate on their own customized state. The available operations include update, get, and delete. To use CustomizedStateProvider, Helix user should initialize its factory and pass required parameters.
…apache#814)

This commit contains the basic functionalities for
CustomizedView RoutingTableProvider.

Here are the new added functionalities:
1- CustomizedViewChangeListener
2- Addition of CustomizedView to helix PropertyType and PropertyKey
3- Implementation of CustomizedView cache.
4- Registering CallbackHandler for CustomizedView.
Add listeners for customized state and customized state aggregation config in Helix managers
Add tests to make CustomizedStateProvider tests comprehensive.
1. Implement a participant state cache for generalizing functions in both current state cache and customized state cache.
2. Implement an intermediate data structure to store the result of customized state computation and prepare the data to be the format that can be used by customized view computation later.
…pache#885)

Rename customized state aggregation config to customized state config for future extendibility.

Co-authored-by: Meng Zhang <mnzhang@mnzhang-mn1.linkedin.biz>
…e#859)

Currently the update customized state method is made synchronized for concurrency control. This commit modifies the implementation of update to leave the responsibility of concurrency control to ZooKeeper by using updater to update the customize state. With delete method already implemented with updater, we can prevent unexpected change of the customize state data.
Update some cache functions for customized view aggregation
1. One stage is the computation stage for customized state. It takes the Zookeeper data of customized states and converts them to the formatted output used by the other stage.
2. The other stage is customized view aggregation stage. It will take the output from the customized state computation stage, and output the customized view to Zookeeper.
3. The two stages together compute the customized view from the customized states.
4. Unit tests are added to verify the correctness of the two stages.
In this commit, the routing table provider has been changed in a way to include customized view feature.
…ation. (apache#851)

Add extra stages and pipelines in controller for customized state computation and customized view aggregation.
Add refresh logic in resource data provider for customized view related data refresh.
Add customized state event handling in CallbackHandler.
Add integration test for customized view aggregation.
Modify existing tests to verify new logic.

Co-authored-by: Meng Zhang <mnzhang@mnzhang-mn1.linkedin.biz>
Fix minor issues in customized view aggregation logic and add some more tests.

Co-authored-by: Meng Zhang <mnzhang@mnzhang-mn1.linkedin.biz>
In this commit, the custom implementation of customized view cache
has been replaced with property cache implementation.
The integration test involves components: update customized state using customized view provider, and use routing table provider to get customized view snapshots which are aggregated in controller.
Modify customized state provider factory. The new factory can build a customized state provider with either Helix own manager or a customer input manager.
)

Add customized view cache update in customized view aggregation stage. This is to ensure that the cache does not have stale data
In this commit, a new logic is added which target the scenario where user
disables and enables specific types. In this case, since the CustomizedView
path for that type is removed by the controller, the router looses its
listener. In this commit, we added root change lister and re-registers the
listens again.
This PR moves the initialization of routing table provider to before class so it is initialized before any updates. Also, added several checks into the validation method to cover some edge cases.
@jiajunwang jiajunwang merged commit 4c65bfc into apache:master Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants