thrift

Requests hang when using Hiveserver2 Thrift Java client

做~自己de王妃 提交于 2019-11-28 09:18:56
This is a follow up question to this question where I ask what the Hiveserver 2 thrift java client API is. This question should be able to stand along without that background if you don't need any more context. Unable to find any documentation on how to use the hiverserver2 thrift api, I put this together. The best reference I could find was the Apache JDBC implementation . TSocket transport = new TSocket("hive.example.com", 10002); transport.setTimeout(999999999); TBinaryProtocol protocol = new TBinaryProtocol(transport); TCLIService.Client client = new TCLIService.Client(protocol); transport

TNonblockingServer, TThreadedServer and TThreadPoolServer, which one fits best for my case?

拜拜、爱过 提交于 2019-11-28 09:11:55
Our analytic server is written in c++. It basically queries underlying storage engine and returns a fairly big structured data via thrift. A typical requests will take about 0.05 to 0.6 seconds to finish depends on the request size. I noticed that there are a few options in terms of which Thrift server we can use in the c++ code, specifically TNonblockingServer, TThreadedServer, and TThreadPoolServer. It seems like TNonblockingServer is the way to go since it can support much more concurrent requests and still using a thread pool behind the scene to crunch through the tasks. It also avoids the

Thrift large file in messages

纵饮孤独 提交于 2019-11-28 08:25:34
问题 I am using thrift for binary protocol over tcp, for sending and reading files (maximum size of 64MB). Is thrift is capable for this? I have thought using: struct SomeMessage { 1: byte data } How thrift is efficient about this? marshaling/unmarshaling/sending over the wire? 回答1: Thrift is capable, and the recommended data type is binary . Using byte would transfer only one signed 8-bit number, and list<byte> is way less efficient. The question is, whether it makes sense to burden that load

Thrift API load test

拥有回忆 提交于 2019-11-28 06:55:27
问题 I am new into Apache Jmeter. Basically I want to load test our couple of thrift APIs but have no clue where to start with. It is in java where api takes 2 parameter and then send java object as response. Any pointer would be very helpful. 回答1: You can use JSR223 Sampler + Groovy (add groovy-all.jar in jmeter/lib) and look at this client example, see NonblockingClient code for an example: http://www.javacodegeeks.com/2012/03/apache-thrift-quickstart-tutorial.html Make your groovy code call a

Advantages of using cql over thrift

爱⌒轻易说出口 提交于 2019-11-28 05:04:54
Are there any distinct advantages for using cql over thrift or is it simply a case of developers being too used to SQL? I'm wanting to switch from thrift querying to cql, the only problem is I'm not sure about the downsides of doing so. What are they? Lyuben Todorov Querying In CQL you can query cassandra and get data in a couple of lines (using JDBC driver): String query = "SELECT * FROM message;"; PreparedStatement statement = con.prepareStatement(query); While in thrift based API's it's a bit more complicated (example with Astyanax): OperationResult<ColumnList<String>> result = keyspace

RPC框架初体验之Thrift

痞子三分冷 提交于 2019-11-28 03:09:46
RPC框架初体验之Thrift 版本说明:thrfit 0.12.0 模块说明: thrift-demo-java-api: 使用thrift生成Java api thrift-demo-java-server: Java 实现Thrift服务端 thrift-demo-java-client:Java实现Thrift客户端 thrift-demo-py-api:使用thrift生成Python api thrift-demo-py-server:Python实现Thrift服务端 thrift-demo-py-client:Python实现Thrift客户端 1 前言 上一篇文章《RPC框架初体验之Dubbo》,体验了阿里开源的RPC框架,该框架体验还算不错,业界使用也较多。但是仅支持Java语言,不能进行跨语言。这里就体验一款性能不错,评价不错,且支持跨语言的RPC框架thrfit。本篇将分别使用Java和Python实现thrift的服务端和客户端,并进行交叉调用。 2 项目准备 2.1 thrfit 安装 thrift的安装方式有好多种,像我在mac环境可以使用brew install thrfit的方式进行安装,也可以通过源码编译的方式进行安装。同样在linux环境下,centos可以使用yum,ubantu可以使用apt,当然unix的环境都可以使用源码编译的方式安装

Thrift 入门之helloWorld

时光怂恿深爱的人放手 提交于 2019-11-27 23:42:14
不多说,先看项目结构 首先先编写一个hello.thrift的文件 hello.thrift namespace java sawshaw service HelloService { string hello(1:string method, 2:string param) }  注意了,这个namespace是 thrift 根目录下tutorial目录的gen-java目录下的,如果没有这个目录,先cmd到tutorial目录,执行thrift -r --gen java tutorial.thrift。就会看到一个gen-java目录了,而这个sawshaw是我自定义的目录,把这个hello.thrift文件放到和tutorial目录同级,cmd到该目录后执行 thrift -r --gen java hello.thrift 可以看到生成了一个HelloService的java类 把这个类复制到项目下面改下包名就可以了 再写个实现类HelloImpl对客户端的请求作响应 HelloImpl package com.sawshaw.thrift; import org.apache.thrift.TException; import com.sawshaw.thrift.HelloService.Iface; public class HelloImpl

Thrift入门之mac下的安装流程

那年仲夏 提交于 2019-11-27 23:41:50
新建一个maven项目,先下载maven依赖 http://thrift.apache.org/download <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <version>0.11.0</version> </dependency>   再安装需要的工具 http://thrift.apache.org/docs/install/os_x 我的是MacBook Pro,按照要求, 安装thrift的工具依赖boost库 下载地址: www.boost.org ,找到最新的版本下载, 下载之后解压,然后用cmd模式进入到解压文件夹的根目录。 执行命令 ./bootstrap.sh sudo ./b2 threading=multi address-model=64 variant=release stage install   如果出现 missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun 错误, 先执行 xcode-select --install 安装thrift的工具依赖libevent库 下载地址:http://libevent.org,找一个稳定版本下载,

What are the key differences between Apache Thrift, Google Protocol Buffers, MessagePack, ASN.1 and Apache Avro?

≡放荡痞女 提交于 2019-11-27 19:41:56
问题 All of these provide binary serialization, RPC frameworks and IDL. I'm interested in key differences between them and characteristics (performance, ease of use, programming languages support). If you know any other similar technologies, please mention it in an answer. 回答1: ASN.1 is an ISO/ISE standard. It has a very readable source language and a variety of back-ends, both binary and human-readable. Being an international standard (and an old one at that!) the source language is a bit kitchen

使用Java快速入门Thrift

元气小坏坏 提交于 2019-11-27 18:25:40
Apache Thrift 是一个facebook建立的RPC框架,现在是一个Apache的顶级项目。Thrift允许通过一个跨语言的定义文件的方式定义数据类型和服务接口,这个文件作为RPC客户端和服务器通信的标准,你也可以去看看Thrift的白皮书了解更多信息。 根据Apache Thrift的官方站点的描述,Thrift是一个: software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages. 安装Thrift比较的烦,但是在Windows下官方编译了一个thrift.exe,下载安装就行了。 写 Thrift定义文件(.thrift file) 如果你之前有接触过这个东西的话,写定义文件非常的简单