leventov commented on a change in pull request #7938: locking in Theta sketch 
buffer aggregator
URL: https://github.com/apache/incubator-druid/pull/7938#discussion_r317997383
 
 

 ##########
 File path: 
extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregator.java
 ##########
 @@ -86,7 +84,7 @@ public void aggregate(final ByteBuffer buf, final int 
position)
       return;
     }
     final WritableMemory mem = WritableMemory.wrap(buf, 
ByteOrder.LITTLE_ENDIAN).writableRegion(position, size);
-    final Lock lock = 
stripedLock.getAt(HllSketchBuildBufferAggregator.lockIndex(position)).writeLock();
+    final Lock lock = 
stripedLock.getAt(StripedLockHelper.lockIndex(position)).writeLock();
     lock.lock();
     try {
       final Union union = Union.writableWrap(mem);
 
 Review comment:
   If this statement can update the memory, please add a comment like `// 
Union.writableWrap(mem) can update the memory, therefore it must be inside the 
critical section.`. Otherwise, please move the statement outside of the 
critical section and add a comment like `// Union.writableWrap(mem) cannot 
update the memory, therefore it can be outside the critical section.`

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