Simplify and document region life cycle #227
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Documented RegionInfo type with information about those 3 states and the lifecycle.
Documented establishRegion with what it does and what it's requirements are.
Removed calls to SetClient(nil)/MarkUnavailable in clientRegionCache methods. That work is the responsibility of the caller.
getRegionAndClientForRPC no longer marks a region as unavailable if Client is nil after waiting on the AvailabilityChan. If Client is nil, that indicates the region is stale and a lookup has to be performed. Marking it as unavailable and trying to reestablish it is wasted effort.
The above change broke the use of the meta and admin regions, which are created when creating the gohbase Client/AdminClient, but don't have a Client set. These regions were relying on a missing Client to cause the region to be established. Now the meta and admin regions are established as part of NewClient and NewAdminClient, respectively.
closes: #186