You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ja...@apache.org on 2019/04/02 19:51:11 UTC
[incubator-pinot] branch fix_realtime_race_condition updated:
Update comments
This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch fix_realtime_race_condition
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/fix_realtime_race_condition by this push:
new 8adf7eb Update comments
8adf7eb is described below
commit 8adf7ebe8c75f246bb0fb5009f8adf3d97729ee9
Author: Jackie (Xiaotian) Jiang <xa...@linkedin.com>
AuthorDate: Tue Apr 2 12:50:47 2019 -0700
Update comments
---
.../core/operator/filter/BitmapBasedFilterOperator.java | 3 ---
.../impl/invertedindex/RealtimeInvertedIndexReader.java | 10 +++++-----
.../impl/invertedindex/RealtimeInvertedIndexReaderTest.java | 12 ++++++------
3 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/BitmapBasedFilterOperator.java b/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/BitmapBasedFilterOperator.java
index 7a82c15..b2b2883 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/BitmapBasedFilterOperator.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/operator/filter/BitmapBasedFilterOperator.java
@@ -25,12 +25,9 @@ import org.apache.pinot.core.operator.docidsets.BitmapDocIdSet;
import org.apache.pinot.core.operator.filter.predicate.PredicateEvaluator;
import org.apache.pinot.core.segment.index.readers.InvertedIndexReader;
import org.roaringbitmap.buffer.ImmutableRoaringBitmap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public class BitmapBasedFilterOperator extends BaseFilterOperator {
- private static final Logger LOGGER = LoggerFactory.getLogger(BitmapBasedFilterOperator.class);
private static final String OPERATOR_NAME = "BitmapBasedFilterOperator";
private final PredicateEvaluator _predicateEvaluator;
diff --git a/pinot-core/src/main/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReader.java b/pinot-core/src/main/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReader.java
index 28db4a1..704e13a 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReader.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReader.java
@@ -41,7 +41,7 @@ public class RealtimeInvertedIndexReader implements InvertedIndexReader<MutableR
}
/**
- * Adds the doc Id to the given dict Id's bitmap.
+ * Adds the document id to bitmap of the given dictionary id.
*/
public void add(int dictId, int docId) {
if (_bitmaps.size() == dictId) {
@@ -64,10 +64,10 @@ public class RealtimeInvertedIndexReader implements InvertedIndexReader<MutableR
ThreadSafeMutableRoaringBitmap bitmap;
try {
_readLock.lock();
- // NOTE: the given dict Id might not be added to the inverted index yet. We first add the value to the dictionary.
- // Before the value is added to the inverted index, the query might have predicates that match the newly added
- // value. In that case, the given dictionary Id does not exist in the inverted index, and we return an empty
- // bitmap. For multi-valued column, the dict Id might be larger than the bitmap size (not equal).
+ // NOTE: the given dictionary id might not be added to the inverted index yet. We first add the value to the
+ // dictionary. Before the value is added to the inverted index, the query might have predicates that match the
+ // newly added value. In that case, the given dictionary id does not exist in the inverted index, and we return an
+ // empty bitmap. For multi-valued column, the dictionary id might be larger than the bitmap size (not equal).
if (_bitmaps.size() <= dictId) {
return new MutableRoaringBitmap();
}
diff --git a/pinot-core/src/test/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReaderTest.java b/pinot-core/src/test/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReaderTest.java
index 7ecdc56..944eb74 100644
--- a/pinot-core/src/test/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReaderTest.java
+++ b/pinot-core/src/test/java/org/apache/pinot/core/realtime/impl/invertedindex/RealtimeInvertedIndexReaderTest.java
@@ -32,7 +32,7 @@ public class RealtimeInvertedIndexReaderTest {
public void testRealtimeInvertedIndexReader() {
RealtimeInvertedIndexReader realtimeInvertedIndexReader = new RealtimeInvertedIndexReader();
- // Add dict Id 0, doc Id 0 to the inverted index (single-value dict Id not added yet)
+ // Add dictionary id 0, document id 0 to the inverted index (single-value dictionary id not added yet)
// Before adding
MutableRoaringBitmap docIds = realtimeInvertedIndexReader.getDocIds(0);
assertNotNull(docIds);
@@ -45,7 +45,7 @@ public class RealtimeInvertedIndexReaderTest {
assertTrue(docIds.contains(0));
assertFalse(docIds.contains(1));
- // Add dict Id 0, doc Id 1 to the inverted index (single-value dict Id already added)
+ // Add dictionary id 0, document id 1 to the inverted index (single-value dictionary id already added)
// Before adding
docIds = realtimeInvertedIndexReader.getDocIds(1);
assertNotNull(docIds);
@@ -58,15 +58,15 @@ public class RealtimeInvertedIndexReaderTest {
assertTrue(docIds.contains(0));
assertTrue(docIds.contains(1));
- // Add dict Id 1 and 2, doc Id 2 to the inverted index (multi-value dict Ids not added yet)
- // Before adding dict Id 1
+ // Add dictionary id 1 and 2, document id 2 to the inverted index (multi-value dictionary ids not added yet)
+ // Before adding dictionary id 1
docIds = realtimeInvertedIndexReader.getDocIds(1);
assertNotNull(docIds);
assertTrue(docIds.isEmpty());
docIds = realtimeInvertedIndexReader.getDocIds(2);
assertNotNull(docIds);
assertTrue(docIds.isEmpty());
- // After adding dict Id 1 but before adding dict Id 2
+ // After adding dictionary id 1 but before adding dictionary id 2
realtimeInvertedIndexReader.add(1, 2);
docIds = realtimeInvertedIndexReader.getDocIds(0);
assertNotNull(docIds);
@@ -83,7 +83,7 @@ public class RealtimeInvertedIndexReaderTest {
docIds = realtimeInvertedIndexReader.getDocIds(2);
assertNotNull(docIds);
assertTrue(docIds.isEmpty());
- // After adding dict Id 2
+ // After adding dictionary id 2
realtimeInvertedIndexReader.add(2, 2);
docIds = realtimeInvertedIndexReader.getDocIds(0);
assertNotNull(docIds);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org