diff --git a/processing/src/main/java/io/druid/segment/incremental/IncrementalIndex.java b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndex.java index 487c9544f92..87789e4ceba 100644 --- a/processing/src/main/java/io/druid/segment/incremental/IncrementalIndex.java +++ b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndex.java @@ -673,6 +673,10 @@ public class IncrementalIndex implements Iterable falseIdsReverse = biMap.inverse(); } + /** + * Returns the interned String value to allow fast comparisons using `==` instead of `.equals()` + * @see io.druid.segment.incremental.IncrementalIndexStorageAdapter.EntryHolderValueMatcherFactory#makeValueMatcher(String, String) + */ public String get(String value) { return value == null ? null : poorMansInterning.get(value); diff --git a/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java index 6d742509ca2..df47c2574ca 100644 --- a/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java +++ b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java @@ -528,6 +528,10 @@ public class IncrementalIndexStorageAdapter implements StorageAdapter } for (String dimVal : dims[dimIndex]) { + /** + * using == here instead of .equals() to speed up lookups made possible by + * {@link io.druid.segment.incremental.IncrementalIndex.DimDim#poorMansInterning} + */ if (id == dimVal) { return true; } @@ -600,4 +604,4 @@ public class IncrementalIndexStorageAdapter implements StorageAdapter }; } } -} \ No newline at end of file +}