rohityadav1993 commented on code in PR #11584:
URL: https://github.com/apache/pinot/pull/11584#discussion_r1330441934


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/readers/LazyRow.java:
##########
@@ -0,0 +1,94 @@
+/**
+ * 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.segment.local.segment.readers;
+
+import java.io.IOException;
+import java.util.HashMap;
+import org.apache.pinot.segment.spi.IndexSegment;
+import org.apache.pinot.spi.data.readers.GenericRow;
+
+
+/**
+ * A wrapper class to read column values of a row. The wrapper can either be 
over a {@link IndexSegment} and docId or
+ * over a {@link GenericRow}<br>
+ * The advantage of having wrapper over segment and docId is column values are 
read only when
+ * {@link LazyRow#getValue(String)} is invoked.
+ * This is useful to reduce the disk reads incurred due to loading the 
previous row during merge step.
+ * There isn't any advantage to have a LazyRow wrap a GenericRow but has been 
kept for syntactic sugar.
+ */
+public class LazyRow {
+    private IndexSegment _segment;
+    private int _docId;
+    private GenericRow _row;
+
+    private HashMap<String, Object> _fieldToValueMap = new HashMap<>();

Review Comment:
   At least in the current usage, I don't see a requirement to have a 
ConcurrentHashMap as the merger happens per row per segment in a single thread 
manner. Do you see any usage where we want to use LazyRow and there can be 
multiple threads referencing it?
   I am taking reference from GenericRow which also uses hashmap.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to