日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內(nèi)最全I(xiàn)T社區(qū)平臺 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁 > 互聯(lián)網(wǎng) > Impala源碼分析---1

Impala源碼分析---1

來源:程序員人生   發(fā)布時(shí)間:2014-09-16 10:28:16 閱讀次數(shù):3260次

2、Impala源碼分析

參考鏈接:http://www.sizeofvoid.net/wp-content/uploads/ImpalaIntroduction2.pdf

本章開始進(jìn)入源碼分析階段,參考鏈接是一篇非常好的impala實(shí)現(xiàn)、運(yùn)行流程介紹的文檔,感謝作者。

2.1 Impala內(nèi)部架構(gòu)

         Impala內(nèi)部架構(gòu)圖如下:

圖2-1 Impala內(nèi)部架構(gòu)

         從圖中可以看出,Impala三個(gè)部分:client、Impalad、StateStore的關(guān)系。

 

組件

說明

Client

圖中可以看到有三種,是Thrift客戶端,用來提交查詢,連接到Impalad的21000端口

Impalad

有frontEnd和backEnd兩部分,包括三個(gè)Thrift Server(beeswax-server、hs2-server、be-server)

StateStore

各個(gè)impalad向其注冊,然后它向各個(gè)impalad更新集群中其他節(jié)點(diǎn)的狀態(tài)

 

下面介紹一下Impalad組件的各個(gè)端口,如下表:

 

屬性

說明

 

Impalad組件端口

 

Impala 后臺程序后端端口 
be_port

22000

默認(rèn)值

ImpalaBackendService 導(dǎo)出的端口。

Impala Daemon Beeswax 端口 
beeswax_port

21000

默認(rèn)值

Impala Daemon Beeswax 客戶端請求提供服務(wù)所使用的端口。

Impala Daemon HiveServer2 端口 
hs2_port

21050

默認(rèn)值

Impala Daemon HiveServer2 客戶端請求提供服務(wù)所使用的端口。

StateStoreSubscriber 服務(wù)端口 
state_store_subscriber_port

23000

默認(rèn)值

StateStoreSubscriberService 運(yùn)行的端口。

 

 

 

 

StateStore組件端口

 

StateStore 服務(wù)端口 
state_store_port

24000

默認(rèn)值

StateStoreService 導(dǎo)出的端口。

StateStore HTTP 服務(wù)器端口 
webserver_port

25010

默認(rèn)值

StateStore 調(diào)試網(wǎng)站服務(wù)器運(yùn)行的端口。

 

         其中beeswax_port=21000是用來給Beeswax客戶端提供服務(wù)的端口,比如圖中的Hue客戶端、JDBC、Impala-shell三種client都會使用這個(gè)端口;hs2_port=21050是用來給HiveServer2客戶端提供服務(wù)的;be_port=22000是用來與內(nèi)部的其他Impalad進(jìn)程交互的端口;state_store_subscriber_port=23000是用來向StateStated進(jìn)程注冊自己和更新狀態(tài)用的端口;而StateStore組件里的24000端口正是用來與Impalad的23000端口進(jìn)行交互的,其他端口不太重要,不做介紹。

         整體的代碼文件結(jié)構(gòu)如下:

 

2.2 Impalad代碼分析

2.2.1 Impalad-main.cc


16 // This file contains the main() function for the impala daemon process, 17 // which exports the Thrift services ImpalaService and ImpalaInternalService. 18 19 #include <unistd.h> 20 #include <jni.h> 21 22 #include "common/logging.h" 23 #include "common/init.h" 24 #include "exec/hbase-table-scanner.h" 25 #include "exec/hbase-table-writer.h" 26 #include "runtime/hbase-table-factory.h" 27 #include "codegen/llvm-codegen.h" 28 #include "common/status.h" 29 #include "runtime/coordinator.h" 30 #include "runtime/exec-env.h" 31 #include "util/jni-util.h" 32 #include "util/network-util.h" 33 #include "rpc/thrift-util.h" 34 #include "rpc/thrift-server.h" 35 #include "rpc/rpc-trace.h" 36 #include "service/impala-server.h" 37 #include "service/fe-support.h" 38 #include "gen-cpp/ImpalaService.h" 39 #include "gen-cpp/ImpalaInternalService.h" 40 #include "util/impalad-metrics.h" 41 #include "util/thread.h" 42 43 using namespace impala; 44 using namespace std; 45 46 DECLARE_string(classpath); 47 DECLARE_bool(use_statestore); 48 DECLARE_int32(beeswax_port); 49 DECLARE_int32(hs2_port); 50 DECLARE_int32(be_port); 51 DECLARE_string(principal); 52 53 int main(int argc, char** argv) { 54 InitCommonRuntime(argc, argv, true); //參數(shù)解析,開啟日志,基于Google gflags和glog 55 56 LlvmCodeGen::InitializeLlvm(); 57 JniUtil::InitLibhdfs(); //初始化JNI,因?yàn)镕e部分是java開發(fā)的 58 EXIT_IF_ERROR(HBaseTableScanner::Init()); 59 EXIT_IF_ERROR(HBaseTableFactory::Init()); 60 EXIT_IF_ERROR(HBaseTableWriter::InitJNI()); 61 InitFeSupport(); 62 63 // start backend service for the coordinator on be_port 64 ExecEnv exec_env; //ExecEnv是query/paln-fragment的執(zhí)行環(huán)境 65 StartThreadInstrumentation(exec_env.metrics(), exec_env.webserver()); 66 InitRpcEventTracing(exec_env.webserver()); 67 68 ThriftServer* beeswax_server = NULL; 69 ThriftServer* hs2_server = NULL; 70 ThriftServer* be_server = NULL; //這是三個(gè)ThriftServer,原來服務(wù)client和其他impalad backend 71 ImpalaServer* server = NULL; //此server將上面三個(gè)ThriftServer包裝起來對外提供服務(wù) 72 EXIT_IF_ERROR(CreateImpalaServer(&exec_env, FLAGS_beeswax_port, FLAGS_hs2_port, 73 FLAGS_be_port, &beeswax_server, &hs2_server, &be_server, &server)); //創(chuàng)建ImpalaServer 74 75 EXIT_IF_ERROR(be_server->Start()); //啟動be_server 76 77 Status status = exec_env.StartServices(); //啟動service,包括statestore_subscriber (用來向statestod進(jìn)程注冊) 78 if (!status.ok()) { 79 LOG(ERROR) << "Impalad services did not start correctly, exiting. Error: " 80 << status.GetErrorMsg(); 81 ShutdownLogging(); 82 exit(1); 83 } 84 85 // this blocks until the beeswax and hs2 servers terminate 86 EXIT_IF_ERROR(beeswax_server->Start()); 87 EXIT_IF_ERROR(hs2_server->Start()); 88 ImpaladMetrics::IMPALA_SERVER_READY->Update(true); 89 LOG(INFO) << "Impala has started."; 90 beeswax_server->Join(); //阻塞等待beeswax-server退出才執(zhí)行后面的語句 91 hs2_server->Join(); //阻塞等待hs2-server退出才繼續(xù)執(zhí)行后面語句 92 93 delete be_server; 94 delete beeswax_server; 95 delete hs2_server; 96 }

待續(xù)。。。

生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 黄色一级片在线免费观看 | 亚洲一区二区三区免费视频 | 国产精品福利在线观看 | 成人性生交大片免费看在线播放 | 深夜福利av | 欧美黄色录像 | 久久久久久国产 | 激情成人综合 | 欧美午夜一区二区福利视频 | 国产一区二区在线播放 | 国产做爰免费视频观看 | 99精品国产高清在线观看 | 欧美综合亚洲图片综合区 | 国产精品第 | 久久尤物 | 成人免费视频一区二区 | 国产精品2区 | 欧美日韩电影一区二区 | 一区二区三区在线免费播放 | 日本一区二区视频在线 | 久久久久久综合 | 久久国产精品久久久久久久久久 | 久久三区| 亚洲一区二区三区欧美 | 国产主播精品 | 三级av| 求av网站 | 亚洲天天网 | 欧美性受xxxx黑人xyx | 亚洲高清视频在线观看 | 国产精品一区在线观看你懂的 | 自拍第二页 | 欧美日韩国产精品成人 | 久久9色| 国产精品嫩草影视久久久 | 国产一区二区观看 | 天天插天天干 | 国产日韩精品一区二区三区 | 91精品久久久久久久久青青 | 日韩欧美在线一区二区三区 | 99精品一区|