gpt4 book ai didi

hadoop - HBase:如何放置/获取知道要写入哪个区域服务器?

转载 作者:可可西里 更新时间:2023-11-01 14:12:46 25 4
gpt4 key购买 nike

在 HBase 中,put/get 操作如何知道应该将行写入哪个区域服务器?如果要读取多行,如何联系多个区域服务器并检索结果?

最佳答案

我假设您的问题只是出于好奇,因为这种行为是从用户那里抽象出来的,您不应该关心。


In HBase, how the put/get operations know which region server the row should be written to?

来自hbase documentation book :

The HBase client HTable is responsible for finding RegionServers that are serving the particular row range of interest. It does this by querying the .META. and -ROOT- catalog tables (TODO: Explain). After locating the required region(s), the client directly contacts the RegionServer serving that region (i.e., it does not go through the master) and issues the read or write request. This information is cached in the client so that subsequent requests need not go through the lookup process. Should a region be reassigned either by the master load balancer or because a RegionServer has died, the client will requery the catalog tables to determine the new location of the user region.

所以第一步是在 meta 和 root 中查找以确定它在哪里,然后它联系该区域服务器来完成这项工作。


In case of multiple rows to be read how multiple region servers are contacted and the results are retrieved?

从HBase读取一般有两种方式:scannersgets .

如果您运行多个获取,这些将分别单独获取这些记录。其中每一个都可能去往不同的区域服务器。

扫描仪将简单地寻找范围的起点,然后从那里向前移动。有时它需要在到达终点时移动到不同的区域服务器,但客户端会在幕后处理。如果有某种方法来设计表,使您的多次获取是一次扫描而不是一系列获取,那么假设您应该有更好的性能。

关于hadoop - HBase:如何放置/获取知道要写入哪个区域服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18719042/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com