snazy commented on code in PR #4474:
URL: https://github.com/apache/polaris/pull/4474#discussion_r3286640203


##########
persistence/nosql/persistence/impl/src/main/java/org/apache/polaris/persistence/nosql/impl/indexes/IndexImpl.java:
##########
@@ -904,26 +909,43 @@ public IndexKey key() {
       return k;
     }
 
+    @Override
+    public boolean hasNonNullValue() {
+      var state = contentState;
+      if (state == VALUE_STATE_NULL) {
+        return false;
+      }
+      if (state != VALUE_STATE_UNMATERIALIZED) {
+        return true;
+      }
+      var nonNull =
+          !serializer.isNullSerialized(
+              serializedThreadSafe().limit(endOffset).position(valueOffset));
+      if (contentState == VALUE_STATE_UNMATERIALIZED) {
+        contentState = nonNull ? VALUE_STATE_NON_NULL : VALUE_STATE_NULL;

Review Comment:
   Went with a `AtomicReferenceFieldUpdater` to avoid an additional object 
instance and indirection.
   Had to make LazyIndexElement a static class for that, but that's not a 
runtime regression.



-- 
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