【发布时间】:2016-12-22 07:57:42
【问题描述】:
我正在使用 IgniteCache.loadCache 通过 RDMS 和 Ignite 集成将数据从 Oracle 加载到 Ignite Cache(https://apacheignite-mix.readme.io/v1.7/docs/automatic-persistence)
我的主类将启动客户端模式 Ignite,并将数据写入 3 个节点的 Ignite 集群。
以下是查询同一张表不同条件的sql数组
String[] sqlArray = new String[]{
"select * from PERSON where id >=0 and id < 10000",
"select * from PERSON where id >=10000 and id < 20000",
..
"select * from PERSON where id >=10000000 and id < 10010000",
}
有两个选项可以运行这些 sql:
-
第一个选项是自己使用线程池:
for (int i = 0; i< sqlArray.length; i++) { //submit the load through thread pool ThreadPool.submit(new Runnable() { cache.loadCache(null, Integer.class.getName(), sqlArray[i]) } } -
第二个选项是:
cache.loadCache(null, sqlArray)
从性能上我会问,哪一个会更快,或者它们在性能上不会有显着差异?
【问题讨论】:
标签: ignite