mcvsubbu commented on a change in pull request #4791: Support STRING and BYTES 
for no dictionary columns in realtime consuming segments
URL: https://github.com/apache/incubator-pinot/pull/4791#discussion_r365477903
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/io/readerwriter/impl/VarByteSingleColumnSingleValueReaderWriter.java
 ##########
 @@ -0,0 +1,122 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.io.readerwriter.impl;
+
+import java.io.IOException;
+import org.apache.pinot.common.utils.StringUtil;
+import 
org.apache.pinot.core.io.readerwriter.BaseSingleColumnSingleValueReaderWriter;
+import org.apache.pinot.core.io.readerwriter.PinotDataBufferMemoryManager;
+import org.apache.pinot.core.io.writer.impl.MutableOffHeapByteArrayStore;
+
+public class VarByteSingleColumnSingleValueReaderWriter extends 
BaseSingleColumnSingleValueReaderWriter {
+  private final MutableOffHeapByteArrayStore _byteArrayStore;
+  private int _lengthOfShortestElement;
+  private int _lengthOfLongestElement;
+
+  public VarByteSingleColumnSingleValueReaderWriter(
+      PinotDataBufferMemoryManager memoryManager,
+      String allocationContext,
+      int estimatedMaxNumberOfValues,
+      int estimatedAverageStringLength) {
+    _byteArrayStore = new MutableOffHeapByteArrayStore(memoryManager, 
allocationContext, estimatedMaxNumberOfValues, estimatedAverageStringLength);
 
 Review comment:
   You may want to consider analyzing the performance (via benchmark) to use 
`OffHeapMutableBytesStore` instead. @Jackie-Jiang did some performance 
comparison, so you can check with him. For the dictionary use case, I was not 
entirely convinced that it is better performant, but for forward index it may 
be.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to