abhishekagarwal87 commented on a change in pull request #12073:
URL: https://github.com/apache/druid/pull/12073#discussion_r783146278



##########
File path: 
processing/src/main/java/org/apache/druid/query/aggregation/AggregatorAndSize.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.druid.query.aggregation;
+
+/**
+ * Encapsulates an {@link Aggregator} and the initial size in bytes required by
+ * the Aggregator.
+ */
+public class AggregatorAndSize
+{
+
+  // TODO: include default overhead for object sizes
+
+  private final Aggregator aggregator;
+  private final long initialSizeBytes;

Review comment:
       can you add more info like is this total on-heap footprint that includes 
JVM object overhead or that overhead is not considered in this initial size? 

##########
File path: 
processing/src/main/java/org/apache/druid/query/aggregation/Aggregator.java
##########
@@ -42,6 +42,12 @@
 {
   void aggregate();
 
+  default long aggregateWithSize()

Review comment:
       this method needs javadocs

##########
File path: 
processing/src/main/java/org/apache/druid/segment/EncodedDimensionValue.java
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.druid.segment;
+
+import javax.annotation.Nullable;
+
+/**
+ * @param <K> Encoded key component type
+ */
+public class EncodedDimensionValue<K>
+{
+  @Nullable
+  private final K value;
+  private final long incrementalSizeBytes;

Review comment:
       can you add a comment on what this thing is the incremental size of

##########
File path: 
processing/src/main/java/org/apache/druid/segment/DimensionDictionary.java
##########
@@ -160,4 +173,16 @@ public int getIdForNull()
       lock.readLock().unlock();
     }
   }
+
+  private long getObjectSize(@Nonnull T object)

Review comment:
       +1. 

##########
File path: 
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/theta/SketchAggregatorFactory.java
##########
@@ -80,6 +81,14 @@ public Aggregator factorize(ColumnSelectorFactory 
metricFactory)
     return new SketchAggregator(selector, size);
   }
 
+  @Override
+  public AggregatorAndSize factorizeWithSize(ColumnSelectorFactory 
metricFactory)

Review comment:
       this needs some documentation. 




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