Skip to content

[META] Migrate to elasticsearch StableAPI #158

@yaauie

Description

@yaauie

In Elasticsearch core we introduced StableAPIBridge so that Logstash can rely on unchanging code (elastic/elasticsearch#108171), but we need to migrate to the stable wrappers to gain the benefit and stabilize our reliance on Elasticsearch internals.

Number of sequential tasks:

  • Elasticsearch scope: evaluate current status of Stable API based on plugin usage

    • introduce bridge API for ProjectId: it recently came into play (with this change)
    • introduce bridge API for org.elasticsearch.core.Releasable (used by IntegrationBatch.java): it seems it was missed
    • introduce bridge API for org.elasticsearch.action.support.RefCountingRunnable (used by EventProcessor.java): it seems it was missed
    • introduce bridge API for org.elasticsearch.ingest.common.FailProcessorException: it seems it was missed
  • Plugin scope: make Bridge API available in the plugin

    • the plugin builds minimal Elasticsearch (with gradlew localDistro) so logstash-bridge will not be built during this process. We need to have a task to build the module (./gradlew :libs:logstash-bridge:build) and add (shade like we have shadeElasticsearchIngestGeoIpModule) the module as a dependency to the project.
  • Elasticsearch scope: Came from evaluation task that we need to introduce modular descriptors for the redact, wildcard & spatial plugins to make them available in logstash-bridge

  • Plugin scope: move to Bridge API

    • Replace all classes with its bridges (e.g: Settings -> SettingsBridge)
    • Consider simplifications: some of the classes such as ScriptService has simplification logics so that plugin can remove unnecessary logica and utilize them. I will add more specific details once I start working on this.
  • Elasticsearch scope: Based on the evaluate current status of Stable API investigation outcome, introduce or modify the wrapper(s)

    • Migrate all Bridges to "interface pattern", using factory methods instead of constructors.
    • Extract implementations to package-private (so that we have a clear boundary of what is "externalized" to the logstash plugin
  • Elasticsearch scope: introduce Bridge and proxies for GeoIP

    • include geoip ingest module to logstash-bridge (somehow commented compileOnly project(':modules:ingest-geoip'))
  • Plugin scope: move GeoIP to Bridge API

  • Elasticsearch scope: deprecate/remove if unused classes left

    • Such as LogstashInternalBridge will be no longer used by the plugin but used internally in the bridge, do we need to replace and remove?!

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions