public class StripedHashFunction<T> extends Object
It calculates the number of segments based on the concurrency level desired and hashes the object to the corresponding segments.
Constructor and Description |
---|
StripedHashFunction(int concurrencyLevel) |
Modifier and Type | Method and Description |
---|---|
int |
getNumSegments() |
int |
hashToSegment(T object)
It calculates the segment in which the object belongs.
|
public final int getNumSegments()
public final int hashToSegment(T object)
object
- the object to hash.getNumSegments()
-1.Copyright © 2021 JBoss by Red Hat. All rights reserved.