Skip to content

Phase 4: Type expansion (Int / Long / Bool / Double / Date / String) #5

Description

@TomiCheng

Goal

Extend Put / Get beyond byte[] to the common scalar types so the client is useful for typical caching workloads. End of this phase: the same Put / Get path round-trips int, long, bool, double, DateTime, and string against a real Geode container.

Done when

  • Each of the MVP DSFIDs encodes / decodes correctly:
    • String (DSFID 87)
    • Integer (i32)
    • Long (i64)
    • Boolean
    • Double
    • Date
    • byte[] (already covered by Phase 3)
    • null
  • Integration test (Testcontainers) round-trips each type — Put then Get returns an equal value.
  • Type mismatch on GetAsync<T> (server stored an int, caller asked for string) raises a typed exception, not a silent failure.

Tasks

  • src/Geode.Client/Serialization/DSCode.cs — enum / constants for the MVP subset.
  • src/Geode.Client/Serialization/ValueSerializer.csEncode<T> / Decode<T> switch on DSCode.
  • src/Geode.Client/Serialization/StringSerializer.cs — UTF-8 with the modified-UTF-8 rules Geode actually uses (verify against cppcache/src/DataOutput.cpp::writeUTF).
  • src/Geode.Client/Serialization/DateSerializer.csDateTime ↔ Java epoch milliseconds.
  • tests/Geode.Client.Tests/Serialization/ValueSerializerTests.cs (byte fixtures per type).
  • tests/Geode.Client.IntegrationTests/TypedPutGetTests.cs.

References

  • cppcache/include/geode/internal/DSCode.hpp — DSFID values.
  • cppcache/src/DataOutput.cpp / DataInput.cpp — primitive write/read.
  • cppcache/src/CacheableString.cpp — string encoding rules (mind the modified-UTF-8 quirks for \0 and surrogate pairs).
  • CLAUDE.md → "Serialisation (MVP)".

Out of scope

  • PDX (Phase 11) — typed objects with arbitrary fields.
  • Collections (List, HashMap) — Phase 11+.
  • Custom user serialisers.

Branch

feat/phase-4-type-expansion

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions