xiangfu0 opened a new pull request, #19480:
URL: https://github.com/apache/pinot/pull/19480

   ## What
   
   `ColumnMetadataImpl` eagerly allocated a `LongArrayList` plus its `long[2]` 
for index sizes on every instance, about 56 bytes per column, although sizes 
are only ever populated by `SegmentMetadataImpl` from a local v3 `index_map`. 
Metadata loaded from streams, v1/v2 segments and the built-in virtual columns 
never have any. They now live in a `long[]` that stays null until the first 
`addIndexSize`.
   
   `SegmentMetadataImpl` also skips the `v3/index_map` probe when it has no 
index directory: the stream constructor set `_indexDir = null`, so `new 
File((File) null, "v3/index_map").exists()` stat-ed a cwd-relative path once 
per segment and would have thrown on `_indexDir.getPath()` had that file 
existed.
   
   `indexSizeMap` still serializes as `{}` when empty, exactly as before.
   
   ## Tests
   
   `ColumnMetadataImplTest`: no sizes by default and an empty JSON 
`indexSizeMap`; positional and 48-bit round trip after `addIndexSize`; sizes in 
`equals`/`hashCode`/`toString`; invalid sizes rejected without being recorded. 
`SegmentMetadataImplTest`: the same v3 segment loaded through the directory 
constructor reports forward-index sizes while the stream constructor reports 
none and is otherwise equal.
   


-- 
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