Alexander Kolbasov created SENTRY-1804:
------------------------------------------
Summary: Sentry server can be more efficient in handling full
snapshot from HMS
Key: SENTRY-1804
URL: https://issues.apache.org/jira/browse/SENTRY-1804
Project: Sentry
Issue Type: Improvement
Components: Sentry
Affects Versions: sentry-ha-redesign
Reporter: Alexander Kolbasov
When Sentry server creates a full snapshot, it does the following:
1) Calls {{fetchFullUpdate()}} to get a full snapshot. This returns
{{Map<String, Set<String>>}}
2) Goes through all entries and converts them to a different format, allocating
memory again for each element:
{code}
for (Map.Entry<String, Set<String>> authzPath :
authzPaths.entrySet()) {
createAuthzPathsMappingCore(pm, nextHmsImageID, authzPath.getKey(),
authzPath.getValue());
}
{code}
The original full snapshot is then garbage collected and the new one persisted.
Instead, {{fetchFullUpdate()}} should just create the full snapshot immediately
in the final form. This way we do not have to allocate twice as much memory as
needed.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)