[
https://issues.apache.org/jira/browse/HBASE-24609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17213500#comment-17213500
]
Duo Zhang commented on HBASE-24609:
-----------------------------------
{quote}
Why move MetaTableAccessor to hbase-balancer? The accessor seems more general
than balancing affairs only. Class is described as
{quote}
The plan is to move it to hbase-server but the balancer class will write to
meta table(surprise ha?) so we have to keep it in hbase-balancer, as
hbase-server depends on hbase-balancer.
{quote}
The rename of asyncmetatableaccessor to clientmetatableaccessor looks good but
I'm unclear on when clientmetatableaccessor and when metatableaccessor? The
clientmetatableaccessor is described like the metatableaccessor.
{quote}
The idea is that, now only master can modify meta, so in
ClientMetaTableAccessor we only have read methods, and MetaTableAccessor still
has write methods, that's why we move it out of hbase-client, as the code in
hbase-client should not modify meta.
And on the question about when to use ClientMTA and when MTA, the answer is, do
not use them both if possible. Providing a utility class to modify meta is not
a good idea. The above balancer surprise is a great example to show that it is
not easy to track where we touch meta table.
At client side, use RegionLocator and methods in Admin as much as possible. At
master side, use RegionStateStore to update meta, use AssignmentManager to get
the state of a region, use TableStateManager to get the state of table. At
region server side, avoid touching meta directly as much as possible, as the
ClusterConnection will do the work for you.
{quote}
Why we need it as standalone class that is making an appearance in a few places
around the code base? It was an internal affair of MetaTableAccessor previously?
{quote}
As said above, the plan is to completely remove MTA style classes, maybe it is
good in the old time but for now, it is not a good practice. The class is as
its name, only provide utility methods for the data format of the 'info'
column, which we describe as 'Catalog'. The idea is borrowed from HBASE-11288,
where we use 'CatalogTableAccessor' everywhere and no one objects it, so I just
use the name 'Catalog'.
Thanks.
> Move MetaTableAccessor out of hbase-client
> ------------------------------------------
>
> Key: HBASE-24609
> URL: https://issues.apache.org/jira/browse/HBASE-24609
> Project: HBase
> Issue Type: Task
> Components: amv2, Client, meta
> Reporter: Duo Zhang
> Assignee: Duo Zhang
> Priority: Major
> Fix For: 3.0.0-alpha-1
>
>
> On master branch we have AsyncMetaTableAccessor which is used at client side
> and MetaTableAccessor has lots of internal methods for implementing
> assignment, which is not part of our client code.
> So let's move it to hbase-server, and in the future, maybe in hbase-balancer?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)