Skip to content

[java] Compile time processing of row format codecs聽#3671

Open

Description

@stevenschlansker

馃挕Feature Request

Currently, Fory Java will generate all row codec classes at runtime. You can see it print in the application startup logs - generate source code, compile, load class.

Java supports compiler hooks in the form of annotation processors. This allows you to inspect code under compilation, generate new code, and then have javac continue to compile that.

Would it make sense to add support to Fory to pre-generate codec classes during compile time? Then your deployable application already has all classes available, potentially pre-verified and pre-linked using class data sharing, without bringing a compile step into runtime.

I note some open issues about foryc compiler with a Maven plugin, but this seems to be a different issue, more related to IDL compilation.

The generated code will be less flexible - not possible to dynamically link in an updated version of Fory, you must inline any runtime Fory deps.

Is this an interesting approach? If it would not conflict with any other project future directions, I might attempt a prototype at some point.

Activity

  1. chaokunyang commented on May 11, 2026

    @chaokunyang
    Collaborator

    This is interesting. Actually I have implemented annotation processor to generate static serializer in #3670. You can extend it, to add row format encoder support later.

  2. stevenschlansker commented on May 11, 2026

    @stevenschlansker
    ContributorAuthor

    That is very interesting, I will follow your PR and consider extending it.

  3. alisha-1000 commented on Sep 14, 2026

    @alisha-1000

    Hi! I鈥檇 like to work on this issue. I鈥檒l first review the annotation processor implementation in #3670 and understand how the existing static serializers are generated. Then I鈥檇 like to explore extending it to support row format encoder generation at compile time. If the approach looks feasible, I鈥檇 be happy to work on a PR.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions