stillalex commented on code in PR #1338:
URL: https://github.com/apache/solr/pull/1338#discussion_r1104747630


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java:
##########
@@ -232,32 +232,32 @@ void evictStale() {
    */
   @Deprecated
   public void setRetryExpiryTime(int secs) {
-    this.retryExpiryTime = TimeUnit.NANOSECONDS.convert(secs, 
TimeUnit.SECONDS);
+    this.retryExpiryTimeNano = TimeUnit.NANOSECONDS.convert(secs, 
TimeUnit.SECONDS);
   }
 
   protected final StateCache collectionStateCache = new StateCache();
 
   class ExpiringCachedDocCollection {
     final DocCollection cached;
-    final long cachedAt;
+    final long cachedAtNano;
     // This is the time at which the collection is retried and got the same 
old version
-    volatile long retriedAt = -1;
+    volatile long retriedAtNano = -1;
     // flag that suggests that this is potentially to be rechecked
     volatile boolean maybeStale = false;
 
     ExpiringCachedDocCollection(DocCollection cached) {
       this.cached = cached;
-      this.cachedAt = System.nanoTime();
+      this.cachedAtNano = System.nanoTime();
     }
 
     boolean isExpired(long timeToLiveMs) {
-      return (System.nanoTime() - cachedAt)
+      return (System.nanoTime() - cachedAtNano)

Review Comment:
   could we avoid the timeToLiveMs conversion to nanos? I see it hardcoded 
above as 
   
   ```
   protected volatile long timeToLiveMs = 60 * 1000L;
   ```
   you could apply the same type of refactoring and have it nanos directly
   



-- 
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...@solr.apache.org

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


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

Reply via email to