mirror of
https://github.com/apache/druid.git
synced 2025-02-26 04:55:24 +00:00
add some comments about string interning
This commit is contained in:
parent
73623467e7
commit
d15cd8fde7
@ -673,6 +673,10 @@ public class IncrementalIndex implements Iterable<Row>
|
|||||||
falseIdsReverse = biMap.inverse();
|
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)
|
public String get(String value)
|
||||||
{
|
{
|
||||||
return value == null ? null : poorMansInterning.get(value);
|
return value == null ? null : poorMansInterning.get(value);
|
||||||
|
@ -525,6 +525,10 @@ public class IncrementalIndexStorageAdapter implements StorageAdapter
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (String dimVal : dims[dimIndex]) {
|
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) {
|
if (id == dimVal) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user