Skip to content

Commit 233c649

Browse files
committed
Remove loadDoc(...) block block aware interfaces.
1 parent 80ba5b7 commit 233c649

File tree

4 files changed

+57
-237
lines changed

4 files changed

+57
-237
lines changed

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/BlockAwareNumericDocValues.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ public abstract class BlockAwareNumericDocValues extends NumericDocValues {
1919

2020
public abstract void loadBlock(BlockLoader.LongBuilder builder, BlockLoader.Docs docs, int offset) throws IOException;
2121

22-
public abstract void loadDoc(BlockLoader.LongBuilder builder, int docId) throws IOException;
23-
2422
public abstract void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int offset) throws IOException;
2523

26-
public abstract void loadDoc(BlockLoader.IntBuilder builder, int docId) throws IOException;
27-
2824
public abstract void loadBlock(BlockLoader.SingletonOrdinalsBuilder builder, BlockLoader.Docs docs, int offset) throws IOException;
2925

3026
public abstract void loadBlock(
@@ -34,5 +30,4 @@ public abstract void loadBlock(
3430
BlockDocValuesReader.ToDouble toDouble
3531
) throws IOException;
3632

37-
public abstract void loadDoc(BlockLoader.DoubleBuilder builder, int docId, BlockDocValuesReader.ToDouble toDouble) throws IOException;
3833
}

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/BlockAwareSortedNumericDocValues.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,9 @@ public abstract class BlockAwareSortedNumericDocValues extends SortedNumericDocV
1919

2020
public abstract void loadBlock(BlockLoader.LongBuilder builder, BlockLoader.Docs docs, int offset) throws IOException;
2121

22-
public abstract void loadDoc(BlockLoader.LongBuilder builder, int docId) throws IOException;
23-
2422
public abstract void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int offset) throws IOException;
2523

26-
public abstract void loadDoc(BlockLoader.IntBuilder builder, int docId) throws IOException;
27-
2824
public abstract void loadBlock(BlockLoader.DoubleBuilder builder, BlockLoader.Docs docs, int offset, ToDouble toDouble)
2925
throws IOException;
3026

31-
public abstract void loadDoc(BlockLoader.DoubleBuilder builder, int docId, ToDouble toDouble) throws IOException;
32-
3327
}

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesProducer.java

Lines changed: 0 additions & 220 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,23 +1078,13 @@ public void loadBlock(BlockLoader.LongBuilder builder, BlockLoader.Docs docs, in
10781078
}
10791079
}
10801080

1081-
@Override
1082-
public void loadDoc(BlockLoader.LongBuilder builder, int docId) {
1083-
builder.appendLong(0L);
1084-
}
1085-
10861081
@Override
10871082
public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int offset) throws IOException {
10881083
for (int i = offset; i < docs.count(); i++) {
10891084
builder.appendInt(0);
10901085
}
10911086
}
10921087

1093-
@Override
1094-
public void loadDoc(BlockLoader.IntBuilder builder, int docId) throws IOException {
1095-
builder.appendInt(0);
1096-
}
1097-
10981088
@Override
10991089
public void loadBlock(BlockLoader.SingletonOrdinalsBuilder builder, BlockLoader.Docs docs, int offset)
11001090
throws IOException {
@@ -1116,12 +1106,6 @@ public void loadBlock(
11161106
}
11171107
}
11181108

1119-
@Override
1120-
public void loadDoc(BlockLoader.DoubleBuilder builder, int docId, BlockDocValuesReader.ToDouble toDouble)
1121-
throws IOException {
1122-
builder.appendDouble(toDouble.convert(0L));
1123-
}
1124-
11251109
@Override
11261110
public int docID() {
11271111
return doc;
@@ -1203,15 +1187,6 @@ public void loadBlock(BlockLoader.LongBuilder builder, BlockLoader.Docs docs, in
12031187
}
12041188
}
12051189

1206-
@Override
1207-
public void loadDoc(BlockLoader.LongBuilder builder, int docId) throws IOException {
1208-
if (disi.advanceExact(docId)) {
1209-
builder.appendLong(0L);
1210-
} else {
1211-
builder.appendNull();
1212-
}
1213-
}
1214-
12151190
@Override
12161191
public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int offset) throws IOException {
12171192
for (int i = offset; i < docs.count(); i++) {
@@ -1223,15 +1198,6 @@ public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int
12231198
}
12241199
}
12251200

1226-
@Override
1227-
public void loadDoc(BlockLoader.IntBuilder builder, int docId) throws IOException {
1228-
if (disi.advanceExact(docId)) {
1229-
builder.appendInt(0);
1230-
} else {
1231-
builder.appendNull();
1232-
}
1233-
}
1234-
12351201
@Override
12361202
public void loadBlock(BlockLoader.SingletonOrdinalsBuilder builder, BlockLoader.Docs docs, int offset)
12371203
throws IOException {
@@ -1261,15 +1227,6 @@ public void loadBlock(
12611227
}
12621228
}
12631229

1264-
@Override
1265-
public void loadDoc(BlockLoader.DoubleBuilder builder, int docId, BlockDocValuesReader.ToDouble toDouble)
1266-
throws IOException {
1267-
if (disi.advanceExact(docId)) {
1268-
builder.appendDouble(toDouble.convert(0L));
1269-
} else {
1270-
builder.appendNull();
1271-
}
1272-
}
12731230
};
12741231
}
12751232
}
@@ -1372,16 +1329,6 @@ public void loadBlock(BlockLoader.LongBuilder builder, BlockLoader.Docs docs, in
13721329
// }
13731330
}
13741331

1375-
@Override
1376-
public void loadDoc(BlockLoader.LongBuilder builder, int docId) throws IOException {
1377-
doc = docId;
1378-
1379-
int blockIndex = docId >>> ES819TSDBDocValuesFormat.NUMERIC_BLOCK_SHIFT;
1380-
int blockInIndex = docId & ES819TSDBDocValuesFormat.NUMERIC_BLOCK_MASK;
1381-
loadCurrentBlock(blockIndex);
1382-
builder.appendLong(currentBlock[blockInIndex]);
1383-
}
1384-
13851332
@Override
13861333
public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int offset) throws IOException {
13871334
for (int i = offset; i < docs.count(); i++) {
@@ -1409,17 +1356,6 @@ public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int
14091356
// }
14101357
}
14111358

1412-
@Override
1413-
public void loadDoc(BlockLoader.IntBuilder builder, int docId) throws IOException {
1414-
doc = docId;
1415-
1416-
int blockIndex = docId >>> ES819TSDBDocValuesFormat.NUMERIC_BLOCK_SHIFT;
1417-
int blockInIndex = docId & ES819TSDBDocValuesFormat.NUMERIC_BLOCK_MASK;
1418-
loadCurrentBlock(blockIndex);
1419-
int value = Math.toIntExact(currentBlock[blockInIndex]);
1420-
builder.appendInt(value);
1421-
}
1422-
14231359
@Override
14241360
public void loadBlock(BlockLoader.SingletonOrdinalsBuilder builder, BlockLoader.Docs docs, int offset) throws IOException {
14251361
for (int i = offset; i < docs.count(); i++) {
@@ -1453,17 +1389,6 @@ public void loadBlock(
14531389
}
14541390
}
14551391

1456-
@Override
1457-
public void loadDoc(BlockLoader.DoubleBuilder builder, int docId, BlockDocValuesReader.ToDouble toDouble)
1458-
throws IOException {
1459-
doc = docId;
1460-
1461-
int blockIndex = docId >>> ES819TSDBDocValuesFormat.NUMERIC_BLOCK_SHIFT;
1462-
int blockInIndex = docId & ES819TSDBDocValuesFormat.NUMERIC_BLOCK_MASK;
1463-
loadCurrentBlock(blockIndex);
1464-
double value = toDouble.convert(currentBlock[blockInIndex]);
1465-
builder.appendDouble(value);
1466-
}
14671392
};
14681393
} else {
14691394
final IndexedDISI disi = new IndexedDISI(
@@ -1540,15 +1465,6 @@ public void loadBlock(BlockLoader.LongBuilder builder, BlockLoader.Docs docs, in
15401465
}
15411466
}
15421467

1543-
@Override
1544-
public void loadDoc(BlockLoader.LongBuilder builder, int docId) throws IOException {
1545-
if (disi.advanceExact(docId)) {
1546-
builder.appendLong(longValue());
1547-
} else {
1548-
builder.appendNull();
1549-
}
1550-
}
1551-
15521468
@Override
15531469
public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int offset) throws IOException {
15541470
// TODO: collect all doc ids for current block and then append values to builder?
@@ -1564,16 +1480,6 @@ public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int
15641480
}
15651481
}
15661482

1567-
@Override
1568-
public void loadDoc(BlockLoader.IntBuilder builder, int docId) throws IOException {
1569-
if (disi.advanceExact(docId)) {
1570-
int value = Math.toIntExact(longValue());
1571-
builder.appendInt(value);
1572-
} else {
1573-
builder.appendNull();
1574-
}
1575-
}
1576-
15771483
@Override
15781484
public void loadBlock(BlockLoader.SingletonOrdinalsBuilder builder, BlockLoader.Docs docs, int offset) throws IOException {
15791485
// TODO: collect all doc ids for current block and then append values to builder?
@@ -1609,16 +1515,6 @@ public void loadBlock(
16091515
}
16101516
}
16111517

1612-
@Override
1613-
public void loadDoc(BlockLoader.DoubleBuilder builder, int docId, BlockDocValuesReader.ToDouble toDouble)
1614-
throws IOException {
1615-
if (disi.advanceExact(docId)) {
1616-
double value = toDouble.convert(longValue());
1617-
builder.appendDouble(value);
1618-
} else {
1619-
builder.appendNull();
1620-
}
1621-
}
16221518
};
16231519
}
16241520
}
@@ -1740,24 +1636,6 @@ public void loadBlock(BlockLoader.LongBuilder builder, BlockLoader.Docs docs, in
17401636
}
17411637
}
17421638

1743-
@Override
1744-
public void loadDoc(BlockLoader.LongBuilder builder, int docId) throws IOException {
1745-
doc = docId;
1746-
start = addresses.get(docId);
1747-
end = addresses.get(docId + 1L);
1748-
count = (int) (end - start);
1749-
1750-
if (count == 1) {
1751-
builder.appendLong(nextValue());
1752-
} else {
1753-
builder.beginPositionEntry();
1754-
for (int v = 0; v < count; v++) {
1755-
builder.appendLong(nextValue());
1756-
}
1757-
builder.endPositionEntry();
1758-
}
1759-
}
1760-
17611639
@Override
17621640
public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int offset) throws IOException {
17631641
for (int i = offset; i < docs.count(); i++) {
@@ -1780,26 +1658,6 @@ public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int
17801658
}
17811659
}
17821660

1783-
@Override
1784-
public void loadDoc(BlockLoader.IntBuilder builder, int docId) throws IOException {
1785-
doc = docId;
1786-
start = addresses.get(docId);
1787-
end = addresses.get(docId + 1L);
1788-
count = (int) (end - start);
1789-
1790-
if (count == 1) {
1791-
int value = Math.toIntExact(nextValue());
1792-
builder.appendInt(value);
1793-
} else {
1794-
builder.beginPositionEntry();
1795-
for (int v = 0; v < count; v++) {
1796-
int value = Math.toIntExact(nextValue());
1797-
builder.appendInt(value);
1798-
}
1799-
builder.endPositionEntry();
1800-
}
1801-
}
1802-
18031661
@Override
18041662
public void loadBlock(
18051663
BlockLoader.DoubleBuilder builder,
@@ -1825,24 +1683,6 @@ public void loadBlock(
18251683
}
18261684
}
18271685

1828-
@Override
1829-
public void loadDoc(BlockLoader.DoubleBuilder builder, int docId, BlockDocValuesReader.ToDouble toDouble)
1830-
throws IOException {
1831-
doc = docId;
1832-
start = addresses.get(docId);
1833-
end = addresses.get(docId + 1L);
1834-
count = (int) (end - start);
1835-
1836-
if (count == 1) {
1837-
builder.appendDouble(toDouble.convert(nextValue()));
1838-
} else {
1839-
builder.beginPositionEntry();
1840-
for (int v = 0; v < count; v++) {
1841-
builder.appendDouble(toDouble.convert(nextValue()));
1842-
}
1843-
builder.endPositionEntry();
1844-
}
1845-
}
18461686
};
18471687
} else {
18481688
// sparse
@@ -1915,25 +1755,6 @@ public void loadBlock(BlockLoader.LongBuilder builder, BlockLoader.Docs docs, in
19151755
}
19161756
}
19171757

1918-
@Override
1919-
public void loadDoc(BlockLoader.LongBuilder builder, int docId) throws IOException {
1920-
set = false;
1921-
if (disi.advanceExact(docId)) {
1922-
set();
1923-
if (count == 1) {
1924-
builder.appendLong(nextValue());
1925-
} else {
1926-
builder.beginPositionEntry();
1927-
for (int v = 0; v < count; v++) {
1928-
builder.appendLong(nextValue());
1929-
}
1930-
builder.endPositionEntry();
1931-
}
1932-
} else {
1933-
builder.appendNull();
1934-
}
1935-
}
1936-
19371758
@Override
19381759
public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int offset) throws IOException {
19391760
for (int i = offset; i < docs.count(); i++) {
@@ -1957,27 +1778,6 @@ public void loadBlock(BlockLoader.IntBuilder builder, BlockLoader.Docs docs, int
19571778
}
19581779
}
19591780

1960-
@Override
1961-
public void loadDoc(BlockLoader.IntBuilder builder, int docId) throws IOException {
1962-
set = false;
1963-
if (disi.advanceExact(docId)) {
1964-
set();
1965-
if (count == 1) {
1966-
int value = Math.toIntExact(nextValue());
1967-
builder.appendInt(value);
1968-
} else {
1969-
builder.beginPositionEntry();
1970-
for (int v = 0; v < count; v++) {
1971-
int value = Math.toIntExact(nextValue());
1972-
builder.appendInt(value);
1973-
}
1974-
builder.endPositionEntry();
1975-
}
1976-
} else {
1977-
builder.appendNull();
1978-
}
1979-
}
1980-
19811781
@Override
19821782
public void loadBlock(
19831783
BlockLoader.DoubleBuilder builder,
@@ -2004,26 +1804,6 @@ public void loadBlock(
20041804
}
20051805
}
20061806

2007-
@Override
2008-
public void loadDoc(BlockLoader.DoubleBuilder builder, int docId, BlockDocValuesReader.ToDouble toDouble)
2009-
throws IOException {
2010-
set = false;
2011-
if (disi.advanceExact(docId)) {
2012-
set();
2013-
if (count == 1) {
2014-
builder.appendDouble(toDouble.convert(nextValue()));
2015-
} else {
2016-
builder.beginPositionEntry();
2017-
for (int v = 0; v < count; v++) {
2018-
builder.appendDouble(toDouble.convert(nextValue()));
2019-
}
2020-
builder.endPositionEntry();
2021-
}
2022-
} else {
2023-
builder.appendNull();
2024-
}
2025-
}
2026-
20271807
@Override
20281808
public int docValueCount() {
20291809
set();

0 commit comments

Comments
 (0)