-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated fast serializer generator to optimize the enum schema generat…
…ion (#20) * Updated fast serializer generator to optimize the enum schema generation This code change optimizes the way how to retrieve back the enum schema for avro-1.4, so that it doesn't need to parse a enum schema for every deserialization. Snippet of generated fast serializer: private Map<Long, Schema> enumSchemaMap = new ConcurrentHashMap<Long, Schema>(); ... public void serializetestRecord0(IndexedRecord data, Encoder encoder) throws IOException { Schema testEnumEnumSchema1; if (!enumSchemaMap.containsKey(-3346156575824446940L)) { testEnumEnumSchema1 = Schema.parse("{\"type\":\"enum\",\"name\":\"testEnum\",\"namespace\":\"com.adpilot.utils.generated.avro\",\"symbols\":[\"A\",\"B\"]}"); enumSchemaMap.put(-3346156575824446940L, testEnumEnumSchema1); } else { testEnumEnumSchema1 = enumSchemaMap.get(-3346156575824446940L); } ... * Addressed one minior performance issue The new generated code: ... Schema testEnumEnumSchema1 = enumSchemaMap.get(-3346156575824446940L); if (null == testEnumEnumSchema1) { testEnumEnumSchema1 = Schema.parse("{\"type\":\"enum\",\"name\":\"testEnum\",\"namespace\":\"com.adpilot.utils.generated.avro\",\"symbols\":[\"A\",\"B\"]}"); enumSchemaMap.put(-3346156575824446940L, testEnumEnumSchema1); } ...
- Loading branch information
Showing
7 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters