Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring NodeStateManager etc. to support forecasting functionality #965

Merged
merged 3 commits into from
Jul 27, 2023

Commits on Jul 20, 2023

  1. Refactoring NodeStateManager etc. to support forecasting functionality

    This commit extends the codebase to support both Anomaly Detection (AD) and forecasting. It contains a mixture of refactoring, renaming, removal of unused code, and package moving tasks. Here are the details:
    
    Refactoring:
    - `NodeStateManager.getAnomalyDetector` is now `getConfig`, with added functionality to fetch a Forecaster. The method comments are updated for clarity.
    - Existing methods (`getFeatureSamplesForPeriods`, `getColdStartSamplesForPeriods`, `createPreviewSearchRequest`, `getMinDataTime`) have been added in `SearchFeatureDao` to handle forecasting logic.
    - Adjusted `SecurityClientUtil` and `ParseUtils` to handle forecasting logic.
    - Cleaned up `NodeState` to differentiate state for AD and forecasting.
    
    Renaming:
    - `AnomalyDetectorJob` is renamed to `Job` to facilitate reuse for forecasting.
    - `NodeStateManager.getAnomalyDetectorJob` is renamed to `getJob`.
    - Certain settings in `AnomalyDetectorSettings` are renamed to reflect they are meant for the AD setting. They have been marked as deprecated and new settings are used in `TimeSeriesSettings` instead.
    - `IndexAnomalyDetectorJobActionHandler.getAnomalyDetectorJobForWrite` is renamed to `getJobForWrite`.
    - `ADSafeSecurityInjector` is renamed to `TimeSeriesSafeSecurityInjector`.
    
    Removing unused code:
    - Synchronous code in `ClientUtil`, `IndexUtils`, and `CheckpointDao` is removed.
    - The unused class `Throttler` is deleted.
    - Mapping file names are changed, and the code referencing these files is adjusted.
    
    Package moving:
    - Several classes (`ClientUtil`, `MultiResponsesDelegateActionListener`, `SafeSecurityInjector`, `SecurityUtil`, `ExceptionUtil`, `SearchFeatureDao`, `CleanState`, `ExpiringState`, `MaintenanceState`, `NodeState`, `SingleStreamModelIdMapper`, `BackPressureRouting`) are moved to the respective `org.opensearch.timeseries` packages.
    
    Miscellaneous:
    - Fixed compiler failures caused by changes in opensearch-project/OpenSearch#8730 by replacing `DoubleArrayList` with `java.util.ArrayList`.
    - Updates the Backwards Compatibility (bwc) version to align with the core's incremented bwc version as per [OpenSearch PR #8670](opensearch-project/OpenSearch#8670). This change prevents the issue described in [OpenSearch Issue #5076](opensearch-project/OpenSearch#5076).
    
    Testing:
    - Executed a `gradle build`.
    - Added new tests for `ClientUtil` and `NodeStateManager`.
    
    Signed-off-by: Kaituo Li <[email protected]>
    kaituo committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    d77fae9 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2023

  1. improve comment

    Signed-off-by: Kaituo Li <[email protected]>
    kaituo committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    9dddaa5 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2023

  1. fix compiler error and comments

    Signed-off-by: Kaituo Li <[email protected]>
    kaituo committed Jul 26, 2023
    Configuration menu
    Copy the full SHA
    50a5ff2 View commit details
    Browse the repository at this point in the history