Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] ClassResolver separates ClassIdAllocator #1412

Open
LiangliangSui opened this issue Mar 18, 2024 · 1 comment
Open

[Java] ClassResolver separates ClassIdAllocator #1412

LiangliangSui opened this issue Mar 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@LiangliangSui
Copy link
Contributor

Is your feature request related to a problem? Please describe.

  1. ClassId is allocated using ClassIdAllocator. The ClassId allocation task is separated from ClassResolver. ClassIdAllocator is referenced in ClassResolver to reduce the complexity of ClassResolver.
  2. The interface is exposed to users through the Fury class. Users can obtain a ClassId through the interface instead of specifying it at will (specifying it at will may trigger an exception)

Additional context

Could you elabrate more the ClassIdAllocator?
I'm not sure how it handle such an situation: there are three libraries and one client of three libraries. Every libraries has some classes to register, but they can't assume the register order since they don't know which will be registered first, so they use specified class id for such registration. If the client has two versions, the first version use library1 and library2, and the second version use library1 and library3. Then the registered ids in library2 should be left here, those ids shouldn't be used by library3. Will the ClassIdAllocator handle such cases?

The purpose is to retain the ClassId registered in lib2.

Can we define such an interface such as allocateClassId(short beginClassId)?

This way the user can specify the starting position of the ClassId.

If the user does not specify beginClassId, Fury will take over the entire ClassId assignment.

That is, exposing two interfaces to users

Fury#allocateClassId(short beginClassId)
Fury#allocateClassId()
@LiangliangSui LiangliangSui added the enhancement New feature or request label Mar 18, 2024
@LiangliangSui
Copy link
Contributor Author

Hey @chaokunyang , we can discuss ClassIdAllocator related content here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant