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
447 changed files
with
24,019 additions
and
13,646 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); | ||
} | ||
} |
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.