如何使用 apache drill 将 s3 数据保存在内存中?

How to keep s3 data in memory with apache drill?

使用 apache drill 查询存储在 aws s3 上的 JSON 数据效果非常好,但 drill 会为每个查询从 s3 获取新鲜数据。

如何告诉 drill 将数据保存在内存中以供下一次查询?

Apache drill 在查询完成后不存储数据。

根据文档

Distributed cache: Drill uses a distributed cache to manage metadata (not the data) and configuration information across various nodes. Sample metadata information that is stored in the cache includes query plan fragments, intermediate state of the query execution, and statistics. Drill uses Infinispan as its cache technology.

查看 drill 的 architecture 了解更多详情。

我找到的最佳解决方案是使用 http://tachyon-project.org/ 它使用 Ramdrive 来存储数据,因此来自 s3 的数据只被获取一次,稍后 apache drill 直接从 tachyon 读取数据。首先设置 tachyon 似乎很复杂,但最后你只需要在配置中更改 6 行,然后将 tachyon jar 复制到 drill 中。

更新 2016-07-22
经过一些测试后,我发现快子过于复杂。现在我使用 s3 sdk 的同步工具和 linux & osx 上的 ramdrive 来保持数据的快速访问,到目前为止效果很好。

更新 2018-02-09
最后我们选择了一个 linux RAM 驱动器,效果非常好