最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

關(guān)于C#版Nebula客戶端編譯的問題

 更新時(shí)間:2021年07月21日 09:56:40   作者:靜若清池  
這篇文章主要介紹了C#版Nebula客戶端編譯的問題,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

一、需求背景

從Nebula的Github上可以發(fā)現(xiàn),Nebula為以下語言提供了客戶端SDK:

nebula-cpp
nebula-java
nebula-go
nebula-python
nebula-node
nebula-rust

我們公司的業(yè)務(wù)開發(fā)語言是C#,但Nebula卻沒有提供C#版的客戶端。

由于Nebula支持源碼編譯,索性只好嘗試動手編譯一個(gè)。

二、Thrift簡介

1.Thrift是Facebook在2007年貢獻(xiàn)給Apache基金會的一個(gè)開源項(xiàng)目:https://thrift.apache.org/

Thrift可以支持多種程序語言,例如:C++,C#,Cocoa,Erlang,Haskell,Java,Ocami,Perl,PHP,Python,Ruby,Smalltalk。

Thrift可以作為二進(jìn)制的高性能的通訊中間件,支持?jǐn)?shù)據(jù)(對象)序列化和多種類型的RPC服務(wù)

2.Facebook自己也維護(hù)了一個(gè)Thrift,目前已經(jīng)和Apache的Thrift差別較大,重寫了編譯器,重新實(shí)現(xiàn)了一個(gè)全異步的Thrift Server:https://github.com/facebook/fbthrift

Facebook Thrift is not a distribution of Apache Thrift.
This is an evolved internal branch of Thrift that Facebook re-released to open source community in February 2014.
Facebook Thrift was originally released closely tracking Apache Thrift but is now evolving in new directions.
In particular, the compiler was rewritten from scratch and the new implementation features a fully asynchronous Thrift server.

3.Nebula的客戶端基于Thrift文件進(jìn)行編譯的,但是使用的Thrift編譯器,不是Facebook貢獻(xiàn)給Apache的那個(gè)Thrift,而是Facebook自己維護(hù)的那個(gè)Thrift,有點(diǎn)繞。

4.Nebula提供的Thrift模板為:https://github.com/vesoft-inc/nebula-common/tree/master/src/common/interface

三、編譯前準(zhǔn)備工作

1.操作系統(tǒng)

通過VMware搭建的本地CenOS 7,虛擬機(jī)與主機(jī)健通過NAT網(wǎng)絡(luò)連接,內(nèi)存8G,宿主機(jī)有梯子可以FQ

2.安裝依賴

root# yum update
root# yum install -y make \
                 m4 \
                 git \
                 wget \
                 unzip \
                 xz \
                 readline-devel \
                 ncurses-devel \
                 zlib-devel \
                 gcc \
                 gcc-c++ \
                 cmake \
                 gettext \
                 curl \
                 redhat-lsb-core \
                 bzip2

3.檢查主機(jī)上的GCC和CMake版本是否正確

root# g++ --version
root# cmake --version

發(fā)現(xiàn)版本不正確,并且git clone也不好使,只好手動下載2.0.1版本的nebula-common:https://github.com/vesoft-inc/nebula-common/tree/v2.0.1

4.解壓上述的nebula-common-2.0.1.zip解壓,進(jìn)入nebula-common-2.0.1根目錄

5.依次執(zhí)行如下命令

// 安裝CMake。
root# ./third-party/install-cmake.sh cmake-install

// 啟用CMake。
root# source cmake-install/bin/enable-cmake.sh

//opt目錄添加寫權(quán)限。
root# sudo mkdir /opt/vesoft && sudo chmod -R a+w /opt/vesoft

// 安裝GCC。安裝到opt目錄需要寫權(quán)限,用戶也可以修改為其他目錄。
root# ./third-party/install-gcc.sh --prefix=/opt

// 啟用GCC。
root# source /opt/vesoft/toolset/gcc/7.5.0/enable

// 安裝第三方依賴
root# ./third-party/install-third-party.sh

四、編譯

1.進(jìn)入上述的nebula-common-2.0.1根目錄

2.依次執(zhí)行命令

root#cmake
root#make

3.查看基于Thrift模板生成的C#代碼

nebula-common-2.0.1/src/common/interface/gen-csharp/nebula

五、后續(xù)工作

目前只是根據(jù)Thrift模板生成了對應(yīng)C#接口的定義和解析,還需要參考Nebula提供的Java的客戶端代碼,翻譯成對應(yīng)的C#代碼

六、參考文檔

https://docs.nebula-graph.com.cn/2.0.1/4.deployment-and-installation/1.resource-preparations/

到此這篇關(guān)于C#版Nebula客戶端編譯的文章就介紹到這了,更多相關(guān)C#版Nebula客戶端編譯內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論

景德镇市| 德格县| 和静县| 南皮县| 宽城| 阿拉善盟| 介休市| 叙永县| 色达县| 延津县| 鹤庆县| 博白县| 剑阁县| 凤城市| 满城县| 阿拉尔市| 石嘴山市| 乐昌市| 公安县| 宝山区| 丰原市| 原阳县| 昌宁县| 江达县| 北流市| 潍坊市| 太白县| 五大连池市| 南皮县| 望都县| 三原县| 西峡县| 丹寨县| 碌曲县| 通道| 穆棱市| 佛坪县| 新化县| 道孚县| 西林县| 安吉县|