Modularize runtime-fields-common (#93719)

This change modulares the runtime-fields-common component by adding a
module-info.java.

relates #78744
This commit is contained in:
Ryan Ernst 2023-03-03 13:30:17 -08:00 committed by GitHub
parent b18c036761
commit e5a61067e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,25 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
module org.elasticsearch.runtimefields {
requires org.elasticsearch.base;
requires org.elasticsearch.server;
requires org.elasticsearch.dissect;
requires org.elasticsearch.grok;
requires org.elasticsearch.painless.spi;
requires org.elasticsearch.xcontent;
requires org.apache.lucene.core;
exports org.elasticsearch.runtimefields;
opens org.elasticsearch.runtimefields to org.elasticsearch.painless.spi; // whitelist resource access
provides org.elasticsearch.painless.spi.PainlessExtension with org.elasticsearch.runtimefields.RuntimeFieldsPainlessExtension;
}

View File

@ -28,6 +28,11 @@ import java.util.Map;
public class RuntimeFieldsPainlessExtension implements PainlessExtension {
private final List<Whitelist> whitelists;
// we don't use ServiceProvider directly, but module-info wants this
public RuntimeFieldsPainlessExtension() {
throw new UnsupportedOperationException();
}
public RuntimeFieldsPainlessExtension(RuntimeFieldsCommonPlugin plugin) {
Whitelist commonWhitelist = WhitelistLoader.loadFromResourceFiles(RuntimeFieldsPainlessExtension.class, "common_whitelist.txt");
Whitelist grokWhitelist = new Whitelist(