Skip to content

Commit 30ae746

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent cda6b0a commit 30ae746

File tree

7 files changed

+14
-32
lines changed

7 files changed

+14
-32
lines changed

x-pack/plugin/mapper-patterned-text/src/main/java/org/elasticsearch/xpack/patternedtext/PatternedTextDocValues.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,12 @@ public class PatternedTextDocValues extends SortedSetDocValues {
2020
private final SortedSetDocValues templateDocValues;
2121
private final SortedSetDocValues argsDocValues;
2222

23-
PatternedTextDocValues(
24-
SortedSetDocValues templateDocValues,
25-
SortedSetDocValues argsDocValues
26-
) {
23+
PatternedTextDocValues(SortedSetDocValues templateDocValues, SortedSetDocValues argsDocValues) {
2724
this.templateDocValues = templateDocValues;
2825
this.argsDocValues = argsDocValues;
2926
}
3027

31-
static PatternedTextDocValues from(LeafReader leafReader, String templateFieldName, String argsFieldName)
32-
throws IOException {
28+
static PatternedTextDocValues from(LeafReader leafReader, String templateFieldName, String argsFieldName) throws IOException {
3329
SortedSetDocValues templateDocValues = DocValues.getSortedSet(leafReader, templateFieldName);
3430
if (templateDocValues.getValueCount() == 0) {
3531
return null;

x-pack/plugin/mapper-patterned-text/src/main/java/org/elasticsearch/xpack/patternedtext/PatternedTextFieldMapper.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,7 @@ protected SyntheticSourceSupport syntheticSourceSupport() {
161161
() -> new CompositeSyntheticFieldLoader(
162162
leafName(),
163163
fullPath(),
164-
new PatternedTextSyntheticFieldLoaderLayer(
165-
fieldType().templateFieldName(),
166-
fieldType().argsFieldName()
167-
)
164+
new PatternedTextSyntheticFieldLoaderLayer(fieldType().templateFieldName(), fieldType().argsFieldName())
168165
)
169166
);
170167
}

x-pack/plugin/mapper-patterned-text/src/main/java/org/elasticsearch/xpack/patternedtext/PatternedTextFieldType.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,7 @@ public IndexFieldData.Builder fielddataBuilder(FieldDataContext fieldDataContext
271271
KEYWORD,
272272
(dv, n) -> new KeywordDocValuesField(FieldData.toString(dv), n)
273273
);
274-
return new PatternedTextIndexFieldData.Builder(
275-
name(),
276-
templateDataBuilder,
277-
argsDataBuilder
278-
);
274+
return new PatternedTextIndexFieldData.Builder(name(), templateDataBuilder, argsDataBuilder);
279275
}
280276

281277
String templateFieldName() {

x-pack/plugin/mapper-patterned-text/src/main/java/org/elasticsearch/xpack/patternedtext/PatternedTextIndexFieldData.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@
88
package org.elasticsearch.xpack.patternedtext;
99

1010
import org.apache.lucene.index.LeafReaderContext;
11-
import org.apache.lucene.index.SortedNumericDocValues;
1211
import org.apache.lucene.index.SortedSetDocValues;
1312
import org.apache.lucene.search.SortField;
1413
import org.elasticsearch.common.util.BigArrays;
1514
import org.elasticsearch.index.fielddata.FieldData;
1615
import org.elasticsearch.index.fielddata.IndexFieldData;
1716
import org.elasticsearch.index.fielddata.IndexFieldDataCache;
18-
import org.elasticsearch.index.fielddata.LeafNumericFieldData;
1917
import org.elasticsearch.index.fielddata.LeafOrdinalsFieldData;
2018
import org.elasticsearch.index.fielddata.plain.AbstractIndexOrdinalsFieldData;
2119
import org.elasticsearch.index.fielddata.plain.AbstractLeafOrdinalsFieldData;
22-
import org.elasticsearch.index.fielddata.plain.SortedNumericIndexFieldData;
2320
import org.elasticsearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData;
2421
import org.elasticsearch.indices.breaker.CircuitBreakerService;
2522
import org.elasticsearch.script.field.KeywordDocValuesField;
@@ -56,14 +53,7 @@ public PatternedTextIndexFieldData build(IndexFieldDataCache cache, CircuitBreak
5653
SortedSetOrdinalsIndexFieldData templateFieldData = templateFieldDataBuilder.build(cache, breakerService);
5754
SortedSetOrdinalsIndexFieldData argsFieldData = argsFieldDataBuilder.build(cache, breakerService);
5855
ToScriptFieldFactory<SortedSetDocValues> factory = (dv, n) -> new KeywordDocValuesField(FieldData.toString(dv), n);
59-
return new PatternedTextIndexFieldData(
60-
name,
61-
cache,
62-
breakerService,
63-
factory,
64-
templateFieldData,
65-
argsFieldData
66-
);
56+
return new PatternedTextIndexFieldData(name, cache, breakerService, factory, templateFieldData, argsFieldData);
6757
}
6858
}
6959

x-pack/plugin/mapper-patterned-text/src/main/java/org/elasticsearch/xpack/patternedtext/PatternedTextValueProcessor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ public class PatternedTextValueProcessor {
1616
private static final String DELIMITER = "[\\s\\[\\]]";
1717
private static final String SPACE = " ";
1818

19-
record Parts(String template, List<String> args) {
20-
}
19+
record Parts(String template, List<String> args) {}
2120

2221
static Parts split(String text) {
2322
StringBuilder template = new StringBuilder();

x-pack/plugin/mapper-patterned-text/src/test/java/org/elasticsearch/xpack/patternedtext/PatternedTextFieldMapperTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.apache.lucene.tests.analysis.CannedTokenStream;
2222
import org.apache.lucene.tests.analysis.Token;
2323
import org.apache.lucene.tests.index.RandomIndexWriter;
24-
import org.apache.lucene.util.BytesRef;
2524
import org.elasticsearch.common.Strings;
2625
import org.elasticsearch.core.Tuple;
2726
import org.elasticsearch.index.mapper.DateFieldMapper;
@@ -45,7 +44,6 @@
4544
import java.util.Collections;
4645
import java.util.List;
4746
import java.util.UUID;
48-
import java.util.function.Function;
4947

5048
import static org.hamcrest.Matchers.containsString;
5149
import static org.hamcrest.Matchers.equalTo;

x-pack/plugin/mapper-patterned-text/src/test/java/org/elasticsearch/xpack/patternedtext/PatternedTextValueProcessorTests.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ public void testUUID() {
6565
+ "some text with arg1 and arg2";
6666
PatternedTextValueProcessor.Parts parts = PatternedTextValueProcessor.split(text);
6767
assertEquals("[%W][%W][%W][action_controller][INFO]: [%W] some text with %W and %W", parts.template());
68-
assertThat(parts.args(), Matchers.contains("2020-08-18T00:58:56.751+00:00", "15", "2354", "18be2355-6306-4a00-9db9-f0696aa1a225", "arg1", "arg2"));
68+
assertThat(
69+
parts.args(),
70+
Matchers.contains("2020-08-18T00:58:56.751+00:00", "15", "2354", "18be2355-6306-4a00-9db9-f0696aa1a225", "arg1", "arg2")
71+
);
6972
assertEquals(text, PatternedTextValueProcessor.merge(parts));
7073
}
7174

@@ -81,7 +84,10 @@ public void testSecondDate() {
8184
String text = "[2020-08-18T00:58:56.751+00:00][15][2354][action_controller][INFO]: at 2020-08-18 00:58:56 +0000 and arg1";
8285
PatternedTextValueProcessor.Parts parts = PatternedTextValueProcessor.split(text);
8386
assertEquals("[%W][%W][%W][action_controller][INFO]: at %W %W %W and %W", parts.template());
84-
assertThat(parts.args(), Matchers.contains("2020-08-18T00:58:56.751+00:00", "15", "2354", "2020-08-18", "00:58:56", "+0000", "arg1"));
87+
assertThat(
88+
parts.args(),
89+
Matchers.contains("2020-08-18T00:58:56.751+00:00", "15", "2354", "2020-08-18", "00:58:56", "+0000", "arg1")
90+
);
8591
assertEquals(text, PatternedTextValueProcessor.merge(parts));
8692
}
8793
}

0 commit comments

Comments
 (0)