mirror of https://github.com/apache/druid.git
Merge pull request #756 from metamx/dimdim-comments
add some comments about string interning
This commit is contained in:
commit
01bb7de3aa
|
@ -673,6 +673,10 @@ public class IncrementalIndex implements Iterable<Row>
|
|||
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);
|
||||
|
|
|
@ -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
|
|||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue