Thrift 版本之间的数据格式兼容性

发布于 2024-10-10 14:27:24 字数 234 浏览 8 评论 0原文

我正在尝试升级使用 Thrift 0.2 库进行通信的系统。由于这是相当旧的版本(最新稳定版是 0.5),并且据称性能有显着改进(0.4),我希望升级。但是,我找不到有关基础数据格式是否存在不兼容更改的信息。根据版本控制方案,人们希望没有;但由于这些仍然是 1.0 之前的版本,可能对稳定性的期望较低。

我希望了解数据格式本身向后兼容的原因是它允许对组件进行一一升级。

无论如何:我希望有更多信息的人可以指出我正确的文档。

I am trying to upgrade a system that uses Thrift 0.2 libraries for communication. Since this is rather old version (latest stable is 0.5), and there have been alleged significant improvements to performance (in 0.4) I was hoping to upgrade. However, I could not find information regarding whether there have been incompatible changes to underlying data format. Based on versioning scheme, one would hope there was not; but since these are still pre-1.0 versions, maybe there is less expectation for stability.

The reason I am hoping to learn that data format itself was backwards compatible is that it would allow upgrades to components to occur one by one.

Anyway: I was hoping that someone with more information could point me to right documentation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

成熟的代价 2024-10-17 14:27:27

...我们不再使用 byte[] 作为二进制字段的基础数据类型,而是改用 ByteBuffer。这意味着我们可以避免在反序列化期间进行不必要的字节数组分配和复制。这种方法比旧方法快了整整 2.5 倍,而且这还没有考虑到垃圾收集时间的减少。 您肯定需要进行一些代码更改才能升级,但您仍然会发现它是值得的。

摘自“Thrift 0.4.0 已发布” 文档。源代码中的相关更改:“将二进制字段实现从 byte[] 切换到 ByteBuffer”。

... instead of using byte[] as the underlying data type for binary fields, we’ve switched to using ByteBuffer. The means that we can avoid doing unnecessary byte array allocation and copies during deserialization. This approach is a full 2.5x times faster than the old way, and that’s not even accounting for the reduction in garbage collection time. You’ll definitely have to make some code changes to get the upgrade, but you should still find it worthwhile.

Taken from "Thrift 0.4.0 Released" document. Related changes in the source code: "Switch binary field implementation from byte[] to ByteBuffer".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文