maksaska commented on code in PR #11357:
URL: https://github.com/apache/ignite/pull/11357#discussion_r1617548013


##########
modules/core/src/main/java/org/apache/ignite/spi/systemview/view/CacheView.java:
##########
@@ -331,7 +335,46 @@ public String cacheWriterFactory() {
 
     /** @see CacheConfiguration#getExpiryPolicyFactory() */
     public String expiryPolicyFactory() {
-        return 
toStringSafe(cache.cacheConfiguration().getExpiryPolicyFactory());
+        if (cache.cacheConfiguration().getExpiryPolicyFactory() == null)
+            return null;
+
+        ExpiryPolicy expiryPlc = 
(ExpiryPolicy)cache.cacheConfiguration().getExpiryPolicyFactory().create();
+
+        String expiryPlcFactoryStr = "";
+
+        expiryPlcFactoryStr += durationToStringWithCustomMessage("create", 
expiryPlc.getExpiryForCreation());
+        expiryPlcFactoryStr += durationToStringWithCustomMessage("update", 
expiryPlc.getExpiryForUpdate());
+        expiryPlcFactoryStr += durationToStringWithCustomMessage("access", 
expiryPlc.getExpiryForAccess());
+
+        return expiryPlcFactoryStr.equals("") ? "Eternal" : 
expiryPlcFactoryStr;

Review Comment:
   There might be no custom toString() method from the user for this factory. 
If so, ClassName@HexHash might become a problem. It was actually the reason why 
we wanted changes here in the first place.
   
   In addition I can add a className factory to the output. Usually it's 
incorporates the logic behind it. But it's only assumption. In general it's 
strange to give the user information about how the develoer decided to name the 
class. 
   
   Maybe there is other way, but I thought ttl information should suffice. It's 
short, readable and it contains everything the user want to know about the 
factory
   
   WGYT?



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to