|
42 | 42 | import org.apache.logging.log4j.LogManager;
|
43 | 43 | import org.apache.logging.log4j.Logger;
|
44 | 44 | import org.opensearch.SpecialPermission;
|
45 |
| -import org.opensearch.accesscontrol.resources.ResourceService; |
46 | 45 | import org.opensearch.action.ActionRequest;
|
47 | 46 | import org.opensearch.ad.ADJobProcessor;
|
48 | 47 | import org.opensearch.ad.ADTaskProfileRunner;
|
|
162 | 161 | import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
|
163 | 162 | import org.opensearch.cluster.node.DiscoveryNodes;
|
164 | 163 | import org.opensearch.cluster.service.ClusterService;
|
165 |
| -import org.opensearch.common.inject.Inject; |
166 |
| -import org.opensearch.common.lifecycle.Lifecycle; |
167 |
| -import org.opensearch.common.lifecycle.LifecycleComponent; |
168 |
| -import org.opensearch.common.lifecycle.LifecycleListener; |
169 | 164 | import org.opensearch.common.settings.ClusterSettings;
|
170 | 165 | import org.opensearch.common.settings.IndexScopedSettings;
|
171 | 166 | import org.opensearch.common.settings.Setting;
|
|
277 | 272 | import org.opensearch.rest.RestController;
|
278 | 273 | import org.opensearch.rest.RestHandler;
|
279 | 274 | import org.opensearch.script.ScriptService;
|
| 275 | +import org.opensearch.security.spi.resources.ResourceSharingExtension; |
280 | 276 | import org.opensearch.threadpool.ExecutorBuilder;
|
281 | 277 | import org.opensearch.threadpool.ScalingExecutorBuilder;
|
282 | 278 | import org.opensearch.threadpool.ThreadPool;
|
|
293 | 289 | import org.opensearch.timeseries.function.ThrowingSupplierWrapper;
|
294 | 290 | import org.opensearch.timeseries.model.Job;
|
295 | 291 | import org.opensearch.timeseries.ratelimit.CheckPointMaintainRequestAdapter;
|
296 |
| -import org.opensearch.timeseries.rest.RestShareConfigAction; |
297 | 292 | import org.opensearch.timeseries.settings.TimeSeriesEnabledSetting;
|
298 | 293 | import org.opensearch.timeseries.settings.TimeSeriesSettings;
|
299 | 294 | import org.opensearch.timeseries.stats.StatNames;
|
|
303 | 298 | import org.opensearch.timeseries.stats.suppliers.SettableSupplier;
|
304 | 299 | import org.opensearch.timeseries.task.TaskCacheManager;
|
305 | 300 | import org.opensearch.timeseries.transport.CronTransportAction;
|
306 |
| -import org.opensearch.timeseries.transport.ShareConfigAction; |
307 |
| -import org.opensearch.timeseries.transport.ShareConfigTransportAction; |
308 | 301 | import org.opensearch.timeseries.transport.handler.ResultBulkIndexingHandler;
|
309 | 302 | import org.opensearch.timeseries.util.ClientUtil;
|
310 | 303 | import org.opensearch.timeseries.util.DiscoveryNodeFilterer;
|
@@ -338,7 +331,7 @@ public class TimeSeriesAnalyticsPlugin extends Plugin
|
338 | 331 | ScriptPlugin,
|
339 | 332 | SystemIndexPlugin,
|
340 | 333 | JobSchedulerExtension,
|
341 |
| - ResourcePlugin { |
| 334 | + ResourceSharingExtension { |
342 | 335 |
|
343 | 336 | private static final Logger LOG = LogManager.getLogger(TimeSeriesAnalyticsPlugin.class);
|
344 | 337 |
|
@@ -442,9 +435,6 @@ public List<RestHandler> getRestHandlers(
|
442 | 435 | RestValidateForecasterAction validateForecasterAction = new RestValidateForecasterAction(settings, clusterService);
|
443 | 436 | RestForecasterSuggestAction suggestForecasterParamAction = new RestForecasterSuggestAction(settings, clusterService);
|
444 | 437 |
|
445 |
| - // Config sharing and access control |
446 |
| - RestShareConfigAction restShareConfigAction = new RestShareConfigAction(); |
447 |
| - |
448 | 438 | ForecastJobProcessor forecastJobRunner = ForecastJobProcessor.getInstance();
|
449 | 439 | forecastJobRunner.setClient(client);
|
450 | 440 | forecastJobRunner.setThreadPool(threadPool);
|
@@ -484,9 +474,7 @@ public List<RestHandler> getRestHandlers(
|
484 | 474 | statsForecasterAction,
|
485 | 475 | runOnceForecasterAction,
|
486 | 476 | validateForecasterAction,
|
487 |
| - suggestForecasterParamAction, |
488 |
| - // Config sharing and access control |
489 |
| - restShareConfigAction |
| 477 | + suggestForecasterParamAction |
490 | 478 | );
|
491 | 479 | }
|
492 | 480 |
|
@@ -1719,8 +1707,7 @@ public List<NamedXContentRegistry.Entry> getNamedXContent() {
|
1719 | 1707 | new ActionHandler<>(ForecastRunOnceAction.INSTANCE, ForecastRunOnceTransportAction.class),
|
1720 | 1708 | new ActionHandler<>(ForecastRunOnceProfileAction.INSTANCE, ForecastRunOnceProfileTransportAction.class),
|
1721 | 1709 | new ActionHandler<>(ValidateForecasterAction.INSTANCE, ValidateForecasterTransportAction.class),
|
1722 |
| - new ActionHandler<>(SuggestForecasterParamAction.INSTANCE, SuggestForecasterParamTransportAction.class), |
1723 |
| - new ActionHandler<>(ShareConfigAction.INSTANCE, ShareConfigTransportAction.class) |
| 1710 | + new ActionHandler<>(SuggestForecasterParamAction.INSTANCE, SuggestForecasterParamTransportAction.class) |
1724 | 1711 | );
|
1725 | 1712 | }
|
1726 | 1713 |
|
@@ -1785,46 +1772,4 @@ public String getResourceType() {
|
1785 | 1772 | public String getResourceIndex() {
|
1786 | 1773 | return CommonName.CONFIG_INDEX;
|
1787 | 1774 | }
|
1788 |
| - |
1789 |
| - @Override |
1790 |
| - public Collection<Class<? extends LifecycleComponent>> getGuiceServiceClasses() { |
1791 |
| - final List<Class<? extends LifecycleComponent>> services = new ArrayList<>(1); |
1792 |
| - services.add(GuiceHolder.class); |
1793 |
| - return services; |
1794 |
| - } |
1795 |
| - |
1796 |
| - public static class GuiceHolder implements LifecycleComponent { |
1797 |
| - |
1798 |
| - private static ResourceService resourceService; |
1799 |
| - |
1800 |
| - @Inject |
1801 |
| - public GuiceHolder(final ResourceService resourceService) { |
1802 |
| - GuiceHolder.resourceService = resourceService; |
1803 |
| - } |
1804 |
| - |
1805 |
| - public static ResourceService getResourceService() { |
1806 |
| - return resourceService; |
1807 |
| - } |
1808 |
| - |
1809 |
| - @Override |
1810 |
| - public void close() {} |
1811 |
| - |
1812 |
| - @Override |
1813 |
| - public Lifecycle.State lifecycleState() { |
1814 |
| - return null; |
1815 |
| - } |
1816 |
| - |
1817 |
| - @Override |
1818 |
| - public void addLifecycleListener(LifecycleListener listener) {} |
1819 |
| - |
1820 |
| - @Override |
1821 |
| - public void removeLifecycleListener(LifecycleListener listener) {} |
1822 |
| - |
1823 |
| - @Override |
1824 |
| - public void start() {} |
1825 |
| - |
1826 |
| - @Override |
1827 |
| - public void stop() {} |
1828 |
| - |
1829 |
| - } |
1830 | 1775 | }
|
0 commit comments