前置知识
在开始本教程之前,建议您具备以下基础知识:
- Java基础语法
- Maven项目管理
- 分布式系统基础概念
- 缓存相关知识
什么是Apache Ignite?
Apache Ignite是一个分布式数据库和计算平台,它提供:
- 分布式数据网格:内存中的分布式键值存储
- 分布式计算:在集群中执行计算任务
- SQL支持:支持分布式SQL查询
- 内存优先架构:数据优先存储在内存中,可选持久化
- ACID事务:支持分布式事务
2025/9/17大约 3 分钟
前置知识
在开始本教程之前,建议您具备以下基础知识:
Apache Ignite是一个分布式数据库和计算平台,它提供:
前置知识
在学习本文之前,请确保您已经:
CacheConfiguration<String, User> cacheCfg = new CacheConfiguration<>();
// 设置缓存名称
cacheCfg.setName("userCache");
// 设置缓存模式
cacheCfg.setCacheMode(CacheMode.PARTITIONED);
// 设置原子性模式
cacheCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
// 设置备份数
cacheCfg.setBackups(1);
前置知识
在学习本文之前,请确保您已经:
// 获取计算网格实例
IgniteCompute compute = ignite.compute();
// 获取集群组
ClusterGroup remoteGroup = ignite.cluster().forRemotes();
IgniteCompute remoteCompute = ignite.compute(remoteGroup);
前置知识
在学习本文之前,请确保您已经:
@Data
@QuerySqlField.Group(
indexes = {
@QuerySqlField.Index(name = "idx_salary", fields = {"salary"}),
@QuerySqlField.Index(name = "idx_dept_salary", fields = {"department", "salary"})
}
)
public class Employee {
@QuerySqlField(index = true)
private long id;
@QuerySqlField(index = true)
private String name;
@QuerySqlField
private String department;
@QuerySqlField
private double salary;
}
前置知识
在学习本文之前,请确保您已经:
public interface CalculatorService {
int add(int a, int b);
int subtract(int a, int b);
int multiply(int a, int b);
double divide(int a, int b);
}