saintstack commented on a change in pull request #995: HBASE-23055 Alter 
hbase:meta
URL: https://github.com/apache/hbase/pull/995#discussion_r363947735
 
 

 ##########
 File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionImplementation.java
 ##########
 @@ -154,6 +156,16 @@
   public static final String RETRIES_BY_SERVER_KEY = 
"hbase.client.retries.by.server";
   private static final Logger LOG = 
LoggerFactory.getLogger(ConnectionImplementation.class);
 
+  /**
+   * TableState cache.
+   */
+  private final LoadingCache<TableName, TableState> tableStateCache;
 
 Review comment:
   Added more comment on the cache data member explaining why reproduced here:
   
      * Table States change super rarely. In synchronous client, state can be 
queried a lot
      * particularly when Regions are moving. Its ok if we are not super 
responsive noticing
      * Table State change. So, cache the last look up for a period. Use
      * {@link #TABLESTATE_CACHE_DURATION_MS} to change default of one second.
   
   On your nit, yeah, I think it fine reading table state from cache even if it 
stale. It will update after 1000ms. Region location lookups are more likely 
because of server crash or region balance... If table is being offlined, 
there'll be a little lag because of the cache but in scheme of things -- 
especially if a table disable -- I think it ok.
   
   There is no cache for async client. It goes against async API. TODO.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to