bharathv commented on a change in pull request #995: HBASE-23055 Alter
hbase:meta
URL: https://github.com/apache/hbase/pull/995#discussion_r363621918
##########
File path:
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKAsyncRegistry.java
##########
@@ -229,6 +242,33 @@ private void
getMetaRegionLocation(CompletableFuture<RegionLocations> future,
});
}
+ @Override
+ public CompletableFuture<TableState> getMetaTableState() {
+ CompletableFuture<TableState> result =
+ getAndConvert(this.znodeMirroredMetaTableState,
ZKAsyncRegistry::getTableState)
+ .thenApply(state -> {
+ return state == null ||
state.equals(ENABLED_META_TABLE_STATE.getState())?
+ ENABLED_META_TABLE_STATE: new TableState(TableName.META_TABLE_NAME,
state);
+ });
+ // If completed exceptionally return default ENABLED state.
+ return result.isCompletedExceptionally()? COMPLETED_GET_META_TABLE_STATE:
result;
Review comment:
Putting it out here means its blocking and not async right? (or did I read
it incorrectly?)
I think this method could use some test coverage for a bunch of table states.
----------------------------------------------------------------
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