thrift

Pig script to read Cassandra table

时间秒杀一切 提交于 2019-12-11 11:06:58
问题 Trying to write a Pig script that will extract data from a Cassandra table. The Pig script looks like this: REGISTER ./cassandra-all-2.0.8.39.jar REGISTER ./datastax-agent-4.1.4-standalone.jar REGISTER ./cassandra-driver-core-2.0.2.1.jar REGISTER ./apache-cassandra-thrift-2.0.12.jar A = LOAD 'cql://username:password/mykeyspace/mycolumnfamily' USING org.apache.cassandra.hadoop.pig.CqlStorage() AS (user_id:long, fname:chararray, last_update_date:chararray, lname:chararray); DUMP A; I keep

How to handle requests using different thread pools in Thrift?

落花浮王杯 提交于 2019-12-11 09:06:47
问题 I have a thrift service that has two methods 1. Response processSync(Request req) : This method synchronously processes requests and returns a response. The client thread gets blocked until the request is completely processed by the server. 2. void processAsync(Request req) : This method is for asynchronous processing. Here as soon as the server completely receives the request, the call returns with no output. Client thread does not wait until the request is processed by the server. While

Apache thrift can not make

淺唱寂寞╮ 提交于 2019-12-11 07:48:34
问题 When I'm trying to configure and make thrift 0.9.1 it gives some errors. Can anyone tell me the reason for that and what should I do to overcome this issue. Errors are shown in below. user@linux-yyzo:~/WorkDir/thrift-0.9.1> make make all-recursive make[1]: Entering directory `/home/user/WorkDir/thrift-0.9.1' Making all in compiler/cpp make[2]: Entering directory `/home/user/WorkDir/thrift-0.9.1/compiler/cpp' make all-am make[3]: Entering directory `/home/user/WorkDir/thrift-0.9.1/compiler/cpp

Removing “gen-java” prefix from auto-generated Java files with sbt-thrift in SBT 0.12?

拜拜、爱过 提交于 2019-12-11 05:45:30
问题 I am working with sbt-thrift plugin 0.6 and SBT 0.12 . In my thrift files I have mentioned the namespace as below. namespace java abc.xyz //some //thrift //codes But the generated files goes to gen-java/abc/xyz ( gen-java prefix is added automatically). How can I change this into abc/xyz ? 回答1: There is an -out <outdir> option which does exactly that. In your case, specify the current folder . as the outdir. Note that, unlike with the automatically generated gen-* folders, the outdir

How to cross-compile thrift for ARM

我们两清 提交于 2019-12-11 04:54:23
问题 I tried this command to configure thrift, ./configure CXX=arm-linux-gnueabi-g++ CC=arm-linux-gnueabi-gcc --prefix=/arms/thrift --host=arm-linux-gnueabi --with-cpp --with-boost=/path-to-boost-for-arm and met the following error msg checking for boostlib >= 1.40.0... yes checking for libevent >= 1.0... configure: error: in `/arms/thrift-0.9.0': configure: error: cannot run test program while cross compiling Is there any solution? 回答1: You get the error because a dependency it's trying to find

How to convert thrift objects to readable string and convert it back?

北战南征 提交于 2019-12-11 03:35:17
问题 Sometimes, we need to create some thrift objects in unit tests. We can do it by manually create object using Java code, like: MyObj myObj = new MyObj(); myObj.setName("???"); myObj.setAge(111); But which is not convenient. I'm looking for a way to create objects with some readable text. We can convert thrift objects to JSON with TSimpleJSONProtocol , and get very readable JSON string, like: { "name": "???", "age": 111 } But the problem is TSimpleJSONProtocol is write only, thrift can't read

Thrift Client can't connect

最后都变了- 提交于 2019-12-11 01:34:35
问题 I have a thrift server and client that work when running on the same computer, but when I run the client on a different computer (using the IP of the server computer), the client can't connect. Both computers are linux. Any ideas? EDIT: if I go on my server computer and check activity on certain IPs using sudo netstat -tulpn | grep [ip]:[port] , I get: 172.18.18.106:9090 -> nothing :9090 -> tcp 0 0 0.0.0.0:9090 0.0.0.0:* LISTEN 10642/server Is there a way to change 0.0.0.0 to my ip? 回答1: Yes,

Thrift gem and JRuby

半世苍凉 提交于 2019-12-11 01:28:05
问题 I just recently installed JRuby and the Thrift gem after using it in MRI. I'm running into a problem where if I require 'thrift' I get the message "Unable to load thrift_native extension. Defaulting to pure Ruby libraries." If I then try and require the code thrift generated in ruby I'll get this error: "NameError: uninitialized constant Thrift::Struct_Union" Is the thrift gem currently not working with JRuby? Is there something I can do to use thrift with JRuby besides using the gem? EDIT:

Thrift: Is it possible to do only serialization with the C (GLib) Thrift library?

淺唱寂寞╮ 提交于 2019-12-11 01:15:10
问题 I am trying to use this example but it always return write_len = 10 bytes. ThriftTransport* transport = THRIFT_TRANSPORT( g_object_new(THRIFT_TYPE_MEMORY_BUFFER, "buf_size", 8096, NULL)); ThriftProtocol* protocol = THRIFT_PROTOCOL( g_object_new(THRIFT_TYPE_BINARY_PROTOCOL, "transport", transport, NULL)); Exception* src = g_object_new(TYPE_EXCEPTION, NULL); ExceptionClass* cls = EXCEPTION_GET_CLASS(src); g_object_set(src, "ex_sign", exception_signature, "cl_sign", class_signature, "caught",

How to stream an image from Python to C++ using Apache Thrift

僤鯓⒐⒋嵵緔 提交于 2019-12-11 00:28:14
问题 How could I stream files(images) using Apache Thrift? I have searched a lot about Thrift and did not find any well written documentation regarding to it. Why did Facebook open sourced this project without docs? 回答1: The way I would recommend is to set up your service to deliver data in chunks, like so: struct DataChunk { 1 : binary data 2 : bool haveMoreData } service { DataChunk GetChunk( 1 : string resource, 2: i32 offset, 3: i32 size) } It seems a good idea to either limit the size to some