|
21 | 21 | import org.elasticsearch.compute.data.DocBlock; |
22 | 22 | import org.elasticsearch.compute.data.DocVector; |
23 | 23 | import org.elasticsearch.compute.data.ElementType; |
24 | | -import org.elasticsearch.compute.data.FloatBlock; |
25 | 24 | import org.elasticsearch.compute.data.IntVector; |
26 | 25 | import org.elasticsearch.compute.data.Page; |
27 | 26 | import org.elasticsearch.compute.data.SingletonOrdinalsBuilder; |
@@ -657,45 +656,7 @@ public BlockLoader.DoubleBuilder doubles(int expectedCount) { |
657 | 656 |
|
658 | 657 | @Override |
659 | 658 | public BlockLoader.FloatBuilder denseVectors(int expectedVectorsCount, int dimensions) { |
660 | | - FloatBlock.Builder builder = factory.newFloatBlockBuilder(expectedVectorsCount * dimensions); |
661 | | - |
662 | | - return new BlockLoader.FloatBuilder() { |
663 | | - int numElements = 0; |
664 | | - |
665 | | - @Override |
666 | | - public BlockLoader.FloatBuilder appendFloat(float value) { |
667 | | - numElements++; |
668 | | - return builder.appendFloat(value); |
669 | | - } |
670 | | - |
671 | | - @Override |
672 | | - public BlockLoader.Block build() { |
673 | | - assert numElements == 0 : "endPositionEntry() was not called before build()"; |
674 | | - return builder.build(); |
675 | | - } |
676 | | - |
677 | | - @Override |
678 | | - public BlockLoader.Builder appendNull() { |
679 | | - throw new IllegalArgumentException("null values are not expected for dense vectors"); |
680 | | - } |
681 | | - |
682 | | - @Override |
683 | | - public BlockLoader.Builder beginPositionEntry() { |
684 | | - return builder.beginPositionEntry(); |
685 | | - } |
686 | | - |
687 | | - @Override |
688 | | - public BlockLoader.Builder endPositionEntry() { |
689 | | - assert numElements == dimensions : "expected " + dimensions + " dimensions, but got " + numElements + " elements"; |
690 | | - numElements = 0; |
691 | | - return builder.endPositionEntry(); |
692 | | - } |
693 | | - |
694 | | - @Override |
695 | | - public void close() { |
696 | | - builder.close(); |
697 | | - } |
698 | | - }; |
| 659 | + return factory.newFloatBlockBuilder(expectedVectorsCount * dimensions); |
699 | 660 | } |
700 | 661 |
|
701 | 662 | @Override |
|
0 commit comments