File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
src/java/org/apache/cassandra/index/sai Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ private SSTableContext(SSTableContext copy)
6565 this .primaryKeyMapFactory = copy .primaryKeyMapFactory ;
6666 }
6767
68- @ SuppressWarnings ("resource" )
6968 public static SSTableContext create (SSTableReader sstable , IndexComponents .ForRead perSSTableComponents )
7069 {
7170 var onDiskFormat = perSSTableComponents .onDiskFormat ();
Original file line number Diff line number Diff line change @@ -59,8 +59,10 @@ public class PartitionAwarePrimaryKeyMap implements PrimaryKeyMap
5959 @ ThreadSafe
6060 public static class PartitionAwarePrimaryKeyMapFactory implements Factory
6161 {
62+ private final IndexComponents .ForRead perSSTableComponents ;
6263 private final LongArray .Factory tokenReaderFactory ;
6364 private final LongArray .Factory offsetReaderFactory ;
65+ private final MetadataSource metadata ;
6466 private final KeyFetcher keyFetcher ;
6567 private final IPartitioner partitioner ;
6668 private final PrimaryKey .Factory primaryKeyFactory ;
@@ -74,13 +76,14 @@ public PartitionAwarePrimaryKeyMapFactory(IndexComponents.ForRead perSSTableComp
7476 {
7577 try
7678 {
77- MetadataSource metadata = MetadataSource .loadMetadata (perSSTableComponents );
79+ this .perSSTableComponents = perSSTableComponents ;
80+ this .metadata = MetadataSource .loadMetadata (perSSTableComponents );
7881
7982 IndexComponent .ForRead offsetsComponent = perSSTableComponents .get (IndexComponentType .OFFSETS_VALUES );
8083 IndexComponent .ForRead tokensComponent = perSSTableComponents .get (IndexComponentType .TOKEN_VALUES );
8184
82- NumericValuesMeta offsetsMeta = new NumericValuesMeta (metadata .get (offsetsComponent ));
83- NumericValuesMeta tokensMeta = new NumericValuesMeta (metadata .get (tokensComponent ));
85+ NumericValuesMeta offsetsMeta = new NumericValuesMeta (this . metadata .get (offsetsComponent ));
86+ NumericValuesMeta tokensMeta = new NumericValuesMeta (this . metadata .get (tokensComponent ));
8487
8588 count = tokensMeta .valueCount ;
8689 token = tokensComponent .createFileHandle ();
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ public class RowAwarePrimaryKeyMap implements PrimaryKeyMap
7171 @ ThreadSafe
7272 public static class RowAwarePrimaryKeyMapFactory implements Factory
7373 {
74+ private final IndexComponents .ForRead perSSTableComponents ;
7475 private final LongArray .Factory tokenReaderFactory ;
7576 private final SortedTermsReader sortedTermsReader ;
7677 private final long count ;
@@ -88,6 +89,7 @@ public RowAwarePrimaryKeyMapFactory(IndexComponents.ForRead perSSTableComponents
8889 {
8990 try
9091 {
92+ this .perSSTableComponents = perSSTableComponents ;
9193 MetadataSource metadataSource = MetadataSource .loadMetadata (perSSTableComponents );
9294 NumericValuesMeta tokensMeta = new NumericValuesMeta (metadataSource .get (perSSTableComponents .get (IndexComponentType .TOKEN_VALUES )));
9395 count = tokensMeta .valueCount ;
You can’t perform that action at this time.
0 commit comments