clintropolis commented on code in PR #14563:
URL: https://github.com/apache/druid/pull/14563#discussion_r1260168541
##########
processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:
##########
@@ -238,75 +232,243 @@ static int getNumberOfFilesRequired(int bagSize, long
numWritten)
return numberOfFilesRequired;
}
+ protected final ObjectStrategy<T> strategy;
+ protected final boolean allowReverseLookup;
+ protected final int size;
- private final boolean versionOne;
+ public GenericIndexed(
+ final ObjectStrategy<T> strategy,
+ final boolean allowReverseLookup,
+ final int size
+ )
+ {
+ this.strategy = strategy;
+ this.allowReverseLookup = allowReverseLookup;
+ this.size = size;
+ }
- private final ObjectStrategy<T> strategy;
- private final boolean allowReverseLookup;
- private final int size;
- private final ByteBuffer headerBuffer;
+ public abstract BufferIndexed singleThreaded();
- private final ByteBuffer firstValueBuffer;
+ @Override
+ public abstract long getSerializedSize();
+
+ private static final class V1<T> extends GenericIndexed<T>
Review Comment:
super nit: this file seems like a bit of a mess (not really new, this change
just exaggerates it a bit more), maybe these classes could live closer to
`BufferIndexed` and after the shared instance methods of `GenericIndexed`?
##########
processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:
##########
@@ -82,7 +82,7 @@
*
* @see GenericIndexedWriter
*/
-public class GenericIndexed<T> implements CloseableIndexed<T>, Serializer
+public abstract class GenericIndexed<T> implements CloseableIndexed<T>,
Serializer
Review Comment:
side thought, i wonder if we should remove Serializer from GenericIndexed,
it seems to only be used in IndexMergerV9 to write out column lists, which seem
like just as easily could be using GenericIndexedWriter like everything else.
--
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]