fluxninja / aperture

Rate limiting, caching, and request prioritization for modern workloads
https://docs.fluxninja.com
Apache License 2.0
622 stars 24 forks source link

Support caching in java sdk #3030

Closed IridiumOxide closed 9 months ago

IridiumOxide commented 9 months ago

Description of change

Checklist

Summary by CodeRabbit

@coderabbitai ignore

coderabbitai[bot] commented 9 months ago

Walkthrough

The updates to the Aperture SDK for Java focus on enhancing caching capabilities. New classes and enums have been introduced to handle cache lookups, insertions, and deletions, along with additional fields and methods in existing classes to support these features. Exception handling and logging have been improved, and the Flow class now includes new fields and methods for cache interaction and error retrieval.

Changes

File Path Change Summary
.../aperture/sdk/ApertureSDK.java Added CacheLookupRequest import and updated startFlow method with new cacheLookupRequest field and exception handling.
.../aperture/sdk/FeatureFlowParameters.java Added resultCacheKey and globalCacheKeys fields with getters and builder methods.
.../aperture/sdk/Flow.java Added imports, new fields, constructor parameters, methods for cache interaction, exception handling, and logging.
.../aperture/sdk/cache/KeyDeleteResponse.java Introduced new class with error field and getter.
.../aperture/sdk/cache/KeyLookupResponse.java Added new class with value, lookupStatus, error fields, constructor, and getters.
.../aperture/sdk/cache/KeyUpsertResponse.java Created new class with error field, constructor, and getter.
.../aperture/sdk/cache/LookupStatus.java Introduced new enum with HIT and MISS constants and getValue method.
.../aperture/sdk/cache/Utils.java New class with static methods to convert cache lookup status and errors.

🐇✨ In the land of code, where Java beans sprout, A rabbit hopped in, with a cache-flush shout. "New keys to add, and old ones to clear, Let's celebrate the cache, with a hop and a cheer!" 🎉🐰 ✨🐇


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`