Repository navigation
Add TypedKeyFieldValue and fix Cache.Field in codec-java - #302
Merged
Merged
Conversation
The server's `LabelEntity` mixes V2 `Index` with V3 `Cache` (from
`core.metadata.common`), so `caches[].fields[].*` is emitted as `field`
(V3 IndexField), not `name` (V2 Index.Field). The V2 client's `Cache`
reused `Index.Field`, so deserializing a real `GET
/graph/v2/service/{service}/label/{label}` response produced null field
names and downstream encoding errors.
Introduce a dedicated `Cache.Field` with `@JsonProperty("field")`,
matching `core.metadata.common.IndexField`. `Index.Field` keeps the
legacy `name` key, since V2 indices are still serialized that way.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Introduce KeyFieldValueV2 carrying EncodedEdgeType alongside the encoded key/field/value, and switch BulkEdgeEncoder.bulkEncodeAll to return List<KeyFieldValueV2<T>>. The original KeyFieldValue is left untouched so existing scan/query call sites in the engine module are unaffected; fromV1/fromV2 adapters bridge the two. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
em3s
reviewed
May 6, 2026
|
|
||
| import com.kakao.actionbase.v2.core.metadata.EncodedEdgeType; | ||
|
|
||
| public class KeyFieldValueV2<T> { |
Contributor
There was a problem hiding this comment.
How about TypedKeyFieldValue instead of the ambiguous V2 suffix?
The V2 suffix only meant "the version with EncodedEdgeType", which is already what the type tag conveys. TypedKeyFieldValue makes the intent self-evident at call sites and removes the misleading versioning. The fromV1/fromV2 adapters collapse into a single overloaded `from` for the same reason. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Contributor
Author
|
@em3s |
Contributor
|
LGTM 👍 |
codec-java
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
Two fixes to V2 codec edge encoding.
Cache.fieldswire shape. ServerLabelEntitymixes V2Indexwith V3Cache, socaches[].fields[].*uses the V3 keyfield, not V2'sname. V2'sCachereusedIndex.Field, so real responses deserialized to null names and broke encoding. NewCache.Fieldannotated@JsonProperty("field");Index.Fieldkeepsname.Row type tag on bulk output.
bulkEncodeAllconsumers couldn't tell hash from indexed/cache/counter rows without re-decoding keys.TypedKeyFieldValue<T>carriesEncodedEdgeTypewithkey/field/value, andbulkEncodeAllnow returnsList<TypedKeyFieldValue<T>>. Kept separate fromKeyFieldValueso engine scan paths (HBaseHashLabel,JdbcHashLabel) stay untouched; overloadedfromadapters bridge them.Closes #
Changes
Cache.Fieldwith@JsonProperty("field")to match the V3 server wire shape (core.metadata.common.IndexField);Index.Fieldkeeps the legacynamekey.TypedKeyFieldValue<T>carryingEncodedEdgeTypealongsidekey/field/value.BulkEdgeEncoder.bulkEncodeAllto returnList<TypedKeyFieldValue<T>>; updateAbstractEdgeEncodersignatures accordingly.fromadapters betweenKeyFieldValueandTypedKeyFieldValue; existing engine scan/query paths are unchanged.BulkEdgeEncoderand apply spotless formatting to the codec-java module.LabelDTOTests; updateBulkEdgeEncoderTestsandMultiEdgeBulkEdgeEncoderTestsfor the new return type.How to Test
./gradlew :codec-java:test— covers both fixes viaBulkEdgeEncoderTests,MultiEdgeBulkEdgeEncoderTests, and the newLabelDTOTests../gradlew test— full suite green; engine integration tests confirm the existingKeyFieldValuescan path is untouched.AI Assistance