Add endpoint to run topk aggregation - #452
Open
zipdoki wants to merge 22 commits into
Open
Conversation
…top-k-agg # Conflicts: # engine/src/main/kotlin/com/kakao/actionbase/engine/service/AggregationService.kt # engine/src/test/kotlin/com/kakao/actionbase/engine/service/AggregationServiceSpec.kt
…urce and target entities; update tests to validate directional behavior.
…top-k-agg # Conflicts: # core/src/main/kotlin/com/kakao/actionbase/core/metadata/common/AggregationConstants.kt # engine/src/main/kotlin/com/kakao/actionbase/engine/service/AggregationService.kt # engine/src/main/kotlin/com/kakao/actionbase/v2/engine/v3/V2BackedEngine.kt # engine/src/main/kotlin/com/kakao/actionbase/v2/engine/v3/V3TableDescriptor.kt # engine/src/test/kotlin/com/kakao/actionbase/engine/service/AggregationServiceSpec.kt # server/src/main/kotlin/com/kakao/actionbase/server/api/graph/v3/metadata/MetadataAggController.kt # server/src/test/kotlin/com/kakao/actionbase/server/api/graph/v3/metadata/MetadataAggControllerE2ETest.kt
…aggregates cleanly.
…artitioning for hash calculations.
…ips recomputation.
…top-k-agg # Conflicts: # core/src/main/kotlin/com/kakao/actionbase/core/metadata/common/AggregationConstants.kt # server/src/test/kotlin/com/kakao/actionbase/server/api/graph/v3/metadata/MetadataAggControllerE2ETest.kt
Refresh handling moves to a separate API, so the aggregate flow no longer needs to detect expire CDC items and reroute them. Drops: - `isExpire` branching in `createTopkEvent` / `processTopk` / `aggregateTopk` - `isExpire` field on `EdgeAggregationEvent` and its properties-based `of` overload Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Follow-up on the terminology change from #400: the score row is still valid at the refresh timestamp, just due for a rebuild. Applied end-to- end so the aggregate flow and its persisted schema line up: - `AggregationConstants`: `TOPK_EXPIRE_TABLE` / `_PARTITIONS` and `expireSource` / `expireTarget` renamed - `AggregationService`: local `expiresAt` and property key `"expiresAt"` renamed - Refresh tracker table schema: column `expiresAt` → `refreshAt`, index `expires_at_asc` → `refresh_at_asc`, table comment updated Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…top-k-agg # Conflicts: # server/src/test/kotlin/com/kakao/actionbase/server/api/graph/v3/metadata/MetadataAggControllerE2ETest.kt
…top-k-agg # Conflicts: # server/src/test/kotlin/com/kakao/actionbase/server/filter/ReadOnlyRequestFilterTest.kt
zipdoki
force-pushed
the
feature/per-entity-top-k-agg
branch
from
July 23, 2026 01:18
4301f7f to
d0cca8a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an endpoint that runs a topk aggregation for a batch of edge events. For each event, the service queries the group's aggregation and writes the score row into the topk score table.
Changes
POST /graph/v3/aggregations— accepts anAggregationItemRequestand returns per-itemAggregationResult.AggregationService.aggregate(type, items)— fans items out to events, dispatches per aggregation type, resolves ranges ({source}/{target}/{_source}/{_target}/ user properties), writes score entries to the score table keyed by${entity}|${topkName}.EdgeAggregationEventdomain model for the item × group unit.How to Test
./gradlew :engine:test --tests "com.kakao.actionbase.engine.service.AggregationServiceSpec"./gradlew :server:test --tests "com.kakao.actionbase.server.api.graph.v3.metadata.MetadataAggControllerE2ETest"AI Assistance