Reputation: 27
Does ignite cache maintains String pool as it is done by JVM? For ex if I want to store the objects of following Employee class:
public Class Employee{ int empId, String departmentName }
Since multiple emp objects will have same departName, Will there be memory optimization done by ignite, So that there won't be muliple times memory allocation for the departmentName, having same value?
Upvotes: 0
Views: 66
Reputation: 3591
There is no such feature in Ignite out of the box, but you can implement something similar using a dictionary table.
For example instead of having a single table Employee (empId int, departmentName varchar)
you can have two: Emplloyee (empId int, depId int)
and Departments (depId int, depName varchar)
. So, repeating department names will be stored only once. The same approach can be applied for any values that can occur multiple times in the database.
Upvotes: 2