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

[META] Implement Extension Points #315

Open
7 of 69 tasks
dbwiddis opened this issue Jan 10, 2023 · 5 comments
Open
7 of 69 tasks

[META] Implement Extension Points #315

dbwiddis opened this issue Jan 10, 2023 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed Meta

Comments

@dbwiddis
Copy link
Member

dbwiddis commented Jan 10, 2023

This issue is created to track Extension Point implementation.

  • Unchecked boxes are not implemented at all.
  • Checked boxes have at least a partial implementation complete which addresses the most important use cases; some may need additional work for completeness, which will be identified by a linked issue.
  • Extension points highlighted in bold are a priority as they are required for plugin migration

Not all extension points will need to be implemented for Extensions, and will be removed from the list when that determination is made.

The general approach to implementation is:

  1. Create a FooExtension interface corresponding to the FooPlugin interface, with the same default implementations.
  2. During initialization, communicate which interfaces an Extension implements to OpenSearch
  3. Review existing functionality, usually implemented in the Node class that runs on OpenSearch bootstrap, where a module iterates over plugins implementing a particular interface and and "registers" the implemented extensions points, adding them to maps/lists, etc.
  4. Determine whether functionality is primarily local to the extension (the easy case) or integral to OpenSearch (which requires serializing and deserializing via Writable interface) and implement appropriately. For example:
    • NamedXContent is local to an extension. The static initializers from OpenSearch are created and no transport communication actually happens.
    • RestHandlers are integrated with the OpenSearch RestController. The handled methods and paths must be communicated over transport to OpenSearch to be registered. This is done using Strings.
    • Settings are integrated with OpenSearch. The settings must be turned into a Writeable object to be sent over transport, and re-created on the other end. This is done using the WriteableSetting class.

Extension Points applicable to all plugins are defined in the Plugin interface:

The following interfaces also implement custom functionality:

  • ActionPlugin

    • getActions (Implemented locally on an Extension but not yet registered in ActionModule, see GetActions: Add support to dynamically register actions #107)
    • getClientActions
    • getActionFilters
    • getRestHandlers
    • getRestHeaders
    • getTaskHeaders
    • getRestHandlerWrapper
    • mappingRequestValidators
    • indicesAliasesRequestValidators
  • AnalysisPlugin

    • getCharFilters
    • getTokenFilters
    • getTokenizers
    • getAnalyzers
    • getPreBuiltAnalyzerProviderFactories
    • getPreConfiguredCharFilters
    • getPreConfiguredTokenFilters
    • getPreConfiguredTokenizers
    • getHunspellDictionaries
  • CircuitBreakerPlugin

    • getCircuitBreaker
    • setCircuitBreaker
  • EnginePlugin

    • getEngineFactory
    • getCustomCodecServiceFactory
    • getCustomTranslogDeletionPolicyFactory
  • ExtensiblePlugin

    • loadExtensions
  • IndexStorePlugin

    • getDirectoryFactories
    • getRecoveryStateFactories
  • IngestPlugin

    • getProcessors
  • MapperPlugin

    • getMappers
    • getMetadataMappers
    • getFieldFilter
  • PersistentTaskPlugin

    • getPersistentTasksExecutor
  • RepositoryPlugin

    • getRepositories
    • getInternalRepositories
  • ReloadablePlugin

    • reload
  • ScriptPlugin

    • getScriptEngine
    • getContexts
  • SearchPlugin

    • getScoreFunctions
    • getSignificanceHeuristics
    • getMovingAverageModels
    • getFetchSubPhases
    • getSearchExts
    • getHighlighters
    • getSuggesters
    • getQueries
    • getSorts
    • getAggregations
    • getAggregationExtentions
    • getCompositeAggregations
    • getPipelineAggregations
    • getRescorers
    • getQueryPhaseSearcher
    • getIndexSearcherExecutorProvider
  • SystemIndexPlugin

    • getSystemIndexDescriptors
@dbwiddis dbwiddis added enhancement New feature or request help wanted Extra attention is needed Meta labels Jan 10, 2023
@dbwiddis
Copy link
Member Author

dbwiddis commented Jan 10, 2023

We don't have a create components method, and instead are directly implementing the required components. Some are associated with other extension points.

The following are part of createComponents and are significant enough to be tracked separately as part of that extension point:

  • Client (We have SDKClient which provides this access)
  • ClusterService
  • ThreadPool (Not needed for now but will be needed for in-process)
  • ResourceWatcherService
  • ScriptService
  • NamedXContentRegistry
  • Environment
  • NodeEnvironment
  • NamedWriteableRegistry
  • IndexNameExpressionResolver
  • Supplier<RepositoriesService>

Extensions which interact with Job Scheduler will need JobSchedulerExtension extension points. These are being implemented in the job-scheduler repository.

  • getJobType
  • getJobIndex
  • getJobRunner
  • getJobParser

@dbwiddis
Copy link
Member Author

dbwiddis commented Jan 10, 2023

The following plugins may not be relevant for extensions. They are documented here for completeness:

  • ClusterPlugin

    • createAllocationDeciders
    • getShardsAllocators
    • getExistingShardsAllocators
    • onNodeStarted
  • DiscoveryPlugin

    • getCustomNameResolver
    • getSeedHostProviders
    • getJoinValidator
    • getElectionStrategies
  • NetworkPlugin

    • getTransportInterceptors
    • getTransports
    • getHttpTransports

@minalsha
Copy link
Collaborator

@dbwiddis why are #315 (comment) not relevant for extensions?

@dbwiddis
Copy link
Member Author

why are #315 (comment) not relevant for extensions?

@minalsha I used the qualifier "may not be relevant". I'd appreciate another set of eyes on this (@saratvemulapalli).

  • ClusterPlugin directly deals with shards on the Opensearch cluster and I don't think that's something we're directly handling on the Extension side
  • DiscoveryPlugin is also an OpenSearch cluster feature dealing with nodes joining, which to elect manager, etc.
  • NetworkPlugin deals with the transport later comms inside OpenSearch, but we are using Rest comms for extensions so they shouldn't be relevant.

@minalsha
Copy link
Collaborator

minalsha commented Jan 17, 2023

List of prioritized and ranked Extension Points, we want to go after are as follows:

  • AnalysisPlugin

    • getTokenFilters
    • getTokenizers
    • getAnalyzers
    • getCharFilters
  • Plugin

    • createComponents
    • getSettings
    • getNamedXContent
    • getExecutorBuilders
    • onIndexModule
    • close
    • getGuiceServiceClasses
    • getNamedWriteables
  • ActionPlugin

    • getActionFilters
    • getRestHandlers
    • getActions
  • ReloadablePlugin

    • reload
  • RepositoryPlugin

    • getRepositories
  • MapperPlugin

    • getMappers
  • IngestPlugin

    • getProcessors
  • ExtensiblePlugin

    • loadExtensions
  • ScriptPlugin

    • getScriptEngine
  • SystemIndexPlugin

    • getSystemIndexDescriptors
  • Extensions which interact with Job Scheduler will need JobSchedulerExtension extension points. These are being implemented in the job-scheduler repository.

    • getJobType
    • getJobIndex
    • getJobRunner
    • getJobParser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed Meta
Projects
None yet
Development

No branches or pull requests

2 participants