msfroh commented on issue #12989: URL: https://github.com/apache/lucene/issues/12989#issuecomment-1879403796
I took a look and I think we might be able to do it a little easier: ``` public abstract class ParallelTaxonomyArrays { public class ChunkedArray { private final int chunkSize; private final int[][] chunks; public ChunkedArray(int chunkSize, int[][] chunks) { this.chunkSize = chunkSize; this.chunks = chunks; } public int get(int i) { int chunkNum = i / chunkSize; return chunks[chunkNum][i - (chunkNum * chunkSize)]; } public int length() { return chunkSize * chunks.length; } } /** Sole constructor. */ public ParallelTaxonomyArrays() {} public abstract ChunkedArray parents(); public abstract ChunkedArray children(); public abstract ChunkedArray siblings(); } ``` Then within `TaxonomyIndexArrays`, we can focus on building `int[][]` instances that get wrapped in `ChunkedArray`. I feel like `IntBlockPool` might be overkill? -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org