bharathv commented on a change in pull request #995: HBASE-23055 Alter
hbase:meta
URL: https://github.com/apache/hbase/pull/995#discussion_r363616695
##########
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:
Q: whats the motivation to use a cache here? To reduce the number of rpcs
for table state look ups?
nit: One behavior I noticed is that the general patten of client is to force
reload if something doesn't look as expected (retries..). For example
relocateRegion() doesn't care if any meta hrls are cached, it force reloads
them. Does that pattern also apply for table state cache? For example, in the
following snippet, isTableDisabled can now be served from cache. Not big of a
deal probably because the cache ttl is very low and table states probably
don't flip between disabled/enabled that often but wanted to point it out.
```
@Override
public RegionLocations relocateRegion(final TableName tableName,
final byte [] row, int replicaId) throws IOException{
if (isTableDisabled(tableName)) {
throw new TableNotEnabledException(tableName.getNameAsString() + " is
disabled.");
}
return locateRegion(tableName, row, false, true, replicaId);
}
```
----------------------------------------------------------------
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