返回首页
当前位置: 主页 > 编程语言 > C#教程 >

Flume C# Thrift客户端实现代码

时间:2017-06-04 22:40来源:电脑教程学习网 www.etwiki.cn 编辑:admin

Flume Thrift Source ThriftSouce.java 使用TCompactProtocol、TFastFramedTransport做协议传输层。
而我们的DSF注册系统的Thrift使用TFramedTransport做传输层。翻看Thrift的API,看两个类的区别:

```

This transport is wire compatible with TFramedTransport, but makes use of reusable, expanding read and write buffers in order to avoid allocating new byte[]s all the time. Since the buffers only expand, you should probably only use this transport if your messages are not too variably large, unless the persistent memory cost is not an issue. This implementation is NOT threadsafe.

```

貌似互相兼容、下一步C#客户端,使用TFramedTransport与Flume ThriftSouce交互、看看是否兼容

测试了半个小时、可以正常发送接受数据。

 


注意:event在C#里面是关键字,所以利用Thrift编译器生成客户端的接口时,要把所有event关键字改成events

------分隔线----------------------------
标签(Tag):c#
------分隔线----------------------------
推荐内容
猜你感兴趣