简体   繁体   English

在 Windows 上安装 apache thrift

[英]installing apache thrift on windows

我整天都在尝试安装 apache thrift 谁能提供一个简单说明的指南,因为我没有从文档中得到任何东西,所以我下载了我试图运行/构建/安装的 .exe 文件但是它不起作用。

It's really simple.这真的很简单。

First, download the thrift standalone exe from their website.首先,从他们的网站下载 thrift 独立 exe。 It is a pre-compiled exe and you don't need anything after downloading it.这是一个预编译的exe,下载后不需要任何东西。 Actually ignore the second step in docs.实际上忽略文档中的第二步。

The way that thrift work is:节俭的工作方式是:

You write a thrift file in which you indicate which functions will be implemented/called and which data types will be transferred.您编写一个 thrift 文件,在其中指明将实现/调用哪些函数以及将传输哪些数据类型。

Then Thrift compiler can compile the thrift file to your target languages.然后 Thrift 编译器可以将 thrift 文件编译为您的目标语言。

You use generated files in your server/client apps.您在服务器/客户端应用程序中使用生成的文件。 The server must implement functionalities you specified and the client would call those functions.服务器必须实现您指定的功能,客户端将调用这些功能。

To achieve this create a .thrift file and put it on the same directory as thrift exe file is.为此,请创建一个 .thrift 文件并将其放在与 thrift exe 文件相同的目录中。 and after writing your functionality in .thrift file enter thrift --gen <language> <Thrift filename> in a command line(PowerShell, cmd, etc.) and you will get your language files that you can copy and use in your projects.在 .thrift 文件中编写功能后,在命令行(PowerShell、cmd 等)中输入thrift --gen <language> <Thrift filename> ,您将获得可以在项目中复制和使用的语言文件。

This is actually inspired by this video and I hope it help to start with thrift.这实际上是受此视频的启发,我希望它有助于从节俭开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM