![]() ![]() ![]() These all need to be achieved by themselves. Thrift only provides protocol RPC functionality and does not provide flume channel functionality, as well as multiple source load balance functions. Void Thriftsourceprotocolclient::send_append (constevent) void Thriftsourceprotocolclient::send_appendbatch (const std::vector & Events)Ĥ. You may be able to send an event without confirmation of success (not tested) via Send_append,send_appendbatch. Both the Append and the Appendbatch methods are blocking methods.ģ. ![]() Status::type Thriftsourceprotocolclient::appendbatch (const std::vector & EventsĢ. There is also a method appendbatch used to send more than one event at a time: Status::type thriftsourceprotocolclient::append (constevent) The Append method is used to send an event: Create thrift socket, transport, protocol, client.ġ class thriftclientġ. Include some header files, and namespaces using thriftġ#include 2#include 3#include 4#include 5 6 using namespacestd 7 using namespaceApache::thrift 8 using namespaceapache::thrift::p rotocol 9 using namespaceApache::thrift::transport Ģ. If you're working under Linux, you don't need to change any code.ġ. Note : If you are developing under Windows/visual Studio, you need to modify the Flume.thrift because of the error in conflict with the keyword.įerror, //original error, modified to ferror. cpp files are generated, after which the methods in the C + + code need to be called for RPC communication. This is the Thrift Protocol rule file for Flume, which executes the command: Thrift-r-gen cpp./flume.thrift Under Extract directory Flume-ng-sdk/src/main/thrift, there is a file flume.thrift. Download the flume source package and unzip it.ģ. Install the thrift and install the flume.Ģ. Here are some implementation-specific methods:ġ. The thrift is used to communicate with the remote flume thrift source. In the choice of protocol, AVRO C + +, although there are Apache open source projects, but currently only support read and write files, but not the use of RPC. Rage, rewrite the code, use C + + with the remote Java flume docking. The project requires C + + code to interface with the Flume, which in turn writes the log to HDFs.įlume native to Java code, the original solution was to invoke the Flume Java method via JNI.īut because of the concern about the efficiency of JNI calls, and the fact that the C + + call JNI needs to take care of the local reference and GC issues, the headache has been caused. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |