Skip to content

Commit 6856d2d

Browse files
committed
more changes to move into logsdb
1 parent 0815760 commit 6856d2d

File tree

8 files changed

+19
-96
lines changed

8 files changed

+19
-96
lines changed

x-pack/plugin/logsdb/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ base {
2424

2525
restResources {
2626
restApi {
27-
include 'bulk', 'search', '_common', 'indices', 'index', 'cluster', 'data_stream', 'ingest', 'cat', 'capabilities', 'esql.query'
27+
include 'bulk', 'search', '_common', 'indices', 'index', 'cluster', 'data_stream', 'ingest', 'cat', 'capabilities', 'esql.query', 'field_caps'
2828
}
2929
}
3030

3131
dependencies {
3232
compileOnly project(path: xpackModule('core'))
33+
implementation project(':modules:mapper-extras')
3334
testImplementation project(':modules:data-streams')
3435
testImplementation(testArtifact(project(xpackModule('core'))))
3536
javaRestTestImplementation(testArtifact(project(xpackModule('spatial'))))
3637
internalClusterTestImplementation(testArtifact(project(xpackModule('core'))))
37-
clusterModules project(':modules:mapper-extras')
3838
}
3939

4040
tasks.named("javaRestTest").configure {

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/LogsDBPlugin.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,27 @@
1212
import org.elasticsearch.common.settings.Settings;
1313
import org.elasticsearch.index.IndexSettingProvider;
1414
import org.elasticsearch.index.IndexVersion;
15+
import org.elasticsearch.index.mapper.Mapper;
1516
import org.elasticsearch.license.LicenseService;
1617
import org.elasticsearch.license.XPackLicenseState;
1718
import org.elasticsearch.plugins.ActionPlugin;
19+
import org.elasticsearch.plugins.MapperPlugin;
1820
import org.elasticsearch.plugins.Plugin;
1921
import org.elasticsearch.xpack.core.XPackPlugin;
2022
import org.elasticsearch.xpack.core.action.XPackInfoFeatureAction;
2123
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
24+
import org.elasticsearch.xpack.logsdb.patternedtext.PatternedTextFieldMapper;
25+
import org.elasticsearch.xpack.logsdb.patternedtext.PatternedTextFieldType;
2226

2327
import java.util.ArrayList;
2428
import java.util.Collection;
2529
import java.util.List;
30+
import java.util.Map;
2631

32+
import static java.util.Collections.singletonMap;
2733
import static org.elasticsearch.xpack.logsdb.LogsdbLicenseService.FALLBACK_SETTING;
2834

29-
public class LogsDBPlugin extends Plugin implements ActionPlugin {
35+
public class LogsDBPlugin extends Plugin implements ActionPlugin, MapperPlugin {
3036

3137
private final Settings settings;
3238
private final LogsdbLicenseService licenseService;
@@ -98,6 +104,11 @@ public List<ActionPlugin.ActionHandler> getActions() {
98104
return actions;
99105
}
100106

107+
@Override
108+
public Map<String, Mapper.TypeParser> getMappers() {
109+
return singletonMap(PatternedTextFieldType.CONTENT_TYPE, PatternedTextFieldMapper.PARSER);
110+
}
111+
101112
protected XPackLicenseState getLicenseState() {
102113
return XPackPlugin.getSharedLicenseState();
103114
}

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/patternedtext/PatternedTextFieldType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class PatternedTextFieldType extends StringFieldType {
5757
private static final String TEMPLATE_SUFFIX = ".template";
5858
private static final String ARGS_SUFFIX = ".args";
5959

60-
static final String CONTENT_TYPE = "patterned_text";
60+
public static final String CONTENT_TYPE = "patterned_text";
6161

6262
private final Analyzer indexAnalyzer;
6363
private final TextFieldMapper.TextFieldType textFieldType;

x-pack/plugin/logsdb/src/main/java/org/elasticsearch/xpack/logsdb/patternedtext/PatternedTextMapperPlugin.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

x-pack/plugin/logsdb/src/test/java/org/elasticsearch/xpack/logsdb/patternedtext/PatternedTextFieldMapperTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.lucene.tests.analysis.Token;
2323
import org.apache.lucene.tests.index.RandomIndexWriter;
2424
import org.elasticsearch.common.Strings;
25+
import org.elasticsearch.common.settings.Settings;
2526
import org.elasticsearch.core.Tuple;
2627
import org.elasticsearch.index.mapper.DateFieldMapper;
2728
import org.elasticsearch.index.mapper.DocumentMapper;
@@ -37,6 +38,7 @@
3738
import org.elasticsearch.plugins.Plugin;
3839
import org.elasticsearch.xcontent.XContentBuilder;
3940
import org.elasticsearch.xcontent.XContentFactory;
41+
import org.elasticsearch.xpack.logsdb.LogsDBPlugin;
4042
import org.junit.AssumptionViolatedException;
4143

4244
import java.io.IOException;
@@ -54,7 +56,7 @@ public class PatternedTextFieldMapperTests extends MapperTestCase {
5456

5557
@Override
5658
protected Collection<Plugin> getPlugins() {
57-
return List.of(new PatternedTextMapperPlugin());
59+
return List.of(new LogsDBPlugin(Settings.EMPTY));
5860
}
5961

6062
@Override

x-pack/plugin/logsdb/src/yamlRestTest/java/org/elasticsearch/xpack/logsdb/LogsdbTestSuiteIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class LogsdbTestSuiteIT extends ESClientYamlSuiteTestCase {
2727

2828
@ClassRule
2929
public static final ElasticsearchCluster cluster = ElasticsearchCluster.local()
30+
.module("logsdb")
3031
.distribution(DistributionType.DEFAULT)
3132
.user(USER, PASS, "superuser", false)
3233
.setting("xpack.security.autoconfiguration.enabled", "false")

x-pack/plugin/mapper-patterned-text/build.gradle

Lines changed: 0 additions & 30 deletions
This file was deleted.

x-pack/plugin/mapper-patterned-text/src/yamlRestTest/java/org/elasticsearch/xpack/patternedtext/PatternedTextClientYamlTestSuiteIT.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)