sashapolo commented on code in PR #2424:
URL: https://github.com/apache/ignite-3/pull/2424#discussion_r1293247030


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -521,20 +521,34 @@ private static class TableRowToIndexKeyConverter {
             this.indexedColumns = indexedColumns;
         }
 
-        public BinaryTuple convert(BinaryRow binaryRow) {
+        @Override
+        public BinaryTuple extractColumnsFromKeyOnlyRow(BinaryRow keyOnlyRow) {
+            return 
converter(keyOnlyRow).extractColumnsFromKeyOnlyRow(keyOnlyRow);
+        }
+
+        @Override
+        public BinaryTuple extractColumns(BinaryRow row) {
+            return converter(row).extractColumns(row);
+        }
+
+        private ColumnsExtractor converter(BinaryRow row) {
+            int schemaVersion = row.schemaVersion();
+
             VersionedConverter converter = this.converter;
 
-            if (converter.version != binaryRow.schemaVersion()) {
+            if (converter.version != schemaVersion) {
                 synchronized (mutex) {
-                    if (converter.version != binaryRow.schemaVersion()) {
-                        converter = createConverter(binaryRow.schemaVersion());
+                    converter = this.converter;
+
+                    if (converter.version != schemaVersion) {

Review Comment:
   I don't know, how heavy is it to create a converter? Maybe maintaining that 
LRU cache is actually more work than creating a new converter, this is not 
obvious to me



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to