Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(entity-client): enable client side cache for entity-client and usage-client #8877

Merged

Conversation

david-leifker
Copy link
Collaborator

Created a client cache for entity-client, enabled on the system-entity-client specifically. Features include per aspect TTL, maximum size (roughly), and cache metrics.

This cache is particularly useful for caching the usage stats calls on search result pages and user information where for a given page load there are multiple calls to fetch the same information.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added product PR or Issue related to the DataHub UI/UX devops PR or Issue related to DataHub backend & deployment labels Sep 21, 2023
private RestliEntityClient _entityClient;
private EntityRegistry _entityRegistry;

public final static ImmutableSet<String> EXCLUDED_ASPECTS = ImmutableSet.<String>builder()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hydrator is used when writing to datahub usage events. Lineage is known to exceed ES document sizes and is of questionable value for analytics. Excluding various lineage aspects from the DUE entities. The entities themselves are still recorded.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the Constants.*_ASPECT_NAME static strings here?

@@ -0,0 +1,134 @@
package com.linkedin.common.client;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the core logic, built on the available Caffeine cache.

@david-leifker david-leifker merged commit aef49b8 into datahub-project:master Sep 22, 2023
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops PR or Issue related to DataHub backend & deployment product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants