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

Support byte[] in @HollowPrimaryKey for ObjectInternPool in HollowHistoryUI #669

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PiotrAuguscik
Copy link
Contributor

This PR is a follow-up to my previous attempt to resolve an IllegalArgumentException encountered when interning byte[] objects in Hollow which was subsequently reverted due to unforeseen issues. As suggested by @Sunjeet, proposed solution has now been implemented and tested.

Changes Made:

  • Applied the patch suggested by @Sunjeet, adding support for byte[] interning within ObjectInternPool.
  • Conducted thorough testing to confirm the fix addresses the issue without adverse effects on Hollow's functionality.

Acknowledgements:
Special thanks to @Sunjeet

Original description:
When loading states with byte[] as the primary key in Hollow, the ObjectInternPool throws an IllegalArgumentException. This issue occurs because the current implementation of ObjectInternPool does not support interning objects of type byte[], which is needed by HollowHistoryUI.

The proposed solution extends the ObjectInternPool functionality to handle byte[] effectively, allowing HollowHistoryUI to intern these objects without errors.

Current implementation throws exception:

Caused by: java.lang.IllegalArgumentException: Cannot intern object of type [B
	at com.netflix.hollow.tools.util.ObjectInternPool.writeAndGetOrdinal(ObjectInternPool.java:123)
	at com.netflix.hollow.tools.history.keyindex.HollowOrdinalMapper.storeFieldObjects(HollowOrdinalMapper.java:182)
	at com.netflix.hollow.tools.history.keyindex.HollowOrdinalMapper.storeNewRecord(HollowOrdinalMapper.java:168)
	at com.netflix.hollow.tools.history.keyindex.HollowHistoryTypeKeyIndex.writeKeyObject(HollowHistoryTypeKeyIndex.java:159)
	at com.netflix.hollow.tools.history.keyindex.HollowHistoryTypeKeyIndex.populateAllCurrentRecordKeysIntoIndex(HollowHistoryTypeKeyIndex.java:153)
	at com.netflix.hollow.tools.history.keyindex.HollowHistoryTypeKeyIndex.update(HollowHistoryTypeKeyIndex.java:126)
	at com.netflix.hollow.tools.history.keyindex.HollowHistoryKeyIndex.lambda$updateTypeIndexes$0(HollowHistoryKeyIndex.java:143)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)

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

Successfully merging this pull request may close these issues.

1 participant