Skip to content

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