Apache Ignite:我的数据是从内存还是磁盘读取的?
Apache Ignite: is my data read from memory or disk?
我需要了解 Ignite 的以下配置是从内存还是从磁盘提供我的数据。
点燃配置:
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="defaultDataRegionConfiguration">
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="persistenceEnabled" value="true"/>
</bean>
</property>
</bean>
</property>
Java代码:
ClientConfiguration cfg = new ClientConfiguration().setAddresses("127.0.0.1:10800");
try (IgniteClient client = Ignition.startClient(cfg)) {
ClientCache<Long, SensorsWaiting> cache = client.cache("SQL_PUBLIC_FOO");
FieldsQueryCursor<List<?>> query = cache.query(new SqlFieldsQuery("select * from foo"));
}
提问背景:
我预计会有大量查询,并且需要从内存中获取结果。同时我需要将数据存储到磁盘以防 Ignite 服务器崩溃或需要重新启动。
- 我的理解是否正确,在这种情况下,我的数据是从内存中获取的?
- 如果我使用 JDBC 驱动程序会怎样?还是一样?缓存和jdbc驱动有什么区别?
如果它在内存中,它将从内存中提供,否则将从磁盘中提取。 (如果数据多于内存或集群启动时,这种区别很重要。)
不同的 API 都访问相同的数据。无论你使用JCache(get, put),SqlFieldsQuery还是JDBC/ODBC,都是一样的
我需要了解 Ignite 的以下配置是从内存还是从磁盘提供我的数据。
点燃配置:
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="defaultDataRegionConfiguration">
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="persistenceEnabled" value="true"/>
</bean>
</property>
</bean>
</property>
Java代码:
ClientConfiguration cfg = new ClientConfiguration().setAddresses("127.0.0.1:10800");
try (IgniteClient client = Ignition.startClient(cfg)) {
ClientCache<Long, SensorsWaiting> cache = client.cache("SQL_PUBLIC_FOO");
FieldsQueryCursor<List<?>> query = cache.query(new SqlFieldsQuery("select * from foo"));
}
提问背景: 我预计会有大量查询,并且需要从内存中获取结果。同时我需要将数据存储到磁盘以防 Ignite 服务器崩溃或需要重新启动。
- 我的理解是否正确,在这种情况下,我的数据是从内存中获取的?
- 如果我使用 JDBC 驱动程序会怎样?还是一样?缓存和jdbc驱动有什么区别?
如果它在内存中,它将从内存中提供,否则将从磁盘中提取。 (如果数据多于内存或集群启动时,这种区别很重要。)
不同的 API 都访问相同的数据。无论你使用JCache(get, put),SqlFieldsQuery还是JDBC/ODBC,都是一样的