You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/08/28 10:16:19 UTC
[GitHub] [pinot] richardstartin commented on a change in pull request #7373: Optimize IndexedTable
richardstartin commented on a change in pull request #7373:
URL: https://github.com/apache/pinot/pull/7373#discussion_r697849005
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/data/table/IndexedTable.java
##########
@@ -84,7 +93,45 @@ public boolean upsert(Record record) {
return upsert(new Key(keyValues), record);
}
- public abstract int getNumResizes();
+ @Override
+ public int size() {
+ return _topRecords != null ? _topRecords.size() : _lookupMap.size();
+ }
+
+ /**
+ * Resizes the lookup map based on the trim size.
+ */
+ protected void resize() {
+ long startTimeMs = System.currentTimeMillis();
+ _tableResizer.resizeRecordsMap(_lookupMap, _trimSize);
+ long resizeTimeMs = System.currentTimeMillis() - startTimeMs;
Review comment:
This clock is subject to adjustments, so can jump forwards and backwards. For relative time measurement of synchronous code, System.nanoTime() is the right clock to use.
--
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-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org