Jackie-Jiang opened a new pull request, #19656:
URL: https://github.com/apache/pinot/pull/19656

   ## Summary
   Mutable segments create their dictionaries through the static 
`DictionaryIndexType.createMutableDictionary(MutableIndexContext, 
DictionaryIndexConfig)`, so unlike the other indexes, a plugin overriding the 
dictionary index type (with a higher `IndexPlugin` priority) could not 
substitute its own mutable dictionary. This makes it pluggable:
   - `createMutableDictionary(MutableIndexContext, DictionaryIndexConfig)` 
becomes an instance method, and `MutableSegmentImpl` calls it on the dictionary 
index type registered in `IndexService` (`StandardIndexes.dictionary()`).
   - It computes the sizing hints as before and delegates to a new `protected 
createMutableDictionary(DataType storedType, boolean offHeap, 
PinotDataBufferMemoryManager memoryManager, int avgLength, int cardinality, 
String allocationContext)`, which is the override point: a subclass substitutes 
its own dictionary for some of the stored types and delegates to `super` for 
the rest.
   
   To let such a dictionary specialize the STRING paths (e.g. compare ASCII 
values as raw bytes) by extending `StringOffHeapMutableDictionary` instead of 
copying it:
   - The fields of `StringOffHeapMutableDictionary` are `protected`.
   - `MutableOffHeapByteArrayStore` gets `compareValueAt(index, byte[])` and 
`compareValues(index1, index2)`, comparing the stored bytes in place in 
unsigned lexicographic order. The buffer lookup and the start/end offset math 
that every accessor repeated are factored into `getBuffer` / `getStartOffset` / 
`getEndOffset`; their behavior is unchanged.
   
   The default dictionary index type behaves exactly as before: the same 
`MutableDictionaryFactory` call with the same arguments.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to