Skip to content

Commit a947c0c

Browse files
Misc cleanup fieldata package (elastic#113331) (elastic#113342)
Just some obvious cleanup and deduplication.
1 parent 3843d2a commit a947c0c

File tree

63 files changed

+140
-311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+140
-311
lines changed

server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesConsumer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ public SortedNumericDocValues getSortedNumeric(FieldInfo field) throws IOExcepti
533533
int i, docValueCount;
534534

535535
@Override
536-
public long nextValue() throws IOException {
536+
public long nextValue() {
537537
return ords[i++];
538538
}
539539

@@ -543,7 +543,7 @@ public int docValueCount() {
543543
}
544544

545545
@Override
546-
public boolean advanceExact(int target) throws IOException {
546+
public boolean advanceExact(int target) {
547547
throw new UnsupportedOperationException();
548548
}
549549

server/src/main/java/org/elasticsearch/index/fielddata/AbstractBinaryDocValues.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@
1010
package org.elasticsearch.index.fielddata;
1111

1212
import org.apache.lucene.index.BinaryDocValues;
13-
import org.apache.lucene.search.DocIdSetIterator;
14-
15-
import java.io.IOException;
1613

1714
/**
18-
* Base implementation that throws an {@link IOException} for the
19-
* {@link DocIdSetIterator} APIs. This impl is safe to use for sorting and
15+
* Base implementation. This impl is safe to use for sorting and
2016
* aggregations, which only use {@link #advanceExact(int)} and
2117
* {@link #binaryValue()}.
2218
*/
@@ -28,12 +24,12 @@ public int docID() {
2824
}
2925

3026
@Override
31-
public int nextDoc() throws IOException {
27+
public int nextDoc() {
3228
throw new UnsupportedOperationException();
3329
}
3430

3531
@Override
36-
public int advance(int target) throws IOException {
32+
public int advance(int target) {
3733
throw new UnsupportedOperationException();
3834
}
3935

server/src/main/java/org/elasticsearch/index/fielddata/AbstractNumericDocValues.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
public abstract class AbstractNumericDocValues extends NumericDocValues {
2424

2525
@Override
26-
public int nextDoc() throws IOException {
26+
public int nextDoc() {
2727
throw new UnsupportedOperationException();
2828
}
2929

3030
@Override
31-
public int advance(int target) throws IOException {
31+
public int advance(int target) {
3232
throw new UnsupportedOperationException();
3333
}
3434

server/src/main/java/org/elasticsearch/index/fielddata/AbstractSortedDocValues.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
public abstract class AbstractSortedDocValues extends SortedDocValues {
2424

2525
@Override
26-
public int nextDoc() throws IOException {
26+
public int nextDoc() {
2727
throw new UnsupportedOperationException();
2828
}
2929

3030
@Override
31-
public int advance(int target) throws IOException {
31+
public int advance(int target) {
3232
throw new UnsupportedOperationException();
3333
}
3434

server/src/main/java/org/elasticsearch/index/fielddata/AbstractSortedNumericDocValues.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public int nextDoc() throws IOException {
3333
}
3434

3535
@Override
36-
public int advance(int target) throws IOException {
36+
public int advance(int target) {
3737
throw new UnsupportedOperationException();
3838
}
3939

server/src/main/java/org/elasticsearch/index/fielddata/AbstractSortedSetDocValues.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ public int docID() {
2828
}
2929

3030
@Override
31-
public int nextDoc() throws IOException {
31+
public int nextDoc() {
3232
throw new UnsupportedOperationException();
3333
}
3434

3535
@Override
36-
public int advance(int target) throws IOException {
36+
public int advance(int target) {
3737
throw new UnsupportedOperationException();
3838
}
3939

server/src/main/java/org/elasticsearch/index/fielddata/AbstractSortingNumericDocValues.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public int docID() {
3636
}
3737

3838
@Override
39-
public int nextDoc() throws IOException {
39+
public int nextDoc() {
4040
throw new UnsupportedOperationException();
4141
}
4242

4343
@Override
44-
public int advance(int target) throws IOException {
44+
public int advance(int target) {
4545
throw new UnsupportedOperationException();
4646
}
4747

server/src/main/java/org/elasticsearch/index/fielddata/BinaryScriptFieldData.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,5 @@ public long ramBytesUsed() {
6666
return 0;
6767
}
6868

69-
@Override
70-
public void close() {
71-
72-
}
7369
}
7470
}

server/src/main/java/org/elasticsearch/index/fielddata/DoubleScriptFieldData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public DoubleScriptFieldData build(IndexFieldDataCache cache, CircuitBreakerServ
4343
}
4444

4545
private final String fieldName;
46-
DoubleFieldScript.LeafFactory leafFactory;
46+
final DoubleFieldScript.LeafFactory leafFactory;
4747
private final ToScriptFieldFactory<SortedNumericDoubleValues> toScriptFieldFactory;
4848

4949
private DoubleScriptFieldData(

server/src/main/java/org/elasticsearch/index/fielddata/FieldData.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public static SortedBinaryDocValues emptySortedBinary() {
4242
public static NumericDoubleValues emptyNumericDouble() {
4343
return new NumericDoubleValues() {
4444
@Override
45-
public boolean advanceExact(int doc) throws IOException {
45+
public boolean advanceExact(int doc) {
4646
return false;
4747
}
4848

4949
@Override
50-
public double doubleValue() throws IOException {
50+
public double doubleValue() {
5151
throw new UnsupportedOperationException();
5252
}
5353

@@ -243,14 +243,6 @@ public static BinaryDocValues unwrapSingleton(SortedBinaryDocValues values) {
243243
return null;
244244
}
245245

246-
/**
247-
* Returns whether the provided values *might* be multi-valued. There is no
248-
* guarantee that this method will return {@code false} in the single-valued case.
249-
*/
250-
public static boolean isMultiValued(SortedSetDocValues values) {
251-
return DocValues.unwrapSingleton(values) == null;
252-
}
253-
254246
/**
255247
* Return a {@link String} representation of the provided values. That is
256248
* typically used for scripts or for the `map` execution mode of terms aggs.
@@ -634,7 +626,7 @@ public boolean advanceExact(int target) throws IOException {
634626
}
635627

636628
@Override
637-
public long longValue() throws IOException {
629+
public long longValue() {
638630
return value;
639631
}
640632
};
@@ -661,7 +653,7 @@ public boolean advanceExact(int target) throws IOException {
661653
}
662654

663655
@Override
664-
public double doubleValue() throws IOException {
656+
public double doubleValue() {
665657
return value;
666658
}
667659
};

0 commit comments

Comments
 (0)