sgup432 opened a new issue, #12597:
URL: https://github.com/apache/lucene/issues/12597

   ### Description
   
   As of now, lucene LRU query cache and other OpenSearch caches uses CacheKey 
as a primary key for their caches as it helps to determine any changes during 
segment merges etc. We use IdentityHashMap and object equality for the 
comparison.
   
   I was looking for some ways to serialize this CacheKey and store cache data 
on disk etc. But seems like I can't do it. I can't really extend it as it is 
declared as final, doesn't implement Serializable, or even after 
serialization/deserialization process the actual object will change making it 
useless in the end.
   
   I was thinking for simplicity sake whether we could assign some unique id to 
this class during initialization which can be used instead of the object itself.
   
   Something like
   ```
   public static final class CacheKey {
       private final UUID uniqueId;
       CacheKey() {
           uniqueId = UUID.randomUUID();
       } 
       
      public String getUniqueId() {
          return uniqueId.toString();
     }
   }
   ````
   
   
   Let me know what you folks think as this seems like a harmless change.


-- 
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: issues-unsubscr...@lucene.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to