forked from opensearch-project/anomaly-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kaituo Li <[email protected]>
- Loading branch information
Showing
470 changed files
with
25,011 additions
and
14,141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.ad; | ||
|
||
import org.opensearch.ad.indices.ADIndex; | ||
import org.opensearch.ad.indices.ADIndexManagement; | ||
import org.opensearch.ad.model.ADTask; | ||
import org.opensearch.ad.model.ADTaskType; | ||
import org.opensearch.ad.model.AnomalyResult; | ||
import org.opensearch.ad.settings.AnomalyDetectorSettings; | ||
import org.opensearch.ad.task.ADTaskCacheManager; | ||
import org.opensearch.ad.task.ADTaskManager; | ||
import org.opensearch.ad.transport.AnomalyResultAction; | ||
import org.opensearch.ad.transport.AnomalyResultRequest; | ||
import org.opensearch.common.settings.Settings; | ||
import org.opensearch.timeseries.AnalysisType; | ||
import org.opensearch.timeseries.JobProcessor; | ||
import org.opensearch.timeseries.TimeSeriesAnalyticsPlugin; | ||
import org.opensearch.timeseries.transport.ResultRequest; | ||
|
||
public class ADJobProcessor extends | ||
JobProcessor<ADIndex, ADIndexManagement, ADTaskCacheManager, ADTaskType, ADTask, ADTaskManager, AnomalyResult, ExecuteADResultResponseRecorder> { | ||
|
||
private static ADJobProcessor INSTANCE; | ||
|
||
public static ADJobProcessor getInstance() { | ||
if (INSTANCE != null) { | ||
return INSTANCE; | ||
} | ||
synchronized (JobProcessor.class) { | ||
if (INSTANCE != null) { | ||
return INSTANCE; | ||
} | ||
INSTANCE = new ADJobProcessor(); | ||
return INSTANCE; | ||
} | ||
} | ||
|
||
private ADJobProcessor() { | ||
// Singleton class, use getJobRunnerInstance method instead of constructor | ||
super(AnalysisType.AD, TimeSeriesAnalyticsPlugin.AD_THREAD_POOL_NAME, AnomalyResultAction.INSTANCE); | ||
} | ||
|
||
public void registerSettings(Settings settings) { | ||
super.registerSettings(settings, AnomalyDetectorSettings.AD_MAX_RETRY_FOR_END_RUN_EXCEPTION); | ||
} | ||
|
||
@Override | ||
protected ResultRequest createResultRequest(String configId, long start, long end) { | ||
return new AnomalyResultRequest(configId, start, end); | ||
} | ||
} |
1,068 changes: 0 additions & 1,068 deletions
1,068
src/main/java/org/opensearch/ad/AnomalyDetectorPlugin.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.