thrift

High performance object serialization library supporting sum types

江枫思渺然 提交于 2019-12-05 05:38:26
I wonder if any of the high performance serialization libraries (like Google protocol buffers) support sum types . Sum types are tagged unions, basically the ability to say that something is either A, B, or C. Sum types are used in languages such as Haskell and ML which support Algebraic Data Types If by "like Google protocol buffers" you mean ability to generate code for multiple languages then probably such thing doesn't exist. Emulating sum types in languages which don't support them is awkward at best (try to pattern match on boost:variant for example). So it makes sense to leave them out

聊聊storm的messageTimeout

大憨熊 提交于 2019-12-05 05:12:18
序 本文主要研究一下storm的messageTimeout TOPOLOGY_MESSAGE_TIMEOUT_SECS storm-2.0.0/storm-client/src/jvm/org/apache/storm/Config.java /** * True if Storm should timeout messages or not. Defaults to true. This is meant to be used in unit tests to prevent tuples from being * accidentally timed out during the test. */ @isBoolean public static final String TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS = "topology.enable.message.timeouts"; /** * The maximum amount of time given to the topology to fully process a message emitted by a spout. If the message is not acked within * this time frame, Storm will fail the message

python连接impala时,执行SQL报错expecting list of size 2 for struct args

孤街浪徒 提交于 2019-12-05 02:49:42
这个错误困扰了好久,因为集群有多台,暂放到其他几台机器上执行了SQL操作,一直在找解决方法,无意间得到真传,喜出望外啊 报错信息: Traceback (most recent call last): File "b.py", line 3, in <module> cur=conn.cursor() File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/hiveserver2.py", line 125, in cursor session = self.service.open_session(user, configuration) File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/hiveserver2.py", line 995, in open_session resp = self._rpc('OpenSession', req) File "/usr/local/python2.7/lib/python2.7/site-packages/impyla-v0.14.0-py2.7.egg/impala/hiveserver2

Thrift IPC over pipes transport (Windows)

那年仲夏 提交于 2019-12-05 01:53:34
问题 I've been following Thrift support for Windows and VS development has come a long way thanks to a number of contributors. There are VS 2010 projects for the compiler and C++ library and I've confirmed that they work well in 0.8. http://thrift.apache.org/download/ My question is about implementing a transport layer in Thrift, specifically pipes (named or anonymous). I've been using TCP transport which works but in cases where the apps are all local, it's overkill and generally causes other

Is there any performance benchmark for Thrift on HBase?

孤人 提交于 2019-12-04 23:49:22
问题 I have a system that may writing huge data to hbase. The system is written by c++ and found out that hbase have thrift interface for other languages. My question is, Is there any performance benchmark for Thrift on HBase? What is the most disadvantage compaire with java native api? 回答1: I recommend these recent two blog posts on this topic: HBase + Thrift performance part 1 HBase + Thrift performance part 2 The two posts give detailed performance measurements of using Thrift with HBase. 来源:

How to use java built-in exception in Thrift IDL

孤人 提交于 2019-12-04 22:28:10
I'd like to throws some java built-in exception such IOException in the Thrift IDL. like this: service B{ void removeLease() throws (1:ioexception e), } however, the Thrift compiler warns that ioexception doesn't be defined. Every java exception is serializable, so it's possible to wrap it into thrift exception. Thrift code: exception SerializedException { 1: required binary payload } service MyService { int method(1: required string param) throws (1: SerializedException serializedException); } Java server code: class MyServiceImpl implements MyService.Iface { int method(String param) throws

Cloudera/CDH v6.1.x + Python HappyBase v1.1.0: TTransportException(type=4, message='TSocket read 0 bytes')

浪子不回头ぞ 提交于 2019-12-04 21:58:53
EDIT: This question and answer applies to anyone who is experiencing the exception stated in the subject line: TTransportException(type=4, message='TSocket read 0 bytes') ; whether or not Cloudera and/or HappyBase is involved. The root issue (as it turned out) stems from mismatching protocol and/or transport formats on the client-side with what the server-side is implementing, and this can happen with any client/server paring. Mine just happened to be Cloudera and HappyBase, but yours needn't be and you can run into this same issue. Has anyone recently tried using the happybase v1.1.0 (latest)

thrift

*爱你&永不变心* 提交于 2019-12-04 21:04:09
/*--> */ /*--> */ 1.先安装brew   打开终端,输入ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"。当然也可以直接复制这个命令行粘贴到终端,按回车键   然后一会会跳出这个语句:Press RETURN to continue or any other key to abort,其意思就是按回车键继续,或者其他键跳出,当然我们按回车键,然后就开始安装了。   注意,有时候过程可能稍慢,请耐心等候,其以上过程可能需要输入你的本机账号密码,直接输入然后按回车键即可,   使用brew help确定是否安装成功。 2. 安装thrift brew install thrift  安装后会出现keg-only提示,没有管他。 3.编译文件   thrift -r -gen java nucdl.thrift 来源: https://www.cnblogs.com/anenyang/p/11883815.html

Session management in Thrift

烂漫一生 提交于 2019-12-04 18:35:47
I can't seem to find any documentation on how session management is supposed to be done in Thrift's RPC framework. I know I can do a TServer.setServerEventHandler(myEventHandler); and observe calls to createContext (called when a connection is established) and processContext (called before every method call). Still, I have to get whatever session state I maintain in those message into the handler itself. So how can I access session information in my handlers? Not sure if there isn't also a way to use the ServerEventHandler approach mentioned in my question, but here's how I was able to create

Thrift transport in javascript client

巧了我就是萌 提交于 2019-12-04 18:32:13
问题 I'm trying to build a javascript client for my Thrift server. The server is up and running and I can get calls to the server working with a PHP client. I just can't figure out the javascript client. In particular, instantiating the transport baffles me. The tutorial at http://thrift.apache.org/tutorial/js/ shows: function calc() { var transport = new Thrift.Transport("/thrift/service/tutorial/"); var protocol = new Thrift.Protocol(transport); var client = new CalculatorClient(protocol); When